Skip to main content

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

Project description

changelog-slugs

CI PyPI - Version PyPI - Python Version Docs

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

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

License

This project is licensed under the terms of the MIT license.

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.2.0.tar.gz (4.1 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.2.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: changelog_slugs-0.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2.0.tar.gz
Algorithm Hash digest
SHA256 d74f6cd30f388b57afb4d33e49c28b3a5764fb0fa40f44553b9364772468583b
MD5 7520fdefd695c7d1ae441cfa99715311
BLAKE2b-256 22ac3164f7fd0dbf3538b2bf885d5c46279591f1bfb03cfb31216c5e9f650f49

See more details on using hashes here.

File details

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

File metadata

  • Download URL: changelog_slugs-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dbc8d299fae9739eb20101cc2db60c884086f31e40fe93e1a94f0e1b86dd9564
MD5 3c1521f0d28d85b61bec8aa951945b0d
BLAKE2b-256 a3cb0ca2b428be8d84c8e91ab82c5233ebf55db973756a30311ba5d7344d2b90

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