doxysphinx.toc#

The toc module contains classes related to the toctree generation for doxygen htmls/rsts.

Module Contents#

Classes#

TocGenerator

TocGenerator protocol.

DoxygenTocGenerator

A TocGenerator for doxygen.

class doxysphinx.toc.TocGenerator(source_dir: pathlib.Path)[source]#

Bases: Protocol

Inheritance diagram of doxysphinx.toc.TocGenerator

TocGenerator protocol.

Gets the source_dir (with the html sources) during init and each file to possibly generate a toctree directive for in the generate_toc_for() method. The implementer has then to choose how to implement the toc generation.

generate_toc_for(file: pathlib.Path) Iterable[str][source]#

Generate a toctree directive for a given file.

Parameters:

file – the file to generate the toctree directive for

Returns:

a string interable representing the lines forming the toctree directive

class doxysphinx.toc.DoxygenTocGenerator(source_dir: pathlib.Path)[source]#

A TocGenerator for doxygen.

Will read the menudata.js to check whether a toctree directive needs to be generated or not.

generate_toc_for(file: pathlib.Path) Iterator[str][source]#

Generate a toctree directive for a given file.

Note that the toctree will only be generated when the file is part of a menu structure. :param file: the file to generate the toctree directive for :return: a string iterator representing the lines forming the toctree directive