Skip to content

ApexMarkdown/apex-filter-delink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Apex Delink Filter

Python JSON filter for the Apex Markdown processor, compatible with Pandoc-style filters (docs).

This filter:

  • Finds all Link inline nodes in the Pandoc JSON AST:
    • { "t": "Link", "c": [ Attr, [Inlines...], [url, title] ] }
  • Replaces them with a Span that 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.

Script

The main filter implementation lives in delink.py:

./delink.py < in.json > out.json

It expects a full Pandoc‑style JSON document as produced by:

pandoc -t json input.md | ./delink.py | pandoc -f json -t html

or, when used via Apex:

apex --filter delink input.md > output.html

Installation for Apex

  1. Ensure the script is executable:

    chmod +x delink.py
  2. Install it into your Apex filters directory:

    mkdir -p ~/.config/apex/filters
    cp delink.py ~/.config/apex/filters/delink
  3. 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.html

You can combine this filter with others (for example, the title filter) by either:

  • Using multiple --filter NAME flags, or
  • Installing both scripts in ~/.config/apex/filters and using --filters.

About

Filters for Apex

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages