Merge branch 'bc/asciidoctor'
authorJunio C Hamano <gitster@pobox.com>
Wed, 29 Oct 2014 17:07:39 +0000 (10:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Oct 2014 17:07:40 +0000 (10:07 -0700)
Add machinery to alternatively use AsciiDoctor to format our
documentation.

* bc/asciidoctor:
Documentation: remove Asciidoctor linkgit macro
Documentation: refactor common operations into variables
Documentation: implement linkgit macro for Asciidoctor
Documentation: move some AsciiDoc parameters into variables

1  2 
Documentation/Makefile
diff --combined Documentation/Makefile
index 8d0f70938e6d6f04c9edfb9a3ec8ef45d38502c5,5952cc2318d4caae7cb4551816ec9571cd993f7e..2f6b6aabd74a24abdb3ac189118095fcee19f8d2
@@@ -5,7 -5,6 +5,7 @@@ MAN7_TXT 
  TECH_DOCS =
  ARTICLES =
  SP_ARTICLES =
 +OBSOLETE_HTML =
  
  MAN1_TXT += $(filter-out \
                $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
@@@ -27,7 -26,6 +27,7 @@@ MAN7_TXT += gitcore-tutorial.tx
  MAN7_TXT += gitcredentials.txt
  MAN7_TXT += gitcvs-migration.txt
  MAN7_TXT += gitdiffcore.txt
 +MAN7_TXT += giteveryday.txt
  MAN7_TXT += gitglossary.txt
  MAN7_TXT += gitnamespaces.txt
  MAN7_TXT += gitrevisions.txt
@@@ -39,11 -37,11 +39,11 @@@ MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN
  MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))
  MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))
  
 -OBSOLETE_HTML = git-remote-helpers.html
 +OBSOLETE_HTML += everyday.html
 +OBSOLETE_HTML += git-remote-helpers.html
  DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)
  
  ARTICLES += howto-index
 -ARTICLES += everyday
  ARTICLES += git-tools
  ARTICLES += git-bisect-lk2009
  # with their own formatting rules.
@@@ -99,6 -97,13 +99,13 @@@ man7dir = $(mandir)/man
  
  ASCIIDOC = asciidoc
  ASCIIDOC_EXTRA =
+ ASCIIDOC_HTML = xhtml11
+ ASCIIDOC_DOCBOOK = docbook
+ ASCIIDOC_CONF = -f asciidoc.conf
+ ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) \
+               -agit-version=$(GIT_VERSION)
+ TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)
+ TXT_TO_XML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK)
  MANPAGE_XSL = manpage-normal.xsl
  XMLTO = xmlto
  XMLTO_EXTRA =
@@@ -306,14 -311,12 +313,12 @@@ clean
  
  $(MAN_HTML): %.html : %.txt asciidoc.conf
        $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
-       $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
-               $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
+       $(TXT_TO_HTML) -d manpage -o $@+ $< && \
        mv $@+ $@
  
  $(OBSOLETE_HTML): %.html : %.txto asciidoc.conf
        $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
-       $(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
-               $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
+       $(TXT_TO_HTML) -o $@+ $< && \
        mv $@+ $@
  
  manpage-base-url.xsl: manpage-base-url.xsl.in
  
  %.xml : %.txt asciidoc.conf
        $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
-       $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
-               $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
+       $(TXT_TO_XML) -d manpage -o $@+ $< && \
        mv $@+ $@
  
  user-manual.xml: user-manual.txt user-manual.conf
        $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
-       $(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook -d article -o $@+ $< && \
+       $(TXT_TO_XML) -d article -o $@+ $< && \
        mv $@+ $@
  
  technical/api-index.txt: technical/api-index-skel.txt \
  
  technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
  $(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf
-       $(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
-               $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
+       $(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
  
  XSLT = docbook.xsl
  XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
@@@ -388,14 -389,15 +391,15 @@@ howto-index.txt: howto-index.sh $(wildc
        mv $@+ $@
  
  $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
-       $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b xhtml11 $*.txt
+       $(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
  
  WEBDOC_DEST = /pub/software/scm/git/docs
  
  howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
  $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
        $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
-       sed -e '1,/^$$/d' $< | $(ASCIIDOC) $(ASCIIDOC_EXTRA) -b xhtml11 - >$@+ && \
+       sed -e '1,/^$$/d' $< | \
+       $(TXT_TO_HTML) - >$@+ && \
        mv $@+ $@
  
  install-webdoc : html