Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Sep 15, 2023
1 parent d8f83f5 commit ed18ba3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 2 additions & 0 deletions configs/mkdocs_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ plugins:
- literate-nav
- mknodes:
build_fn: mknodes.navs.mkdefaultwebsite:MkDefaultWebsite.for_project
kwargs:
show_debug_section: true
clone_depth: 100
- mkdocstrings
18 changes: 7 additions & 11 deletions mknodes/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ def build(self):

from mknodes.basenodes import mknode

paths = [pathlib.Path(i).stem for i in self._root.page_mapping]
mapping = self._root.page_mapping

paths = [pathlib.Path(i).stem for i in mapping]
self.linkprovider.set_excludes(paths)

variables = self.context.as_dict()
variables["page_mapping"] = self._root.page_mapping
variables["requirements"] = self.get_requirements()
mknode.MkNode._env.globals |= variables
reqs = self.get_requirements()
ctx = contexts.BuildContext(page_mapping=mapping, requirements=reqs)
mknode.MkNode._env.globals |= variables | ctx.as_dict()
return ctx

def __repr__(self):
return reprhelpers.get_repr(self, repo_path=str(self.folderinfo.path))
Expand Down Expand Up @@ -140,13 +143,6 @@ def get_requirements(self) -> requirements.Requirements:
)
return reqs

@functools.cached_property
def build_context(self):
return contexts.BuildContext(
page_mapping=self.folderinfo.git.context,
requirements=self.get_requirements(),
)

@functools.cached_property
def context(self):
return contexts.ProjectContext(
Expand Down

0 comments on commit ed18ba3

Please sign in to comment.