pandoc and rg

I was playing with different ways to peruse my notes this morning and I noticed the formats of link styles and such vary. I was thinking that since I already have a markdown template for pandoc content, I could actually do something like this on any given note to get them more uniform, and then add some nice colors via the bat command:

pandoc -t markdown_strict --reference-links --shift-heading-level-by=1
       --template=resources/template.markdown | bat -l md

The file name is missing in that, it’s just an example, here’s a more concrete example, building on the other note from this morning:

pandoc -t markdown_strict --reference-links \
       --shift-heading-level-by=1 \
       --template=../resources/template.markdown \
       $(rg -l 'free will') | bat  -l md

The template was applied to the entire content, so it didn’t extract any titles and put them in successive documents. But then I was thinking I could add parallel to the picture:

rg -l 'free will' --sort=path | parallel pandoc \
   --template=../resources/template.markdown \
   --shift-heading-level-by=1 -t markdown_strict \
   --reference-links {} \; echo | bat -l md

The extra echo was to account for documents that (typically) dont end with a newline. The sort by path slows it down, but I tend to favor the order.

asciinema captureasciinema capture

=> this morning | this morning

Tags

=> #index | #cli | #rg | #pandoc

Navigation

=> index | tags | prev ⏰ | ⏰ next

Backlinks

=> 2023-11-01 - more toying with rg and pandoc

created: 2023-10-27

(re)generated: 2025-01-11

Proxy Information
Original URL
gemini://thatit.be/2023-10-27-08-08-10.gmi
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
439.982857 milliseconds
Gemini-to-HTML Time
0.916412 milliseconds

This content has been proxied by September (ba2dc).