diff --git a/muppet/output.py b/muppet/output.py index 676bbb464f7e58a61c2b027ad6a42464bead527c..242b3b59d44b9a7f72054f43d12919c674fab7a1 100644 --- a/muppet/output.py +++ b/muppet/output.py @@ -352,14 +352,22 @@ def setup_module(base: str, module: ModuleEntry, *, path_base: str) -> None: name, _ = os.path.splitext(filename) with open(filepath) as f: 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: - 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, module=module,