Skip to content

Commit 7d61547

Browse files
bk2204gitster
authored andcommitted
Documentation: move some AsciiDoc parameters into variables
Asciidoctor takes slightly different arguments from AsciiDoc in some cases. It has a different name for the HTML backend and the "docbook" backend produces DocBook 5, not DocBook 4.5. Also, Asciidoctor does not accept the -f option. Move these values into variables so that they can be overridden by users wishing to use Asciidoctor instead of Asciidoc. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f8a48af commit 7d61547

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Documentation/Makefile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ man7dir = $(mandir)/man7
9797

9898
ASCIIDOC = asciidoc
9999
ASCIIDOC_EXTRA =
100+
ASCIIDOC_HTML = xhtml11
101+
ASCIIDOC_DOCBOOK = docbook
102+
ASCIIDOC_CONF = -f asciidoc.conf
100103
MANPAGE_XSL = manpage-normal.xsl
101104
XMLTO = xmlto
102105
XMLTO_EXTRA =
@@ -304,13 +307,13 @@ clean:
304307

305308
$(MAN_HTML): %.html : %.txt asciidoc.conf
306309
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
307-
$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
310+
$(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage $(ASCIIDOC_CONF) \
308311
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
309312
mv $@+ $@
310313

311314
$(OBSOLETE_HTML): %.html : %.txto asciidoc.conf
312315
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
313-
$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
316+
$(ASCIIDOC) -b $(ASCIIDOC_HTML) $(ASCIIDOC_CONF) \
314317
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
315318
mv $@+ $@
316319

@@ -323,13 +326,13 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
323326

324327
%.xml : %.txt asciidoc.conf
325328
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
326-
$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
329+
$(ASCIIDOC) -b $(ASCIIDOC_DOCBOOK) -d manpage $(ASCIIDOC_CONF) \
327330
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
328331
mv $@+ $@
329332

330333
user-manual.xml: user-manual.txt user-manual.conf
331334
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
332-
$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook -d article -o $@+ $< && \
335+
$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b $(ASCIIDOC_DOCBOOK) -d article -o $@+ $< && \
333336
mv $@+ $@
334337

335338
technical/api-index.txt: technical/api-index-skel.txt \
@@ -338,7 +341,7 @@ technical/api-index.txt: technical/api-index-skel.txt \
338341

339342
technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
340343
$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf
341-
$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
344+
$(QUIET_ASCIIDOC)$(ASCIIDOC) -b $(ASCIIDOC_HTML) $(ASCIIDOC_CONF) \
342345
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
343346

344347
XSLT = docbook.xsl
@@ -386,14 +389,15 @@ howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
386389
mv $@+ $@
387390

388391
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
389-
$(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b xhtml11 $*.txt
392+
$(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b $(ASCIIDOC_HTML) $*.txt
390393

391394
WEBDOC_DEST = /pub/software/scm/git/docs
392395

393396
howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
394397
$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
395398
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
396-
sed -e '1,/^$$/d' $< | $(ASCIIDOC) $(ASCIIDOC_EXTRA) -b xhtml11 - >$@+ && \
399+
sed -e '1,/^$$/d' $< | \
400+
$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b $(ASCIIDOC_HTML) - >$@+ && \
397401
mv $@+ $@
398402

399403
install-webdoc : html

0 commit comments

Comments
 (0)