Skip to content

Instantly share code, notes, and snippets.

@mattbailey
Last active May 28, 2016 00:25
Show Gist options
  • Select an option

  • Save mattbailey/31a432b65dee7c13b286d4fee7ddd4a1 to your computer and use it in GitHub Desktop.

Select an option

Save mattbailey/31a432b65dee7c13b286d4fee7ddd4a1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# use as pre-commit git hook
find manuscript -name "*.adoc" | \
xargs -P 3 -I {} \
asciidoctor-pdf \
-d book \
-o ./{}.pdf \
-a pdf-fontsdir=misc/fonts \
-a pdf-style=misc/manning-theme.yml \
{}
for file in manuscript/*.adoc; do
chapter=`basename $file .adoc`
mv manuscript/${chapter}.adoc.pdf manuscript/${chapter}.pdf
git add manuscript/${chapter}.pdf
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment