Skip to content
Snippets Groups Projects
Commit 9ab7da31 authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

Upstream markdown files now rendered within template.

parent 4b981e88
No related branches found
No related tags found
No related merge requests found
...@@ -352,14 +352,22 @@ def setup_module(base: str, module: ModuleEntry, *, path_base: str) -> None: ...@@ -352,14 +352,22 @@ def setup_module(base: str, module: ModuleEntry, *, path_base: str) -> None:
name, _ = os.path.splitext(filename) name, _ = os.path.splitext(filename)
with open(filepath) as f: with open(filepath) as f:
raw_content = f.read() raw_content = f.read()
content = commonmark(raw_content)
out_path = os.path.join(path, f'{name}.html') pathlib.Path(os.path.join(path, name)).mkdir(exist_ok=True)
out_path = os.path.join(path, name, 'index.html')
content = commonmark(raw_content)
template = jinja.get_template('content.html')
crumbs = breadcrumbs(('Environment', ''),
module.name,
name)
with open(out_path, 'w') as f: with open(out_path, 'w') as f:
f.write(content) f.write(template.render(content=content,
path_base=path_base,
breadcrumbs=crumbs))
doc_files[name] = os.path.join(module.name, f'{name}.html') doc_files[name] = os.path.join(module.name, name, 'index.html')
setup_module_index(base=path, setup_module_index(base=path,
module=module, module=module,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment