mdformat-wiki
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 renders byte-verbatim (fences and content untouched), with
the fence grammar matching the wiki reader exactly: the opener is the first
line stripping to
---, only an unindented---closes (an indented dash run inside a block scalar is content), and----/...fences or an unclosed opener are not frontmatter. A leading UTF-8 BOM is normalized away. - 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 (
[[target|label]]: description) renders verbatim, line breaks and escapes intact — a bare*or_(**kwargs,_verb) is never backslash-escaped, and the row never reflows under--wrap. The link block is the wiki's structured data; its bytes round-trip. - A non-wikilink
[[in body prose (an unclosed[[foo, a bracket run) escapes in the healthy[\[shape — never the\[[shape the wiki's lint flags as formatter damage.
Pre-commit Hook
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 --no-sync <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
Contributing
The contribution workflow, repository conventions, and release process (version sources, tagging, CI guard) are documented in:
- Contribution workflow (organization-wide): CONTRIBUTING.md
- Repository conventions: AGENTS.md
- Release process (organization-wide): RELEASING.md
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdformat_wiki-0.5.0.tar.gz.
File metadata
- Download URL: mdformat_wiki-0.5.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0351602d5fd862dd7bf873dbc8a8f4d586bd4672ea2277290a6c7526e78cc281
|
|
| MD5 |
0c84b3a2ac9b3d3c3e723279cb0fa123
|
|
| BLAKE2b-256 |
a5d3e902909c221e3ee6e35b2bdb881867910e43ca70918a3d307ec0e61641eb
|
Provenance
The following attestation bundles were made for mdformat_wiki-0.5.0.tar.gz:
Publisher:
build.yaml on plasma-ai/mdformat-wiki
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mdformat_wiki-0.5.0.tar.gz -
Subject digest:
0351602d5fd862dd7bf873dbc8a8f4d586bd4672ea2277290a6c7526e78cc281 - Sigstore transparency entry: 2204723388
- Sigstore integration time:
-
Permalink:
plasma-ai/mdformat-wiki@718f87db7733e4be4615222219ea91df778f916a -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/plasma-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@718f87db7733e4be4615222219ea91df778f916a -
Trigger Event:
push
-
Statement type:
File details
Details for the file mdformat_wiki-0.5.0-py3-none-any.whl.
File metadata
- Download URL: mdformat_wiki-0.5.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4c2cc3dffe2891ce7d681824495a612ecfa23e1fd322ac04324fd1f44c6d51b
|
|
| MD5 |
b967ade3fa94fa482e38c40733b01431
|
|
| BLAKE2b-256 |
a9fd872b83c8a0c3cee16ff69238a1186fdd62927b826e8dff932314cc4a6eff
|
Provenance
The following attestation bundles were made for mdformat_wiki-0.5.0-py3-none-any.whl:
Publisher:
build.yaml on plasma-ai/mdformat-wiki
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mdformat_wiki-0.5.0-py3-none-any.whl -
Subject digest:
d4c2cc3dffe2891ce7d681824495a612ecfa23e1fd322ac04324fd1f44c6d51b - Sigstore transparency entry: 2204723410
- Sigstore integration time:
-
Permalink:
plasma-ai/mdformat-wiki@718f87db7733e4be4615222219ea91df778f916a -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/plasma-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@718f87db7733e4be4615222219ea91df778f916a -
Trigger Event:
push
-
Statement type: