CLI

MkNodes offers a CLI interface in order to build projects based on Callables. The CLI is closely aligned to the MkDocs CLI to simplify the usage. Most arguments have the same name. Right now the CLI is mostly useful for testing purposes, but features will get extended in the future.

The CLI is based on Typer and uses a rich based handler for nice, colored output.

There are 3 diffent commands right now:

  • mknodes build: Similar to mkdocs build, but with the option to point to a (remote) repository as well as a Website template in form of a Python Callable to build

  • mknodes serve: Same as mknodes build, but for serving the page.

  • mknodes create-config: Does a test run with given callable and repository and creates a Config file based on the metadata and extension requirements provided by the combination of Callable and repository.

Page info
Code for this section
mkdocs_mknodes.manual.cli_section._
@nav.route.page(is_index=True, hide="toc")
def _(page: mk.MkPage):
    page += mk.MkBinaryImage.for_file("docs/assets/cli.gif")
    page += mk.MkTemplate("cli_index.jinja")
Resources
Resources(css=[],
          markdown_extensions={'attr_list': {},
                               'md_in_html': {},
                               'pymdownx.emoji': {'emoji_generator': <function to_svg at 0x7f6e52627c40>,
                                                  'emoji_index': <function twemoji at 0x7f6e52627b00>},
                               'pymdownx.magiclink': {'repo': 'mkdocs_mknodes',
                                                      'repo_url_shorthand': True,
                                                      'user': 'phil65'}},
          plugins=[],
          js=[],
          assets=[],
          packages=[])
Metadata
created:
  source_filename: /home/runner/work/mkdocs-mknodes/mkdocs-mknodes/mkdocs_mknodes/manual/cli_section.py
  source_function: null
  source_line_no: 10
hide:
- toc
template: SUMMARY.html
title: CLI