Add unicode-input docs redirect
This commit is contained in:
parent
7e449dec4f
commit
5956639082
22
publish.py
22
publish.py
@ -79,14 +79,7 @@ def run_html(args: Any) -> None:
|
|||||||
add_old_redirects('docs/_build/dirhtml')
|
add_old_redirects('docs/_build/dirhtml')
|
||||||
|
|
||||||
|
|
||||||
def add_old_redirects(loc: str) -> None:
|
def generate_redirect_html(link_name: str, bname: str) -> None:
|
||||||
for dirpath, dirnames, filenames in os.walk(loc):
|
|
||||||
if dirpath != loc:
|
|
||||||
for fname in filenames:
|
|
||||||
if fname == 'index.html':
|
|
||||||
bname = os.path.basename(dirpath)
|
|
||||||
base = os.path.dirname(dirpath)
|
|
||||||
link_name = os.path.join(base, f'{bname}.html') if base else f'{bname}.html'
|
|
||||||
with open(link_name, 'w') as f:
|
with open(link_name, 'w') as f:
|
||||||
f.write(f'''
|
f.write(f'''
|
||||||
<html>
|
<html>
|
||||||
@ -107,6 +100,19 @@ window.location.replace('./{bname}/' + window.location.hash);
|
|||||||
''')
|
''')
|
||||||
|
|
||||||
|
|
||||||
|
def add_old_redirects(loc: str) -> None:
|
||||||
|
for dirpath, dirnames, filenames in os.walk(loc):
|
||||||
|
if dirpath != loc:
|
||||||
|
for fname in filenames:
|
||||||
|
if fname == 'index.html':
|
||||||
|
bname = os.path.basename(dirpath)
|
||||||
|
base = os.path.dirname(dirpath)
|
||||||
|
link_name = os.path.join(base, f'{bname}.html') if base else f'{bname}.html'
|
||||||
|
generate_redirect_html(link_name, bname)
|
||||||
|
|
||||||
|
generate_redirect_html(os.path.join(loc, 'kittens', 'unicode-input.html'), 'unicode_input')
|
||||||
|
|
||||||
|
|
||||||
def run_docs(args: Any) -> None:
|
def run_docs(args: Any) -> None:
|
||||||
subprocess.check_call(['make', 'docs'])
|
subprocess.check_call(['make', 'docs'])
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user