-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (45 loc) · 2.24 KB
/
Copy pathMakefile
File metadata and controls
57 lines (45 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.PHONY: html pdf server install bash word docbook docs files
# COMMAND=docker
COMMAND=podman
# Enter the server inside Docker
bash:
@${COMMAND} run -it -u $(id -u):$(id -g) -v .:/documents/ adoc-book /bin/bash
# Install Docker Image
install i:
@${COMMAND} build -t adoc-book .
# HTML
html h:
@rm -rf docs/html
@mkdir -p docs/html
@cp -r resources/ docs/html
@${COMMAND} run -it -u $(id -u):$(id -g) -v .:/documents/ adoc-book asciidoctor -r asciidoctor-diagram book.adoc -o docs/html/index.html --verbose
# Preview HTML Output
server s:
@cd docs/html && echo "http://localhost:8000" && python3 -m http.server
# PDF, Docbook and Word
# Copy files
files f:
@rm -rf docs/.asciidoctor
@mkdir -p docs/.asciidoctor
@find book -name '*.jpg' | xargs -I {} cp {} docs/.asciidoctor
@find book -name '*.jpeg' | xargs -I {} cp {} docs/.asciidoctor
@find book -name '*.png' | xargs -I {} cp {} docs/.asciidoctor
@find book -name '*.svg' | xargs -I {} cp {} docs/.asciidoctor
@find book -name '*.gif' | xargs -I {} cp {} docs/.asciidoctor
@find resources/images -name '*.jpg' | xargs -I {} cp {} docs/.asciidoctor
@find resources/images -name '*.jpeg' | xargs -I {} cp {} docs/.asciidoctor
@find resources/images -name '*.png' | xargs -I {} cp {} docs/.asciidoctor
@find resources/images -name '*.svg' | xargs -I {} cp {} docs/.asciidoctor
@find resources/images -name '*.gif' | xargs -I {} cp {} docs/.asciidoctor
pdf p:
@rm -rf docs/book.pdf
@make files
@${COMMAND} run -it -u $(id -u):$(id -g) -v .:/documents/ adoc-book asciidoctor-pdf -a allow-uri-read=true -a source-highlighter=rouge -a rouge-style=monokai_sublime -r asciidoctor-lists -r asciidoctor-diagram -r asciidoctor-bibtex -r asciidoctor-mathematical -a mathematical-format=svg book.adoc -o docs/book.pdf --verbose --trace
docbook d:
@rm -rf docs/book.xml
@make files
@${COMMAND} run -it -u $(id -u):$(id -g) -v .:/documents/ adoc-book asciidoctor -b docbook -r asciidoctor-diagram -r asciidoctor-bibtex -r asciidoctor-mathematical -a mathematical-format=svg -a media=prepress book.adoc -o docs/book.xml --verbose
word w:
@rm -rf docs/book.docx
@make docbook
@${COMMAND} run -it -u $(id -u):$(id -g) -v ./docs:/pandoc docker.io/dalibo/pandocker --from docbook --to docx --output book.docx book.xml