Skip to content

Commit

Permalink
refactor: rename MkClickDoc to MkCliDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 12, 2023
1 parent fc96dc0 commit 87085df
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions mknodes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .basenodes.mkcontainer import MkContainer
from .basenodes.mkcode import MkCode
from .basenodes._mkdocstrings import MkDocStrings
from .basenodes.mkclickdoc import MkClickDoc
from .basenodes.mkclidoc import MkCliDoc
from .basenodes.mkicon import MkIcon
from .basenodes.mkimage import MkImage
from .basenodes.mkmaterialbadge import MkMaterialBadge
Expand Down Expand Up @@ -101,7 +101,7 @@
"MkContainer",
"MkNav",
"MkDocStrings",
"MkClickDoc",
"MkCliDoc",
"MkText",
"MkKeys",
# "MkGrid",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
logger = log.get_logger(__name__)


class MkClickDoc(mktemplate.MkTemplate):
class MkCliDoc(mktemplate.MkTemplate):
"""Node for showing documentation for click / typer CLI apps."""

ICON = "material/api"
Expand Down Expand Up @@ -65,12 +65,12 @@ def info(self) -> commandinfo.CommandInfo | None:
def create_example_page(cls, page):
import mknodes as mk

node = MkClickDoc(target="mkdocs_mknodes.cli:cli")
node = MkCliDoc(target="mkdocs_mknodes.cli:cli")
page += mk.MkReprRawRendered(node)
node = MkClickDoc(target="mkdocs_mknodes.cli:cli", prog_name="build")
node = MkCliDoc(target="mkdocs_mknodes.cli:cli", prog_name="build")
page += mk.MkReprRawRendered(node)


if __name__ == "__main__":
docstrings = MkClickDoc.with_context("mkdocs_mknodes.cli:cli", show_subcommands=True)
docstrings = MkCliDoc.with_context("mkdocs_mknodes.cli:cli", show_subcommands=True)
print(docstrings)
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[metadata]
icon = "mdi:api"
name = "MkClickDoc"
name = "MkCliDoc"

[examples.cli]
title = "MkDocs-MkNodes CLI"
jinja = """
{{ "mkdocs_mknodes.cli:cli" | MkClickDoc }}
{{ "mkdocs_mknodes.cli:cli" | MkCliDoc }}
"""

[examples.sub_command]
title = "SubCommand"
jinja = """
{{ "mkdocs_mknodes.cli:cli" | MkClickDoc(prog_name="build") }}
{{ "mkdocs_mknodes.cli:cli" | MkCliDoc(prog_name="build") }}
"""

[fragments]
Expand Down
2 changes: 1 addition & 1 deletion mknodes/manual/nodes_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
mk.MkClassTable,
mk.MkModuleTable,
mk.MkPluginFlow,
mk.MkClickDoc,
mk.MkCliDoc,
]

ABOUT_THE_PROJECT_NODES = [
Expand Down
2 changes: 1 addition & 1 deletion mknodes/navs/mkdefaultwebsite.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(
self.page_template.announcement_bar = mk.MkMetadataBadges("websites")
if self.ctx.metadata.cli:
page = self.add_page("CLI", hide="nav")
page += mk.MkClickDoc(show_subcommands=True)
page += mk.MkCliDoc(show_subcommands=True)

nav = self.add_nav("Development")

Expand Down

0 comments on commit 87085df

Please sign in to comment.