Skip to content

changelog_slugs

Changelog-aware heading slugs for Python-Markdown.

DEFAULT_SECTIONS module-attribute

DEFAULT_SECTIONS = frozenset(
    {
        "Added",
        "Changed",
        "Deprecated",
        "Removed",
        "Fixed",
        "Security",
    }
)

Default sections following the Keep a Changelog format.

slugify module-attribute

slugify = Slugifier()

Default slugifier instance.

Slugifier

Slugifier for changelog headings with release-scoped subsections.

It recognizes release headings that begin with a version following SemVer, optionally prefixed with v. For example, [0.1.0] - 2026-04-11, 0.1.0 some text, and v0.1.0 all resolve to the release slug v0-1-0.

Subsequent headings matching the configured sections are prefixed with the current release slug until a non-matching heading is encountered. The default sections are based on Keep a Changelog.

__init__

__init__(*, sections=DEFAULT_SECTIONS, extend_sections=())

Initialize the slugifier.

Parameters:

Name Type Description Default
sections Collection[str]

Sections to recognize after a release heading. Set this when your changelog uses headings such as Enhancements or Bug fixes instead of the default Keep a Changelog change types.

DEFAULT_SECTIONS
extend_sections Collection[str]

Additional sections to recognize. Use this when your changelog includes headings such as Notes or Contributors in addition to the default Keep a Changelog change types.

()

__call__

__call__(value, separator='-')

Slugify a heading.

Parameters:

Name Type Description Default
value str

The heading text.

required
separator str

The separator used in the generated slug.

'-'

Returns:

Type Description
str

The generated slug.