💾 Archived View for thatit.be › 2023-10-27-08-08-10.gmi captured on 2024-03-21 at 15:26:24. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-02-05)

➡️ Next capture (2024-05-10)

🚧 View Differences

-=-=-=-=-=-=-

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.

this morning

this morning

asciinema capture

Tags

#rg

#index

#pandoc

#cli

Navigation

index

tags

prev ⏰

⏰ next

Backlinks

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

updated: 2023-10-27 09:37:19

generated: 2024-03-07