template

Jinja2 Template rendering module for Sphinx documentation generation.

docfly.template.get_template(name: str) Template[source]

Load a Jinja2 template by name from the template directory.

class docfly.template.TemplateEnum[source]

Enum container for loaded Jinja2 templates.

docfly.template.ModuleTemplateParams

Parameters for module template rendering.

docfly.template.render_module(params: Module) str[source]

Render module template for Sphinx documentation.

Example module docfly.auto_api_doc:

Example rendered document source:

auto_api_doc
============

.. automodule:: docfly.auto_api_doc
    :members:
class docfly.template.PackageTemplateParams(package: Package, sub_packages: list[Package], sub_modules: list[Module])[source]

Parameters for package template rendering.

docfly.template.render_package(params: PackageTemplateParams) str[source]

Render package template for Sphinx documentation.

Example package docfly:

Example rendered document source:

docfly
======

.. automodule:: docfly
    :members:

sub packages and modules
------------------------

.. toctree::
    :maxdepth: 1

    directives <directives/__init__>
    template <template/__init__>
    auto_api_doc <auto_api_doc>
    autotoctree <autotoctree>

See:

class docfly.template.TocTemplateParams(page_folders: list[PageFolder], maxdepth: int | None = None)[source]

Parameters for TOC template rendering.

docfly.template.render_toc(params: TocTemplateParams) str[source]

Render toctree template for Sphinx documentation.

Example table of content tree docfly project docs/sources:

Example rendered document source:

.. toctree::
    :maxdepth: 1

    Quick Start <01-Quick-Start/index>
    Sphinx Style Guide <02-Sphinx-Style-Guide/index>

sub packages and modules