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

Minor cleanup.

parent fe8c251c
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import argparse import argparse
import pathlib import pathlib
import os
from .cache import Cache from .cache import Cache
from .gather import get_module, get_modules, ModuleEntry from .gather import get_module, get_modules, ModuleEntry
...@@ -46,6 +47,8 @@ def __main() -> None: ...@@ -46,6 +47,8 @@ def __main() -> None:
# print(module) # print(module)
setup_module('output', module, path_base=args.path_base) setup_module('output', module, path_base=args.path_base)
os.system("cp -r static output")
if __name__ == '__main__': if __name__ == '__main__':
__main() __main()
...@@ -39,7 +39,16 @@ jinja = Environment( ...@@ -39,7 +39,16 @@ jinja = Environment(
def setup_index(base: str, modules: list[ModuleEntry], *, path_base: str) -> None: def setup_index(base: str, modules: list[ModuleEntry], *, path_base: str) -> None:
"""Create the main index.html file.""" """
Create the main index.html file.
:param base:
Path to output directory.
:param modules:
Modules to include in the index.
:param path_base:
Web path where this module will be deployed
"""
template = jinja.get_template('index.html') template = jinja.get_template('index.html')
with open(os.path.join(base, 'index.html'), 'w') as f: with open(os.path.join(base, 'index.html'), 'w') as f:
f.write(template.render(modules=modules, f.write(template.render(modules=modules,
...@@ -218,6 +227,13 @@ def setup_module(base: str, module: ModuleEntry, *, path_base: str) -> None: ...@@ -218,6 +227,13 @@ def setup_module(base: str, module: ModuleEntry, *, path_base: str) -> None:
Create all output files for a puppet module. Create all output files for a puppet module.
Will generate a directory under base for the module. Will generate a directory under base for the module.
:param base:
Path to output directory.
:param modules:
Modules to document.
:param path_base:
Web path where this module will be deployed
""" """
path = os.path.join(base, module.name) path = os.path.join(base, module.name)
pathlib.Path(path).mkdir(exist_ok=True) pathlib.Path(path).mkdir(exist_ok=True)
...@@ -270,8 +286,6 @@ def setup_module(base: str, module: ModuleEntry, *, path_base: str) -> None: ...@@ -270,8 +286,6 @@ def setup_module(base: str, module: ModuleEntry, *, path_base: str) -> None:
f.write(template.render(content=format_type_alias(type_alias), f.write(template.render(content=format_type_alias(type_alias),
path_base=path_base)) path_base=path_base))
os.system("cp -r static output")
# data['data_type_aliases'] # data['data_type_aliases']
# data['defined_types'] # data['defined_types']
# data['resource_types'] # data['resource_types']
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment