If you have Pandoc installed, the following script will retrieve its HTML template, write it into a temporary file, make some adjustments, and then pass this file as a parameter:
template=$(mktemp default.html5.XXXXXX)
sed -z 's/.*\s*//' > $template
pandoc input.md -s --template $template -o output.htm
rm $template
It works, but I learn how to use Zsh effectively, and for this reason I want to change it in such a way that creating a temporary file manually won't be required.
As far as I know, Zsh process substitution feature creates temporary files automatically. For example:
${template::==(pandoc -D html)}
But how (and whether) it is possible to re-write the original script using this technique?
Asked by jsx97
(1347 rep)
Aug 6, 2024, 06:08 PM
Last activity: Aug 8, 2024, 07:03 AM
Last activity: Aug 8, 2024, 07:03 AM