jrnl - how to export specific information to jq Markdown format

in «tip» by Michael Beard
Tags: , , , , , , , ,

How to export specific data from jrnl to jq md format

#### this needs to be run in cmd-grid to work as intended
md -v jqmdraw -contains "RWS-5760"

#### the actual jrnl command would need to be something like the following
#### with the assumption that you have the other files as well
jrnl -contains "RWS-5760" --export json | jq -r -f /Users/$(whoami)/.mike/my_setup/bin/jq-scripts/jq-2-md.jq | /usr/bin/pbcopy

This takes advantage of the fact that I use jq (json query) to take the exported jrnl Markdown output and transform it to what I think is a nicer format for giving to someone or for looking at a specific topic across several days.

It (the jq statement) groups the entries by days and makes it easier to visually discern that (where the default jrnl export to Markdown doesn't handle that as well). Then, I apply some other transforms where if there are multiple day entries, it extracts off the date and only puts the time and stuff like that. It also rationalizes the Hn settings (# or ## or ###, etc).