vw-mkdocs-idref
Link to pages by front-matter id using wiki-style syntax, and show status / progress / title inline—using your own custom emoji icons.
[[id:tm-gp]]→ plain ID as link text[[id:s:tm-gp]]→ status (no parentheses if status alone)[[id:as:tm-gp]]→ auto status fromauto_status:[[id:p:tm-gp]]→ progress (no angle brackets if progress alone)[[id:ap1:tm-gp]]→ auto progress 1 fromauto_progress_1:[[id:ap2:tm-gp]]→ auto progress 2 fromauto_progress_2:[[id:t:tm-gp]]→ title[[id:s:t:tm-gp]]→ (status) title[[id:p:t:tm-gp]]→ title[[id:s:p:t:tm-gp]]→ (status) title[[id:s:p:tm-gp]]→ (status) (no title unless:tis present)
“Wrappers” appear only when multiple components are shown: status →
(… )only when paired with progress or title; progress →<…>only when paired with status or title.
✨ What it does
-
Resolves
[[id:some-id]]to a link that points to the page whose front-matter containsid: some-id. -
Link
hrefis root-relative and (optionally) includes#some-id. -
Link text is built from flags you include:
s→ show status icon (from front-matterstatus:)as→ show auto status icon (from front-matterauto_status:)p→ show progress bar (from front-matterprogress:rounded to 0/20/40/60/80/100)ap1→ show auto progress bar 1 (fromauto_progress_1:rounded as above)ap2→ show auto progress bar 2 (fromauto_progress_2:rounded as above)t→ show title (from front-mattertitle:; falls back to page H1 if missing)
📦 Installation
Local (editable) install while developing:
pip install -e .
Or from your private index (example):
pip install vw-mkdocs-idref --extra-index-url=https://<your-private-index>/
⚙️ Configuration (mkdocs.yml)
1) Enable the plugin
plugins:
- search
- idref:
id_field: "id"
title_field: "title"
status_field: "status"
progress_field: "progress"
append_hash: true # adds #<id> to the link target
lowercase_ids: false
debug: false
2) Enable custom emoji rendering (Material for MkDocs)
markdown_extensions:
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
options:
custom_icons:
- overrides/.icons
Place your SVG icons under
overrides/.icons/board/…so the shortcodes below resolve.
🎨 Custom Emoji Shortcodes
The plugin outputs shortcodes, which the emoji extension renders to SVG. Update your plugin’s icon maps (already set by default) to:
PROGRESS_BARS = {
0: ":board-progtodo:",
20: ":board-prog20:",
40: ":board-prog70:",
60: ":board-prog60:",
80: ":board-prog80:",
100: ":board-progdone:",
}
STATUS_ICONS = {
"todo": ":board-statustodo:",
"inprogress": ":board-statusinprogress:",
"done": ":board-statusdone:",
}
Auto-derived fields (auto_status, auto_progress_1, auto_progress_2) reuse these same icon maps, so no extra configuration is required.
📁 Icon file placement
With the custom_icons path set to overrides/.icons, the shortcode :board-XYZ: resolves to:
overrides/.icons/board/XYZ.svg
Required files for the map above:
overrides/.icons/
└─ board/
├─ progtodo.svg
├─ prog20.svg
├─ prog70.svg
├─ prog60.svg
├─ prog80.svg
├─ progdone.svg
├─ statustodo.svg
├─ statusinprogress.svg
└─ statusdone.svg
You can change filenames/shortcodes—just keep the map and SVG names in sync.
📝 Front-matter example
---
id: tm-gp
title: Team – Gameplay
status: inprogress
progress: 63
auto_status: done
auto_progress_1: 18
auto_progress_2: 92
---
Progress values are rounded to 0/20/40/60/80/100 (63 → 60 →
:board-prog60:, 18 → 20, 92 → 100). Status fields (status,auto_status) accepttodo,inprogress,done.
🔗 Usage examples
Given the front-matter above:
| Markup | Link text produced |
|---|---|
[[id:tm-gp]] |
tm-gp |
[[id:s:tm-gp]] |
:board-statusinprogress: |
[[id:as:tm-gp]] |
:board-statusdone: |
[[id:p:tm-gp]] |
:board-prog60: |
[[id:ap1:tm-gp]] |
:board-prog20: |
[[id:ap2:tm-gp]] |
:board-progdone: |
[[id:t:tm-gp]] |
Team – Gameplay |
[[id:s:t:tm-gp]] |
(:board-statusinprogress:) Team – Gameplay |
[[id:p:t:tm-gp]] |
<:board-prog60:> Team – Gameplay |
[[id:s:p:t:tm-gp]] |
(:board-statusinprogress:) <:board-prog60:> Team – Gameplay |
[[id:s:p:tm-gp]] |
(:board-statusinprogress:) <:board-prog60:> |
[[id:as:ap1:ap2:t:tm-gp]] |
(:board-statusdone:) <:board-prog20:> <:board-progdone:> Team – Gameplay |
Actual pages will render the shortcodes as SVG icons. Status gets parentheses and Progress gets angle brackets only when combined with another component on the same line. Auto variants (
as,ap1,ap2) follow the same rule.
Custom label (when showing title)
If you include :t, you can override the title:
[[id:s:t:tm-gp|Gameplay Team]]
→ (:board-statusinprogress:) Gameplay Team
If you don’t include :t, custom labels are ignored (no title is shown).
🔧 Link targets
- Links are emitted root-relative, e.g.
/safe/01_volworld_portfolio/arts/art-gp_core-gameplay/art-gp/#tm-gp append_hash: trueadds#<id>so the browser scrolls to the page anchor.
🧪 Quick test
-
Put your SVGs in
overrides/.icons/board/… -
Enable
pymdownx.emojias shown above -
Add a test page with
id/status/progress/titlein front-matter -
Use
[[id:…]]links from another page -
Run:
mkdocs serve -v
and verify the rendered icons/text and link targets
🛠 Troubleshooting
-
Shortcodes show as text → Check
markdown_extensions.pymdownx.emojiconfig and that your SVGs exist at the expected paths. -
Link path repeats current page segments → This plugin emits root-relative links; ensure you’re using the latest version.
-
No output / unresolved id → The target page must have front-matter with
id: <value>. Run with-vto see[idref]warnings.
📄 License
MIT (or your preferred license)
🤝 Contributing
PRs welcome!
Ideas: per-project icon maps, extra statuses, or a combined interwiki+idref plugin so [[id:…]] and [[wiki:…]] both work.
Release files for vw-mkdocs-idref 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vw-mkdocs-idref-0.1.5.tar.gz | 4.2 kB | Details |
Release files / vw-mkdocs-idref-0.1.5.tar.gz
| Download URL | vw-mkdocs-idref-0.1.5.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b242accbc37993ee2115c6e5dd78278a8ce543572b0ea054697fd292e380ee3e
|
|
BLAKE2b-256 checksum How to use checksums |
756dfdcf227b4d58ba251ee329c9ee669cf6a2391277ed3c9858e30f2ad8e749
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.32.5 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|