pydata_sphinx_theme.toctree#

Methods to build the toctree used in the html pages.

Module Contents#

Functions#

add_collapse_checkboxes(soup)

Add checkboxes to collapse children in a toctree.

add_inline_math(node)

Render a node with HTML tags that activate MathJax processing.

add_toctree_functions(app, pagename, templatename, ...)

Add functions so Jinja templates can add toctree objects.

get_local_toctree_for(self, indexname, docname, ...)

Return the "local" TOC nodetree (relative to indexname).

index_toctree(app, pagename, startdepth[, collapse])

Returns the "local" (starting at startdepth) TOC tree containing the current page, rendered as HTML bullet lists.

pydata_sphinx_theme.toctree.add_collapse_checkboxes(soup)[source]#

Add checkboxes to collapse children in a toctree.

Parameters:

soup (bs4.BeautifulSoup) –

Return type:

None

pydata_sphinx_theme.toctree.add_inline_math(node)[source]#

Render a node with HTML tags that activate MathJax processing.

This is meant for use with rendering section titles with math in them, because math outputs are ignored by pydata-sphinx-theme’s header.

related to the behaviour of a normal math node from: sphinx-doc/sphinx

Parameters:

node (docutils.nodes.Node) –

Return type:

str

pydata_sphinx_theme.toctree.add_toctree_functions(app, pagename, templatename, context, doctree)[source]#

Add functions so Jinja templates can add toctree objects.

Parameters:
  • app (sphinx.application.Sphinx) –

  • pagename (str) –

  • templatename (str) –

Return type:

None

pydata_sphinx_theme.toctree.get_local_toctree_for(self, indexname, docname, builder, collapse, **kwargs)[source]#

Return the “local” TOC nodetree (relative to indexname).

Parameters:
  • self (sphinx.environment.adapters.toctree.TocTree) –

  • indexname (str) –

  • docname (str) –

  • collapse (bool) –

Return type:

List[bs4.BeautifulSoup]

pydata_sphinx_theme.toctree.index_toctree(app, pagename, startdepth, collapse=True, **kwargs)[source]#

Returns the “local” (starting at startdepth) TOC tree containing the current page, rendered as HTML bullet lists.

This is the equivalent of context[“toctree”](**kwargs) in sphinx templating, but using the startdepth-local instead of global TOC tree.

Parameters:
  • app (sphinx.application.Sphinx) –

  • pagename (str) –

  • startdepth (int) –

  • collapse (bool) –