mq

Extract and transform markdown content like JSON with jq-style queries.

brewmacoslinux
Try with needOr install directly
Source

About

Jq-like command-line tool for markdown processing

Commands

mq

Examples

extract all headings from markdown file$ mq '.headings[]' document.md
get markdown code blocks by language$ mq '.code[] | select(.language == "javascript")' readme.md
extract all links from markdown$ mq '.links[] | .url' document.md
filter markdown paragraphs by text content$ mq '.paragraphs[] | select(.text | contains("search term"))' file.md
convert markdown structure to JSON format$ mq '.' document.md > output.json