Makefile: drive asciidoc directly for HTML output

This is mostly taken from Git's doc/Makefile, although simplified for
our use.  The output now uses Asciidoc's default CSS which I think looks
a bit nicer than the Docbook formatting; as a result of this we no
longer need our custom .css file.

A side effect of this change is that temporary files generated from the
HTML output no longer conflict with the manpage output format (because
any temporary HTML output files use names derived from the output
filename which includes .html).

Signed-off-by: John Keeping <john@keeping.me.uk>
This commit is contained in:
John Keeping 2018-06-16 13:11:09 +01:00
parent 33414d7869
commit 48f175083a
2 changed files with 8 additions and 4 deletions

View File

@ -24,6 +24,12 @@ DOC_MAN5 = $(patsubst %.txt,%,$(MAN5_TXT))
DOC_HTML = $(patsubst %.txt,%.html,$(MAN_TXT)) DOC_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))
DOC_PDF = $(patsubst %.txt,%.pdf,$(MAN_TXT)) DOC_PDF = $(patsubst %.txt,%.pdf,$(MAN_TXT))
ASCIIDOC = asciidoc
ASCIIDOC_EXTRA =
ASCIIDOC_HTML = xhtml11
ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA)
TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)
# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
# do not support the 'size specifiers' introduced by C99, namely ll, hh, # do not support the 'size specifiers' introduced by C99, namely ll, hh,
# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
@ -134,7 +140,8 @@ doc-pdf: $(DOC_PDF)
a2x -f manpage $< a2x -f manpage $<
$(DOC_HTML): %.html : %.txt $(DOC_HTML): %.html : %.txt
a2x -f xhtml --stylesheet=cgit-doc.css --xsltproc-opts="--param generate.consistent.ids 1" $< $(TXT_TO_HTML) -o $@+ $< && \
mv $@+ $@
$(DOC_PDF): %.pdf : %.txt $(DOC_PDF): %.pdf : %.txt
a2x -f pdf cgitrc.5.txt a2x -f pdf cgitrc.5.txt

View File

@ -1,3 +0,0 @@
div.variablelist dt {
margin-top: 1em;
}