nerdy code stuff
I'm working on some code that will be distributed and installed by a partner, so it needs documentation, build tools, and so on. Example configuration files (YAML and unit files) are in the documentation file, which is written in Markdown.
In my Makefile, which builds a .deb, I do this to extract the sample config files:
pandoc -t markdown -t json < README.md | jq -r '.blocks | select (.t=="CodeBlock") | select(.c=="yaml").c' > /etc/config.yaml.dist
The personal Mastodon instance of Gavin Brown.