From d086b115c77582bccc4a18e830af4a9f5fddf1a2 Mon Sep 17 00:00:00 2001 From: Philipp Temminghoff Date: Fri, 22 Sep 2023 18:15:10 +0200 Subject: [PATCH] chore: cleanup --- mknodes/manual/navs_section.py | 1 - mknodes/navs/mkdoc.py | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mknodes/manual/navs_section.py b/mknodes/manual/navs_section.py index 5743cd57..438f4ef8 100644 --- a/mknodes/manual/navs_section.py +++ b/mknodes/manual/navs_section.py @@ -175,7 +175,6 @@ def create_mkdoc_section(nav: mk.MkNav): page = nav.add_index_page(hide="toc", icon="api") page += mk.MkAdmonition(DOC_TEXT, typ="tip") - page.env.add_template("docs/classpage_custom.jinja") mknodes_docs = nav.add_doc( module=mk, filter_by___all__=True, diff --git a/mknodes/navs/mkdoc.py b/mknodes/navs/mkdoc.py index 09bf06d5..77a827aa 100644 --- a/mknodes/navs/mkdoc.py +++ b/mknodes/navs/mkdoc.py @@ -54,6 +54,12 @@ def __init__( self._exclude = exclude_modules or [] # self.root_path = pathlib.Path(f"./{self.module_name}") super().__init__(section=section_name or self.module_name, **kwargs) + # we add the templates to the env after init to get correct environment. + # perhaps better to move this to a later stage.. + if isinstance(class_page, str): + self.env.add_template(class_page) + if isinstance(module_page, str): + self.env.add_template(module_page) def __repr__(self): return reprhelpers.get_repr(