Skip to main content

Headdown: Downgrade Headings

Automatically demote those pesky headings!

What?

This is a plugin for Python-Markdown to automatically downgrade headings by a given number of levels. This is useful when, for example, using a static site generator, such as Pelican.

Why?

I didn't want to have to write standalone markdown files whose structure was dictated by the constraints of my website; nor did I want to sacrifice the structure of my website because of my markdown files. A number of 3rd party Python-Markdown extensions already exist to do this (here and here), but I was unable to get them to work with Python-Markdown 3.

How?

Just add mdx_headdown to your markdown extensions and feel the magic.

You can optionally provide an offset parameter, which tells headdown by how many levels to downgrade all headings. The default is 1.

Note : This value will be converted to an integer and absolutised. Failure to provide a numeric option may lead to unexpected results.

For example, if using with Pelican, your configuration might look something like this:

...
MARKDOWN = {
    'extensions': ['mdx_headdown',],
    'extension_configs': {
        'mdx_headdown': {
            'offset': 2,
        },
    },
}
...

Credit

Thanks are owed to the author of mdx_downheader, whose code I examined for inspiration; and the contributers to the default python-markdown extensions, whose code I examined to get a better idea of what the manual was talking about.

This project is copyright 2018 by Sascha Cowley under the MIT License.

Metadata

Release files for markdown-headdown 0.1.3

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

Source distribution (sdist)

Source distribution for markdown-headdown 0.1.3
File Size Uploaded Provenance
markdown-headdown-0.1.3.tar.gz 3.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for markdown-headdown 0.1.3
File Interpreter ABI Platform
markdown_headdown-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / markdown-headdown-0.1.3.tar.gz

Download URL markdown-headdown-0.1.3.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ced7f86b3014297e0d20306744f01911a3da3ff01ad014900f22c250d5e07dec
BLAKE2b-256 checksum
How to use checksums
7ad0ddaeb580e9d6a5327511e35de23fc23439a9de8fa920dff50fb60e2da1e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

Release files / markdown_headdown-0.1.3-py3-none-any.whl

Download URL markdown_headdown-0.1.3-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30d819d719e53e9b06d060b30fda2cb5753a76a762de279eedbd638840733c82
BLAKE2b-256 checksum
How to use checksums
61f42766f7219c96f124b7ea53e6cae8090f325a7525212b51b5d9aa4b9b7caa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

Security for markdown-headdown 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files No provenance

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