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

Nav¶

Note

You can also use decorators to attach MkNavs. These navs then can continue to build the tree without using decorators (by adding sub-navs).

Page info
Code for this section
mknodes.manual.routing.routed_nav¶
28@nav.route.nav("Routed", "Deeply", "Nested", "Nav")
29def routed_nav(nav: mk.MkNav) -> None:
30    """Builds a nested MkNav and attaches it to the router MkNav."""
31    index_page = nav.add_page(is_index=True)
32    index_page += mk.MkAdmonition(NAV_TEXT)
33    page = nav.add_page("Routed section page")
34    page += mk.MkAdmonition("Routed section page content")
Resources
Resources(css=[],
          markdown_extensions={},
          plugins=[],
          js=[],
          assets=[],
          packages=[])
Metadata
created:
  source_filename: /home/runner/work/mknodes/mknodes/src/mknodes/manual/routing.py
  source_function: routed_nav
  source_line_no: 28
title: Nav
Next
Routed section page
Previous
Nested page
Copyright © 2024 Philipp Temminghoff
Made with Sphinx and @pradyunsg's Furo