#!/usr/bin/fish if [ -z (find -name schema.png -newer source/schema.dia) ] echo 'Generating schema PNG...' dia -e schema.png source/schema.dia convert schema.png -bordercolor white -border 20 schema.png end echo 'Generating HTML...' for md_path in source/*.md set output_path (echo $md_path | sed 's_source/__;s/md/html/') rm -f $output_path set page_html (markdown -f +idanchor -squash -html5 -toc $md_path) echo '' >> $output_path echo '' >> $output_path echo '' >> $output_path echo '' >> $output_path echo '' (echo $page_html | xmllint --html -xpath "//h1/text()" - ^ /dev/null) '' >> $output_path echo '' >> $output_path echo '' >> $output_path echo '' >> $output_path echo $page_html >> $output_path echo '' >> $output_path echo '' >> $output_path tidy -mi $output_path ^ /dev/null end