pydata_sphinx_theme.toctree#
Methods to build the toctree used in the html pages.
Classes#
Dataclass to generate toctree data. |
Functions#
|
Get the name of pagename's ancestor that is rooted startdepth levels below the |
|
Add checkboxes to collapse children in a toctree. |
|
Render a node with HTML tags that activate MathJax processing. |
|
Add functions so Jinja templates can add toctree objects. |
|
Get the partial TocTree (rooted at ancestorname) that dominates pagename. |
Module Contents#
- pydata_sphinx_theme.toctree._get_ancestor_pagename(app, pagename, startdepth)[源代码]#
Get the name of pagename's ancestor that is rooted startdepth levels below the global root.
- 参数:
pagename (str)
startdepth (int)
- 返回类型:
str
- pydata_sphinx_theme.toctree.add_collapse_checkboxes(soup)[源代码]#
Add checkboxes to collapse children in a toctree.
- 参数:
soup (bs4.BeautifulSoup)
- 返回类型:
None
- pydata_sphinx_theme.toctree.add_inline_math(node)[源代码]#
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
- 参数:
node (docutils.nodes.Node)
- 返回类型:
str
- pydata_sphinx_theme.toctree.add_toctree_functions(app, pagename, templatename, context, doctree)[源代码]#
Add functions so Jinja templates can add toctree objects.
- 参数:
pagename (str)
templatename (str)
- 返回类型:
None
- pydata_sphinx_theme.toctree.get_nonroot_toctree(app, pagename, ancestorname, toctree, **kwargs)[源代码]#
Get the partial TocTree (rooted at ancestorname) that dominates pagename.
Parameters: app : Sphinx app. pagename : Name of the current page (as Sphinx knows it; i.e., its relative path from the documentation root). ancestorname : Name of a page that dominates pagename and that will serve as the root of the TocTree fragment. toctree : A Sphinx TocTree object. Since this is always needed when finding the ancestorname (see _get_ancestor_pagename), it's more efficient to pass it here to re-use it. kwargs : passed to the Sphinx toctree template function.
This is similar to context["toctree"](**kwargs) (AKA toctree(**kwargs) within a Jinja template), or TocTree.get_toctree_for(), which always uses the "root" doctree (i.e., doctree = self.env.get_doctree(self.env.config.root_doc)).
- 参数:
pagename (str)
ancestorname (str)