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 < | jq -r '.blocks[] | select (.t=="CodeBlock") | select(.c[0][1][0]=="yaml").c[1]' > /etc/config.yaml.dist

· · Web · 0 · 0 · 1
Sign in to participate in the conversation

The personal Mastodon instance of Gavin Brown.