Skip to main content

mdformat-wiki

license build lint tests codecov pre-commit

Mdformat plugin preserving wikilinks, frontmatter, and index delimiter.

Built for wikis created with plasma-wiki — add it wherever mdformat runs over a wiki maintained by plasma-wiki.


Source: https://github.com/plasma-ai/mdformat-wiki

Package: https://pypi.org/project/mdformat-wiki/


Installation

Install the mdformat-wiki package from PyPI, alongside mdformat:

pip install mdformat-wiki

Use uv tool install mdformat --with mdformat-wiki to install in an isolated environment.

Usage

Once installed, mdformat picks the plugin up automatically and stops disturbing wiki page faces:

  • [[...]] wikilinks parse atomically (single line, no nesting) and are never backslash-escaped — including the [[target|label]] pipe form.
  • Wikilinks are wrap-atomic: under --wrap, the whole [[...]] face moves between lines as one unit, like an inline code span, while the prose around it fills normally.
  • YAML frontmatter at the start of a document renders byte-verbatim (fences and content untouched).
  • A thematic break written exactly as *** keeps that face; every other break style is normalized as usual.
  • ATX headings keep their original inline face verbatim — unbalanced emphasis is never backslash-escaped and an optional closing # sequence survives; setext headings still normalize to ATX.
  • An index link-row description ([[target|label]]: text) renders its text verbatim — a bare * or _ (**kwargs, _verb) is never backslash-escaped — while still wrapping under --wrap. A row whose link alone exceeds the width breaks after ]]:, dropping the description to the next line.

pre-commit

Repos that format markdown with a pre-commit hook need one line — add the plugin to the mdformat hook's additional_dependencies:

  - repo: https://github.com/hukkin/mdformat
    rev: 1.0.0
    hooks:
      - id: mdformat
        additional_dependencies: [mdformat-wiki]

If the hook already lists mdformat-frontmatter, remove it — this plugin already renders frontmatter byte-verbatim. Both plugins register a frontmatter renderer, mdformat only warns about the conflict, and whichever the environment discovers first wins: when mdformat-frontmatter wins, it re-serializes the YAML (quoting values, blanking nulls) instead of leaving it untouched.

Footnotes

Baseline mdformat escapes footnote definitions ([^1]: becomes \[^1\]:). If your pages use footnotes, add mdformat-footnote alongside this plugin — the two compose cleanly (definitions relocate to the document bottom, which is semantically neutral).

Development

Install

Run install.sh in the package root. With no environment active it creates and uses a local .venv; with one active (e.g. pyenv) it installs into that environment (editable), without recreating it:

./install.sh --all-extras --groups=test,lint,type

Run ./install.sh --help for all options. Alternatively, run uv sync --all-extras --group test --group lint --group type and uv run pre-commit install to set up the environment manually.

Installing a dependency as editable (e.g. a sibling package) is left to the caller: uv pip install --editable <path>.

Once installed, run tools with uv run <command>, or activate the environment first (source .venv/bin/activate).

Tests

Run the test suite:

pytest .

Linting

Run linters and formatters:

pre-commit run --all-files

License

Licensed under the Apache License 2.0 — see LICENSE.

Copyright © 2026 Plasma AI

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdformat_wiki-0.2.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

mdformat_wiki-0.2.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file mdformat_wiki-0.2.1.tar.gz.

File metadata

  • Download URL: mdformat_wiki-0.2.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mdformat_wiki-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4f1c1790fe83f243731bc359bd676f51b7d1c6075db74bd3b503666a2bfe4597
MD5 6643c9c799f5c5487cfbf99c3e108d0d
BLAKE2b-256 d0fcecbbafbf1dbc2bafb556c41d0d8a43e53c0726c552379a7de4fa07ffb809

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdformat_wiki-0.2.1.tar.gz:

Publisher: build.yaml on plasma-ai/mdformat-wiki

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mdformat_wiki-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: mdformat_wiki-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mdformat_wiki-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db56031ed222040769c361a4c1e977df8ecc0fa78b43c7cdb1c22bd36e6466b3
MD5 c9757bb1d89ba38a51bd5bed4b777c68
BLAKE2b-256 e19d937b0671cac337e7812f5a0d87d79626793f19537784358a6dc3443d7578

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdformat_wiki-0.2.1-py3-none-any.whl:

Publisher: build.yaml on plasma-ai/mdformat-wiki

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page