| 1 |
ifeq (,$(shell command -v pandoc)) |
| 2 |
all: |
| 3 |
clean: |
| 4 |
else |
| 5 |
|
| 6 |
# Source documentation in markdown lives in the src/ folder (html and manpages). |
| 7 |
# This is what you should edit if you want to make changes to the documentation. |
| 8 |
# From these sources, this script generates actual manpages and general |
| 9 |
# documentation in html using pandoc. |
| 10 |
|
| 11 |
HTML_MD = $(wildcard src/html/*.md) |
| 12 |
MAN_MD = $(wildcard src/man/*.md) |
| 13 |
|
| 14 |
HTML_HTML = $(patsubst src/html/%.md,html/%.html,$(HTML_MD)) |
| 15 |
MAN_MAN = $(patsubst src/man/%.md,manpages/%,$(MAN_MD)) |
| 16 |
|
| 17 |
all: $(HTML_HTML) $(MAN_MAN) |
| 18 |
|
| 19 |
html/%.html: src/html/%.md |
| 20 |
pandoc -f markdown -t html $< > $@ |
| 21 |
echo $@ successfully built in docs/html directory |
| 22 |
|
| 23 |
manpages/%: src/man/%.md |
| 24 |
pandoc -s -t man $< -o $@ |
| 25 |
echo $@ successfully built in docs/manpages directory |
| 26 |
|
| 27 |
clean: |
| 28 |
rm -f html/*.html manpages/*.[58] |
| 29 |
endif |