Last active
May 26, 2019 00:28
-
-
Save manuelp/b3ea6e74c358661d444a to your computer and use it in GitHub Desktop.
Makefile for producing documents with Asciidoctor + Pandoc
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
BASE_NAME=sample-document | |
all: $(BASE_NAME).html $(BASE_NAME).pdf $(BASE_NAME).xml $(BASE_NAME).docx $(BASE_NAME).epub $(BASE_NAME).md $(BASE_NAME).confluence | |
$(BASE_NAME).html: prepare | |
asciidoctor $(BASE_NAME).adoc -o output/$(BASE_NAME).html | |
# https://github.com/asciidoctor/asciidoctor-pdf | |
$(BASE_NAME).pdf: prepare | |
asciidoctor -r asciidoctor-pdf -b pdf $(BASE_NAME).adoc -o output/$(BASE_NAME).pdf | |
$(BASE_NAME).xml: prepare | |
asciidoctor -b docbook5 -d article $(BASE_NAME).adoc -o output/$(BASE_NAME).xml | |
$(BASE_NAME).epub: $(BASE_NAME).xml | |
pandoc -f docbook -t epub3 output/$(BASE_NAME).xml -o output/$(BASE_NAME).epub | |
$(BASE_NAME).docx: $(BASE_NAME).xml | |
pandoc -f docbook -t docx output/$(BASE_NAME).xml -o output/$(BASE_NAME).docx | |
$(BASE_NAME).md: prepare $(BASE_NAME).xml | |
pandoc -f docbook -t markdown_github -s --toc output/$(BASE_NAME).xml -o output/$(BASE_NAME).md | |
# https://github.com/jedi4ever/markdown2confluence | |
$(BASE_NAME).confluence: prepare $(BASE_NAME).md | |
markdown2confluence output/$(BASE_NAME).md > output/$(BASE_NAME).confluence | |
prepare: | |
mkdir -p output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment