Documentation: Avoid use of xmlto --stringparam
The --stringparam option is not available on older xmlto versions. Instead, set man.base.url.for.relative.links via a .xsl file. Older docbook versions will ignore this without causing grief to users of older xmlto versions. Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
165ca62108
commit
50d9bbba92
1
Documentation/.gitignore
vendored
1
Documentation/.gitignore
vendored
@ -8,3 +8,4 @@ gitman.info
|
|||||||
howto-index.txt
|
howto-index.txt
|
||||||
doc.dep
|
doc.dep
|
||||||
cmds-*.txt
|
cmds-*.txt
|
||||||
|
manpage-base-url.xsl
|
||||||
|
@ -104,18 +104,15 @@ XMLTO_EXTRA += -m manpage-suppress-sp.xsl
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Newer DocBook stylesheet emits warning cruft in the output when
|
# Newer DocBook stylesheet emits warning cruft in the output when
|
||||||
# this is not set, and if set it shows an absolute link. We can
|
# this is not set, and if set it shows an absolute link. Older
|
||||||
# use MAN_BASE_URL=http://www.kernel.org/pub/software/scm/git/docs/
|
# stylesheets simply ignore this parameter.
|
||||||
# but distros may want to set it to /usr/share/doc/git-core/docs/ or
|
|
||||||
# something like that.
|
|
||||||
#
|
#
|
||||||
# As older stylesheets simply ignore this parameter, it ought to be
|
# Distros may want to use MAN_BASE_URL=file:///path/to/git/docs/
|
||||||
# safe to set it to empty string when the base URL is not specified,
|
# or similar.
|
||||||
# but unfortunately we cannot do so unconditionally because at least
|
ifndef MAN_BASE_URL
|
||||||
# xmlto 0.0.18 is reported to lack --stringparam option.
|
MAN_BASE_URL = file://$(htmldir)/
|
||||||
ifdef MAN_BASE_URL
|
|
||||||
XMLTO_EXTRA += --stringparam man.base.url.for.relative.links=$(MAN_BASE_URL)
|
|
||||||
endif
|
endif
|
||||||
|
XMLTO_EXTRA += -m manpage-base-url.xsl
|
||||||
|
|
||||||
# If your target system uses GNU groff, it may try to render
|
# If your target system uses GNU groff, it may try to render
|
||||||
# apostrophes as a "pretty" apostrophe using unicode. This breaks
|
# apostrophes as a "pretty" apostrophe using unicode. This breaks
|
||||||
@ -244,6 +241,7 @@ clean:
|
|||||||
$(RM) howto-index.txt howto/*.html doc.dep
|
$(RM) howto-index.txt howto/*.html doc.dep
|
||||||
$(RM) technical/api-*.html technical/api-index.txt
|
$(RM) technical/api-*.html technical/api-index.txt
|
||||||
$(RM) $(cmds_txt) *.made
|
$(RM) $(cmds_txt) *.made
|
||||||
|
$(RM) manpage-base-url.xsl
|
||||||
|
|
||||||
$(MAN_HTML): %.html : %.txt
|
$(MAN_HTML): %.html : %.txt
|
||||||
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
|
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
|
||||||
@ -251,7 +249,10 @@ $(MAN_HTML): %.html : %.txt
|
|||||||
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
|
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
|
||||||
mv $@+ $@
|
mv $@+ $@
|
||||||
|
|
||||||
%.1 %.5 %.7 : %.xml
|
manpage-base-url.xsl: manpage-base-url.xsl.in
|
||||||
|
sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
|
||||||
|
|
||||||
|
%.1 %.5 %.7 : %.xml manpage-base-url.xsl
|
||||||
$(QUIET_XMLTO)$(RM) $@ && \
|
$(QUIET_XMLTO)$(RM) $@ && \
|
||||||
xmlto -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
|
xmlto -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
|
||||||
|
|
||||||
|
10
Documentation/manpage-base-url.xsl.in
Normal file
10
Documentation/manpage-base-url.xsl.in
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!-- manpage-base-url.xsl:
|
||||||
|
special settings for manpages rendered from newer docbook -->
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
version="1.0">
|
||||||
|
|
||||||
|
<!-- set a base URL for relative links -->
|
||||||
|
<xsl:param name="man.base.url.for.relative.links"
|
||||||
|
>@@MAN_BASE_URL@@</xsl:param>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
Loading…
Reference in New Issue
Block a user