subsurface/Documentation/Makefile
Dirk Hohndel 4197faf1b7 update documentation processing
- fix typo in Makefile
- remove unmaintained Russian translation
- try to fix incompatibilities with current asciidoc version
- update processed files

Unfortunately I wasn't able to figure out one error that stops the linting of
the mobile manual from succeeding - as a result I turned of linting for now
(that's the '-L' flag that was added to a2x)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-02-08 13:26:39 -08:00

56 lines
1.9 KiB
Makefile

#
# in order for "normal" developers not to have to install asciidoc (which
# brings in a couple hundred MB of dependencies) we now include both the
# user-manual.txt and a copy of the generated .html file in git
#
# in order to avoid unnecessary thrash with minor version differences, when
# submitting patches to the user manual, only submit the changes to the .txt
# file - the maintainer will recreate the .html.git file
DOCNAMES = user-manual user-manual_es user-manual_fr user-manual_nl mobile-manual-v3
HTMLDOCS = $(patsubst %,$(OUT)%.html,$(DOCNAMES))
TEXTDOCS = $(patsubst %,$(OUT)%.text,$(DOCNAMES))
PDFDOCS = $(patsubst %,$(OUT)%.pdf,$(DOCNAMES))
ASCIIDOC = asciidoc
A2X = a2x -L
BROWSER = firefox
THEME = compact_subsurface
PWD = $(realpath .)
all: $(HTMLDOCS) $(TEXTDOCS) $(PDFDOCS)
doc: $(HTMLDOCS)
$(OUT)%.text: %.txt
$(A2X) -f text $<
$(OUT)%.pdf: %.txt
-$(A2X) --dblatex-opts "-P latex.output.revhistory=0" -f pdf $<
$(OUT)%.html: %.txt
$(ASCIIDOC) --version > /dev/null 2>&1 || echo "if asciidoc isn't found the html file included in the sources is copied"
$(ASCIIDOC) -a toc -a toclevels=3 -a themedir=$(PWD) -a theme=$(THEME) -o $@ $< || \
cp $(<:%.txt=%.html.git) $@
# for the web facing version of the desktop manual, just use the post-processing script
user-manual.html.wp: user-manual.html
bash ../scripts/prep-manual.sh $<
# for the web facing version of the mobile manual, re-create the HTML with only one level in
# the table of context and then post process
mobile-manual-v3.html.wp: mobile-manual-v3.txt
$(ASCIIDOC) -a toc -a toclevels=1 -a themedir=$(PWD) -a theme=$(THEME) -o $(<:%.txt=%.html.tmp) $< && \
bash ../scripts/prep-manual.sh $(<:%.txt=%.html.tmp) && \
mv $(<:%.txt=%.html.tmp.wp) $@
# Alternatively::
$(OUT)$(DOCNAME).xhtml: $(DOCSOURCE)
$(A2X) --icons -f xhtml $<
show: $(HTMLDOC)
$(BROWSER) $<
clean:
rm -f *~ *.xml docbook-xsl.css $(HTMLDOCS) $(TEXTDOCS) $(PDFDOCS)