Use Makefile rules to generate documentation

And regenerate documentation.
This commit is contained in:
Samuel Thibault 2023-12-24 15:41:30 +01:00
parent 986961ad5d
commit 6be06966e3
8 changed files with 953 additions and 316 deletions

29
docs/Makefile Normal file
View file

@ -0,0 +1,29 @@
ifeq (,$(shell command -v pandoc))
all:
clean:
else
# Source documentation in markdown lives in the src/ folder (html and manpages).
# This is what you should edit if you want to make changes to the documentation.
# From these sources, this script generates actual manpages and general
# documentation in html using pandoc.
HTML_MD = $(wildcard src/html/*.md)
MAN_MD = $(wildcard src/man/*.md)
HTML_HTML = $(patsubst src/html/%.md,html/%.html,$(HTML_MD))
MAN_MAN = $(patsubst src/man/%.md,manpages/%,$(MAN_MD))
all: $(HTML_HTML) $(MAN_MAN)
html/%.html: src/html/%.md
pandoc -f markdown -t html $< > $@
echo $@ successfully built in docs/html directory
manpages/%: src/man/%.md
pandoc -s -t man $< -o $@
echo $@ successfully built in docs/manpages directory
clean:
rm -f html/*.html manpages/*.[58]
endif