image: debian/testing packages: - pandoc - weasyprint - poppler-utils sources: - https://git.sr.ht/~boringcactus/crowbar-spec tasks: - page-count: | cd crowbar-spec files="index vs-c tagged-unions types safety errors syntax LICENSE" html_files="" i=0 for file in $files do pandoc --defaults=etc/md.yml --number-offset=$i -o $file.html $file.md html_files="$html_files $file.html" i=$((i+1)) done if git describe --tags --exact-match 2>/dev/null then metadata="subtitle=$(git describe --tags --exact-match)" else metadata="version=$(git log -1 --no-decorate --oneline)" fi pandoc --defaults=etc/pdf.yml -o ../spec.pdf -M $metadata $html_files cd .. pdfinfo spec.pdf | grep Pages tar czvf spec-html.tar.gz crowbar-spec/*.html artifacts: - spec.pdf - spec-html.tar.gz