Skip to content

Commit

Permalink
chore: call proj.build()
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Sep 17, 2023
1 parent 4a96cf7 commit d51ef81
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions mknodes/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions mknodes/plugin/mkdocsbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
8 changes: 6 additions & 2 deletions mknodes/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d51ef81

Please sign in to comment.