Auto Docs

A simple CLI script rendering templates.

class simple_template_tool.FileSystemImpl(info_dir, templates_dir, output_dir)

An implementation that uses the filesystem.

__init__(info_dir, templates_dir, output_dir)

Instantiate the implementation.

Requires the location of the relevant directories as pathlib.Path objects.

gather_templates()

Gather all the templates from the templates dir.

Gathers all files who are in the templates directory and instantiates them as templates. Note this isn’t recursive.

generate_context()

Generate the context for rendering the templates.

This implementation creates a single “info” kwarg and bundles all provided files under it, by file name sans .json

output_templates(templates)

Output all rendered templates in the outputs directory.

Rendered templates will share the same file name as the templates they were derived from.

process(output=True)

Gather the data, render the templates, and optionally output.

static render_templates(templates, context)

Render the templates with the provided context.

simple_template_tool.main(info_directory, templates_directory, output_directory)

Primary logic / control flow.