💾 Archived View for thatit.be › 2023-10-27-08-08-10.gmi captured on 2024-05-10 at 11:06:18. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-03-21)

➡️ Next capture (2024-05-26)

🚧 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.

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

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

generated: 2024-05-03