diff options
Diffstat (limited to 'sphinx/builders/html/__init__.py')
-rw-r--r-- | sphinx/builders/html/__init__.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py index 9404ae458..e023e8194 100644 --- a/sphinx/builders/html/__init__.py +++ b/sphinx/builders/html/__init__.py @@ -26,6 +26,7 @@ from sphinx.builders import Builder from sphinx.config import ENUM, Config from sphinx.deprecation import RemovedInSphinx70Warning, deprecated_alias from sphinx.domains import Domain, Index, IndexEntry +from sphinx.environment import BuildEnvironment from sphinx.environment.adapters.asset import ImageAdapter from sphinx.environment.adapters.indexentries import IndexEntries from sphinx.environment.adapters.toctree import TocTree @@ -51,6 +52,17 @@ INVENTORY_FILENAME = 'objects.inv' logger = logging.getLogger(__name__) return_codes_re = re.compile('[\r\n]+') +DOMAIN_INDEX_TYPE = Tuple[ + # Index name (e.g. py-modindex) + str, + # Index class + Type[Index], + # list of (heading string, list of index entries) pairs. + List[Tuple[str, List[IndexEntry]]], + # whether sub-entries should start collapsed + bool +] + def get_stable_hash(obj: Any) -> str: """ @@ -197,10 +209,10 @@ class StandaloneHTMLBuilder(Builder): download_support = True # enable download role imgpath: str = None - domain_indices: List[Tuple[str, Type[Index], List[Tuple[str, List[IndexEntry]]], bool]] = [] # NOQA + domain_indices: List[DOMAIN_INDEX_TYPE] = [] - def __init__(self, app: Sphinx) -> None: - super().__init__(app) + def __init__(self, app: Sphinx, env: BuildEnvironment = None) -> None: + super().__init__(app, env) # CSS files self.css_files: List[Stylesheet] = [] |