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 T383838bat command:
T282828
pandoc -t markdown_strict --reference-links --shift-heading-level-byTff7b72=T79c0ff1
--templateTff7b72=resources/template.markdown Tb4b4b4| 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:
T282828
pandoc -t markdown_strict --reference-links Tffea00\
--shift-heading-level-byTff7b72=T79c0ff1 Tffea00\
--templateTff7b72=../resources/template.markdown Tffea00\
Tff7b72$(rg -l Ta5d6ff'free will'Tff7b72) Tb4b4b4| 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 T383838parallel to the picture:
T282828
rg -l Ta5d6ff'free will' --sortTff7b72=path Tb4b4b4| parallel pandoc Tffea00\
--templateTff7b72=../resources/template.markdown Tffea00\
--shift-heading-level-byTff7b72=T79c0ff1 -t markdown_strict Tffea00\
--reference-links Tff7b72{Tff7b72} Tffea00\; Tffa657echo Tb4b4b4| 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.
Tags: index, cli, rg, pandoc
Tags
Navigation
Backlinks