Skip to main content

MkDocs plugin to add hierarchical numbering to nav and page headings

Project description

mkdocs-nav-numbering-plugin

CI PyPI

MkDocs plugin that adds hierarchical numbering to navigation items and page headings.

Features

  • Number nav sections, pages, and links (optional)
  • Number page headings based on nav position
  • Configurable depth limits for nav and headings
  • Configurable separator
  • Exclude specific pages

image

Installation

pip install mkdocs-nav-numbering-plugin

Usage

plugins:
  - nav-numbering:
      nav_depth: 4
      heading_depth: 5
      number_h1: true
      number_nav: true
      number_headings: true
      preserve_anchor_ids: false
      separator: "."
      exclude:
        - index.md

markdown_extensions:
  - attr_list  # Required when preserve_anchor_ids is true

Options

  • enabled (bool, default: true)
  • nav_depth (int, default: 0) — 0 means unlimited
  • heading_depth (int, default: 0) — 0 means unlimited
  • number_nav (bool, default: true)
  • number_headings (bool, default: true)
  • number_h1 (bool, default: true)
  • preserve_anchor_ids (bool, default: false) — Preserve original heading anchor IDs without number prefixes (requires attr_list)
  • separator (str, default: ".")
  • exclude (list, default: [])

preserve_anchor_ids

By default, MkDocs generates heading IDs from the final heading text. Since this plugin prepends numbering, your anchors can end up including the numbers.

Enable preserve_anchor_ids: true to add explicit {#...} IDs based on the original (un-numbered) heading text. Duplicate headings are automatically suffixed with -1, -2, etc.

plugins:
  - nav-numbering:
      preserve_anchor_ids: true

markdown_extensions:
  - attr_list

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_nav_numbering_plugin-1.3.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_nav_numbering_plugin-1.3.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_nav_numbering_plugin-1.3.0.tar.gz.

File metadata

File hashes

Hashes for mkdocs_nav_numbering_plugin-1.3.0.tar.gz
Algorithm Hash digest
SHA256 65846c95d93e35c711293a74d769e1388a20d3ab8338e3f74d4611af544d2e5f
MD5 fc8a19eb46641a860dfa8ee7d747fa9d
BLAKE2b-256 20d7bf3c3547be4f368d663593492ab5cd32cf5bb1f0a4e3b0091db2562949c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_nav_numbering_plugin-1.3.0.tar.gz:

Publisher: publish.yml on matusdrobuliak66/mkdocs-nav-numbering-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkdocs_nav_numbering_plugin-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_nav_numbering_plugin-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29e86e1f83bca206de1766d6f9aaec8e0de78af7e56447e17ab1083000c3a309
MD5 7546635de7749e62760044c3c9597277
BLAKE2b-256 432caf76a5f2afd12a5b6c0fbbd24c097d16c901cfe2fe47237ab2564af71933

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_nav_numbering_plugin-1.3.0-py3-none-any.whl:

Publisher: publish.yml on matusdrobuliak66/mkdocs-nav-numbering-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page