From d51ef81ce044e37f1fde3c75f556ad37935d8483 Mon Sep 17 00:00:00 2001 From: Philipp Temminghoff Date: Sun, 17 Sep 2023 09:32:39 +0200 Subject: [PATCH] chore: call proj.build() --- mknodes/cli/__init__.py | 1 + mknodes/plugin/mkdocsbackend.py | 1 + mknodes/project.py | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mknodes/cli/__init__.py b/mknodes/cli/__init__.py index d7f2514b..cd71f71b 100644 --- a/mknodes/cli/__init__.py +++ b/mknodes/cli/__init__.py @@ -177,6 +177,7 @@ def create_config( build_fn=build_fn, clone_depth=1, ) + proj.build() requirements = proj.get_requirements() info = proj.context.metadata config["markdown_extensions"] = requirements.markdown_extensions diff --git a/mknodes/plugin/mkdocsbackend.py b/mknodes/plugin/mkdocsbackend.py index e1d08f91..1e259dd4 100644 --- a/mknodes/plugin/mkdocsbackend.py +++ b/mknodes/plugin/mkdocsbackend.py @@ -163,4 +163,5 @@ def add_template(self, template: pagetemplate.PageTemplate): build_fn=paths.DEFAULT_BUILD_FN, clone_depth=1, ) + proj.build() reqs = proj.get_requirements() diff --git a/mknodes/project.py b/mknodes/project.py index 60622b60..d09aaa9b 100644 --- a/mknodes/project.py +++ b/mknodes/project.py @@ -101,24 +101,28 @@ def for_mknodes(cls, config=None) -> Project: from mknodes import mkdocsconfig config = mkdocsconfig.Config(config) - return cls( + kls = cls( base_url=config.site_url or "", use_directory_urls=config.use_directory_urls, theme=theme_.Theme.get_theme(config.theme.name, data=config.theme._vars), build_fn=config.plugins["mknodes"].config.build_fn, ) + kls.build() + return kls @classmethod def for_path(cls, path: str, config=None) -> Project: from mknodes import mkdocsconfig config = mkdocsconfig.Config(config) - return cls( + kls = cls( base_url=config.site_url or "", use_directory_urls=config.use_directory_urls, theme=theme_.Theme.get_theme(config.theme.name, data=config.theme._vars), repo=folderinfo.FolderInfo.clone_from(path), ) + kls.build() + return kls def set_root(self, nav: mknav.MkNav): self._root = nav