Skip to main content
`Ctrl`+`K`

# doxysphinx.toc

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

## Classes

`TocGenerator` | TocGenerator protocol.
`DoxygenTocGenerator` | A TocGenerator for doxygen.

## Module Contents

class doxysphinx.toc.TocGenerator(source_dir: pathlib.Path)

  Bases: `Protocol`

  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]

    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)

  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]

    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