Skip to main content

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.

Metadata

Release files for changelog-slugs 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for changelog-slugs 0.2.0
File Size Uploaded
changelog_slugs-0.2.0.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for changelog-slugs 0.2.0
File Interpreter ABI Platform
changelog_slugs-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / changelog_slugs-0.2.0.tar.gz

Download URL changelog_slugs-0.2.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d74f6cd30f388b57afb4d33e49c28b3a5764fb0fa40f44553b9364772468583b
BLAKE2b-256 checksum
How to use checksums
22ac3164f7fd0dbf3538b2bf885d5c46279591f1bfb03cfb31216c5e9f650f49
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / changelog_slugs-0.2.0-py3-none-any.whl

Download URL changelog_slugs-0.2.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbc8d299fae9739eb20101cc2db60c884086f31e40fe93e1a94f0e1b86dd9564
BLAKE2b-256 checksum
How to use checksums
a3cb0ca2b428be8d84c8e91ab82c5233ebf55db973756a30311ba5d7344d2b90
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page