BlueBrain / nmodl

Code Generation Framework For NEURON MODeling Language
https://bluebrain.github.io/nmodl/
Apache License 2.0
48 stars 15 forks source link

Remove docs in `html` dir #1303

Closed JCGoran closed 3 weeks ago

JCGoran commented 4 weeks ago

This is one option to handle the old docs without resulting in 404s for the users: any /html/path/to/file.html now has a redirect to /path/to/file.html. Generated via the following code:

from pathlib import Path

root_dir = Path("./")

for file in root_dir.glob("html/**/*.html"):
    with open(file, "w", encoding="utf-8") as f:
        redirect_path = "./" / Path(*file.parts[1:])
        f.write(f'<meta http-equiv="refresh" content="0; url=/{redirect_path}">')

EDIT: deleted the html dir entirely.