š¾ Archived View for thatit.be āŗ 2023-11-01-05-50-34.gmi captured on 2024-05-26 at 14:45:32. Gemini links have been rewritten to link to archived content
ā¬ ļø Previous capture (2024-05-10)
ā”ļø Next capture (2024-06-16)
-=-=-=-=-=-=-
Along the same lines as previous tinkering, I was thinking about how the YAML block at the beginning of each note really helps set it apart so that itās obvious each note is coming from a different file. It seemed logical that Pandoc could preserve that if I found the right switches, and it turns out it can.
The switch is just to enable yaml_metadata_block in the output type.
For example, all notes mentioning Pandoc:
rg -l 'pandoc' notes | \ parallel pandoc --template=resources/template.markdown \ --shift-heading-level-by=1 -t markdown+yaml_metadata_block \ --reference-links --reference-location=document {} \; echo \ | bat -t md
The only problem is that I canāt see the file name of the note something came from, so I canāt edit one of the files I see by name. Not too big of a deal, as I can use nvim $(rg -l 'some phrase' notes) and open the file based on content.
I can almost use this same logic on the entire set of my notes to fix formatting, links, and table styles so that everything is well in Obsidian, too.
Hereās a little preview:
rg -l 'pandoc' notes | parallel pandoc --template=resources/template.markdown \ --shift-heading-level-by=1 \ -t markdown+yaml_metadata_block+pipe_tables-simple_tables \ --reference-links --reference-location=document {} \; echo | bat -t md
And hereās what that looks like:
asciinema captureasciinema capture
This would replace all the tables with the only format Obsidian supports (not that Iām bitter) make all the links into reference links for better Gemini formatting, and preserve the YAML meta data that I use internally.
The only issue is that the template I reference above is the one that formats my Gemini posts. The issue here is that it puts the note title at the top of the note in heading 1, hence the --shift-heading-level-by=1 to demote all the remaining headers down a level.
Iāll need to make a new template and not do the heading shifts. Iāll try this out a bit over the next few days and if it produces decent output Iāll convert and review everything. Then Iāll probably make a macro for calling Pandoc from within my editor so I can maintain consistent formatting going forward.
updated: 2023-11-05 17:25:29
generated: 2024-05-25