Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
MkNodes
MkNodes

Get started

  • Installation
  • Why should I use MkNodes?
  • A quick node tour
  • Changelog

MkNavs

  • MkNavs
  • Populate MkPages from SUMMARY.md
    • Test nested
      • General
      • Markdown-Exec
    • Test Subnav
      • Subnav page 1
      • Subnav page 2
    • Test file
  • Populate MkPages from folder
    • markdown_exec
    • sub_1
  • Routing
    • Routed page
    • Routed
      • Deeply
        • Nested
          • Nested page
          • Nav
            • Routed section page
  • Context propagation

MkPages

  • MkPages
  • MkClassPage
  • MkCode
  • MkCode
  • MkModulePage
  • info
  • Setting the homepage
  • Adding to MkPages
  • Metadata
  • Templates
  • Resources

The nodes

  • The nodes
  • Markdown flavours
  • Base nodes
    • MkNode
    • MkText
    • MkHeader
    • MkCompactAdmonition
    • MkCritic
    • MkLink
    • MkKeys
    • MkProgressBar
    • MkSpeechBubble
    • MkTemplate
    • MkLlm
  • Image nodes
    • MkImage
    • MkImageCompare
    • MkImageSlideshow
    • MkBadge
    • MkIcon
    • MkMaterialBadge
    • MkBinaryImage
    • MkCard
  • Container nodes
    • MkBlockQuote
    • MkAdmonition
    • MkContainer
    • MkCode
    • MkList
    • MkTable
    • MkHtmlTable
    • MkDefinitionList
    • MkDetailsBlock
    • MkHtmlBlock
    • MkTabbedBlocks
    • MkTabbed
    • MkAnnotations
    • MkFootNotes
    • MkShowcase
    • MkTaskList
  • Presentation nodes
    • MkTreeView
    • MkReprRawRendered
    • MkDiagram
    • MkTimeline
  • Documentation nodes
    • MkClassDiagram
    • MkDocStrings
    • MkCommentedCode
    • MkConfigSetting
    • MkClassTable
    • MkModuleTable
    • MkCliDoc
  • About-the-project nodes
    • MkChangelog
    • MkCodeOfConduct
    • MkLicense
    • MkDependencyTable
    • MkInstallGuide
    • MkCommitConventions
    • MkDevTools
    • MkShields
    • MkMetadataBadges
    • MkPipDepTree
    • MkPyDeps
  • Special nodes
    • MkInclude
    • MkIFrame
    • MkCommandOutput

Templating

  • Templating
  • Jinja Namespace
    • PackageContext
    • ThemeContext
    • GitContext
    • GitHubContext
  • Utility filters
  • MkNode filters
  • Template engines

Site generator

  • Use cases
    • Creating a website via config
  • CLI
    • build
    • serve
    • generate
    • render
    • render-folder
  • Site generator
  • Configuration
  • Site engines
  • The build process

Core API

  • Core API
  • Navs and pages
  • Routing
  • MkNode
  • Theming
  • Build step
  • Rendering

Development

  • Dependencies
  • Development environment
  • Dev Tools
  • Code of conduct
  • Contributing
  • License
Back to top
View this page

Subnav page 2¶

Code for this page¶

def create_static_page(nav: mknav.MkNav):
    pass  # statically loaded page, nothing to see here

Finally a break to write some regular markdown!

What is MkNodes¶

  • Markdown objectified. A complete MkDocs project can be built by attaching nodes to a tree. Nodes range from atomic Markdown elements up to composed templates.

  • A parametrized Webpage. Because the tree only gets evaluted when it is written, it can basically behave like a template. Changing the project connected to the tree also changes the content of Nodes which pull metadata from the project.

  • MkNodes is aligned to the popular MkDocs/MkDocstrings/MkDocs for Material/PyMDown documentation stack for python. Other themes work probably, too, but are not tested.

  • It is not a parser. The only things that get parsed are SUMMARY.md files and the Markdown page metadata, for the rest it´s a one-way street: Python-objects -> Markdown.

Why MkNodes?¶

  • Because it´s fun! Especially for people who dont like working with Markdown, this library enables to build great documentation webpages without writing a single line of markdown, and without having to deal with the actual Directory structure at all.

  • Dead simple API: Basically all that is needed is initializing nodes and appending them to the tree (by using +=. All nodes are available from the mknodes namespace.

  • Because it´s reusable. Large parts of the documentation can be written in a project-agnostic way (because the nodes are populated with metadata dynamically).

  • Especially generating more complex, nested Markdown is much more comfortable.

Page info
Resources
Resources(css=[],
          markdown_extensions={},
          plugins=[],
          js=[],
          assets=[],
          packages=[])
Metadata
created:
  source_filename: /home/runner/work/mknodes/mknodes/src/mknodes/manual/navs_section.py
  source_function: _
  source_line_no: 24
hide: toc
title: Subnav page 2
Next
Test file
Previous
Subnav page 1
Copyright © 2024 Philipp Temminghoff
Made with Sphinx and @pradyunsg's Furo
On this page
  • Subnav page 2
    • Code for this page
    • What is MkNodes
    • Why MkNodes?