60 lines
1.9 KiB
Python
60 lines
1.9 KiB
Python
"""
|
|
This type stub file was generated by pyright.
|
|
"""
|
|
|
|
from typing import Any, TYPE_CHECKING, TypeVar
|
|
from docutils.nodes import Element, Node
|
|
from sphinx import addnodes
|
|
from sphinx.builders import Builder
|
|
from sphinx.environment import BuildEnvironment
|
|
from sphinx.util.tags import Tags
|
|
|
|
"""Toctree adapter for sphinx.environment."""
|
|
if TYPE_CHECKING:
|
|
...
|
|
logger = ...
|
|
def note_toctree(env: BuildEnvironment, docname: str, toctreenode: addnodes.toctree) -> None:
|
|
"""Note a TOC tree directive in a document and gather information about
|
|
file relations from it.
|
|
"""
|
|
...
|
|
|
|
def document_toc(env: BuildEnvironment, docname: str, tags: Tags) -> Node:
|
|
"""Get the (local) table of contents for a document.
|
|
|
|
Note that this is only the sections within the document.
|
|
For a ToC tree that shows the document's place in the
|
|
ToC structure, use `get_toctree_for`.
|
|
"""
|
|
...
|
|
|
|
def global_toctree_for_doc(env: BuildEnvironment, docname: str, builder: Builder, collapse: bool = ..., includehidden: bool = ..., maxdepth: int = ..., titles_only: bool = ...) -> Element | None:
|
|
"""Get the global ToC tree at a given document.
|
|
|
|
This gives the global ToC, with all ancestors and their siblings.
|
|
"""
|
|
...
|
|
|
|
ET = TypeVar('ET', bound=Element)
|
|
class TocTree:
|
|
def __init__(self, env: BuildEnvironment) -> None:
|
|
...
|
|
|
|
def note(self, docname: str, toctreenode: addnodes.toctree) -> None:
|
|
...
|
|
|
|
def resolve(self, docname: str, builder: Builder, toctree: addnodes.toctree, prune: bool = ..., maxdepth: int = ..., titles_only: bool = ..., collapse: bool = ..., includehidden: bool = ...) -> Element | None:
|
|
...
|
|
|
|
def get_toctree_ancestors(self, docname: str) -> list[str]:
|
|
...
|
|
|
|
def get_toc_for(self, docname: str, builder: Builder) -> Node:
|
|
...
|
|
|
|
def get_toctree_for(self, docname: str, builder: Builder, collapse: bool, **kwargs: Any) -> Element | None:
|
|
...
|
|
|
|
|
|
|