Skip to main content

Changelog-aware heading slugs for Python-Markdown’s toc extension

Project description

changelog-slugs

CI PyPI - Version PyPI - Python Version

changelog-slugs provides changelog-aware heading slugs for Python-Markdown’s toc extension.

It is designed for Keep a Changelog style changelogs in projects following Semantic Versioning, where repeated subsection headings like Added and Fixed would otherwise receive unstable, order-dependent anchors. As new releases are added above older ones, those anchors can change, causing existing permalinks to become obsolete. changelog-slugs instead scopes subsection slugs to their containing release, producing stable anchors such as v1-2-3-fixed.

Installation

pip install changelog-slugs

Usage

Python

import markdown

from changelog_slugs import Slugifier

changelog = ...  # e.g., the contents of your changelog file

html = markdown.markdown(
    changelog,
    extensions=["toc"],
    extension_configs={
        "toc": {
            "slugify": Slugifier(),
        },
    },
)

zensical.toml

[project.markdown_extensions.toc.slugify]
object = "changelog_slugs.Slugifier"

mkdocs.yml (untested)

markdown_extensions:
  - toc:
      slugify: !!python/name:changelog_slugs.slugify

License

MIT

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

changelog_slugs-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

changelog_slugs-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file changelog_slugs-0.1.0.tar.gz.

File metadata

  • Download URL: changelog_slugs-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for changelog_slugs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1f3bf2ffa3def85debea6bacb971569be5c48cb5c6afdf0dd061a0633453d5d4
MD5 24e8f26d7ff64fb642b366a1edae908c
BLAKE2b-256 541466db8ea8e3ae7b9b5c6a4c6a0d26b829abc3577128bbf68c9212cf2c9ef4

See more details on using hashes here.

File details

Details for the file changelog_slugs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: changelog_slugs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for changelog_slugs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc19dd90ff4902483050783e4ccb4164da9ec6a3693dad2099e04ab85c656f38
MD5 654186ad618c91c308bc82cc378e670b
BLAKE2b-256 9935153f549bb3089e696325a95b6f692e8da5b683ad253e86779970b88201ef

See more details on using hashes here.

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