Python JSON filter for the Apex Markdown processor, compatible with Pandoc-style filters (docs).
This filter:
- Finds all
Linkinline nodes in the Pandoc JSON AST:{ "t": "Link", "c": [ Attr, [Inlines...], [url, title] ] }
- Replaces them with a
Spanthat keeps only the text:{ "t": "Span", "c": [ Attr, [Inlines...] ] }
The result is that hyperlinks are delinked (no clickable URLs), but the visible link text remains in place.
The main filter implementation lives in delink.py:
./delink.py < in.json > out.jsonIt expects a full Pandoc‑style JSON document as produced by:
pandoc -t json input.md | ./delink.py | pandoc -f json -t htmlor, when used via Apex:
apex --filter delink input.md > output.html-
Ensure the script is executable:
chmod +x delink.py
-
Install it into your Apex filters directory:
mkdir -p ~/.config/apex/filters cp delink.py ~/.config/apex/filters/delink
-
Run Apex with the filter enabled:
apex --filter delink input.md > output.html
To run all installed filters in the directory:
apex --filters input.md > output.htmlYou can combine this filter with others (for example, the title filter)
by either:
- Using multiple
--filter NAMEflags, or - Installing both scripts in
~/.config/apex/filtersand using--filters.