Created
April 10, 2023 12:45
-
-
Save jovemfelix/62a22c63d4c5f0ac78f8d0599fdb9eb4 to your computer and use it in GitHub Desktop.
Convert AsciiDoc into DOCX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
INPUT_ADOC=README.adoc | |
GIT_DATE=$(TZ=UTC git log -1 --pretty=format:%cd --date=format-local:%Y-%m-%d-%H-%M-%S) | |
# get customer short name | |
CUSTOMER_SHORT_NAME=$(sed -En 's/^:cust: (.*)/\1/p' vars/customer-vars.adoc) | |
CLEAN_CUSTOMER_SHORT_NAME=$(echo "${CUSTOMER_SHORT_NAME}" | sed 's/ /_/g') | |
OUTFILE="cer-${CLEAN_CUSTOMER_SHORT_NAME}-${GIT_DATE}.docx" | |
asciidoctor --backend docbook --out-file - $INPUT_ADOC | pandoc --from docbook --to docx --output $OUTFILE \ | |
--highlight-style tango | |
echo Generated $OUTFILE | |
# pandoc --list-highlight-styles | |
# tango or pygments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment