Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Oct 12, 2023
1 parent ad35973 commit dd1cb3c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
8 changes: 6 additions & 2 deletions mknodes/manual/navs_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ def _(nav: mk.MkNav):
# @nav.route.nav("MkDefaultWebsite")
def _(nav: mk.MkNav):
proj = mk.Project.for_path("https://github.com/mkdocstrings/mkdocstrings.git")
website_nav = mk.MkDefaultWebsite(section="MkDocStrings", project=proj)
nav += website_nav
nav += mk.MkDefaultWebsite(section="MkDocStrings", project=proj)


@nav.route.nav("The MkDoc class")
Expand All @@ -66,3 +65,8 @@ def _(nav: mk.MkNav):
mknodes_docs = nav.add_doc(module=mk, class_page=template)
# now we collect the stuff we want to document.
mknodes_docs.collect_classes(recursive=True)


@nav.route.page("Context propagation")
def _(page: mk.MkPage):
page += mk.MkJinjaTemplate("context_propagation.jinja")
5 changes: 5 additions & 0 deletions mknodes/manual/page_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,8 @@ def _(page: mk.MkPage):
},
},
)


@nav.route.page("Resources")
def _(page: mk.MkPage):
page += mk.MkJinjaTemplate("resources.jinja")
14 changes: 10 additions & 4 deletions mknodes/templatenodes/mkpluginflow.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
from __future__ import annotations

from typing import Any

from mkdocs import plugins
from typing import TYPE_CHECKING, Any

from mknodes.basenodes import mkcontainer
from mknodes.data import eventplugins
from mknodes.utils import inspecthelpers, log, reprhelpers


if TYPE_CHECKING:
from mkdocs import plugins


logger = log.get_logger(__name__)


Expand All @@ -18,7 +20,11 @@ class MkPluginFlow(mkcontainer.MkContainer):
ICON = "material/dev-to"
STATUS = "new"

def __init__(self, plugin: type[plugins.BasePlugin] | None = None, **kwargs: Any):
def __init__(
self,
plugin: type[plugins.BasePlugin] | None = None,
**kwargs: Any,
):
"""Constructor.
Arguments:
Expand Down
2 changes: 1 addition & 1 deletion mknodes/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, logger: logging.Logger):
def __getattr__(self, val):
return getattr(self.logger, val)

def log_dict(self, dct, level=logging.INFO):
def log_dict(self, dct: dict, level=logging.INFO):
for k, v in dct.items():
self.logger.log(level, "%s: %s", k, v)

Expand Down

0 comments on commit dd1cb3c

Please sign in to comment.