by lynndotpy · 6y ago · 0 comments
for filename in ./posts/*.md; do
pandoc -s -c style.css $filename -o outputs/$(basename $filename md)html
doneThat said, I do think this is the way to go, using a popular and generic tool (notably that you do not have to maintain) to accomplish a specific task. And more importantly, composing utilities together in a succinct and efficient way.
Also, if you used semicolons, or xargs with a pipe, you could make this one line :) newlines can be pretty arbitrary, I wonder if there's a better measurement for simplicity, like branches or statements/expressions.
pangeadoc -c style.css ./ -O ./_site
(pangeadoc, of course, is a fork of pandoc that when invoked as above behaves exactly the same as those "3 lines of Bash".)Mine is about 140 lines of bash, and I don't /think/ i'm using anything that isn't part of coreutils.