Skip to content

Commit 851ecc4

Browse files
pks-tgitster
authored andcommitted
Documentation: inline user-manual.conf
When generating our user manual we set up a bit of extra configuration compared to our normal configuration. This is done by having an extra "user-manual.conf" file that Asciidoc seems to pull in automatically due to matching filenames with "user-manual.txt". This dependency is quite hidden though and thus easy to miss. Furthermore, it seems that Asciidoc does not know to pull it in for out-of-tree builds where we use relative paths. The setup in AsciiDoctor is somewhat different: instead of having two sets of configuration, we condition the use of manual-specific configs based on whether the document type is "book". And as we only build our user manual with that type this is sufficient. Use the same trick for our user manual by inlining the configuration into "asciidoc.conf.in" and making it conditional on whether or not "doctype-book" is defined. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0696ebe commit 851ecc4

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Documentation/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ manpage-cmd = $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
362362
%.xml : %.txt $(ASCIIDOC_DEPS)
363363
$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
364364

365-
user-manual.xml: user-manual.txt user-manual.conf $(ASCIIDOC_DEPS)
365+
user-manual.xml: user-manual.txt $(ASCIIDOC_DEPS)
366366
$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d book -o $@ $<
367367

368368
technical/api-index.txt: technical/api-index-skel.txt \

Documentation/asciidoc.conf.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,22 @@ manmanual=Git Manual
2525
mansource=Git @GIT_VERSION@
2626
revdate=@GIT_DATE@
2727

28+
ifdef::doctype-book[]
29+
[titles]
30+
underlines="__","==","--","~~","^^"
31+
endif::doctype-book[]
32+
2833
ifdef::backend-docbook[]
2934
[linkgit-inlinemacro]
35+
ifndef::doctype-book[]
3036
{0%{target}}
3137
{0#<citerefentry>}
3238
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
3339
{0#</citerefentry>}
40+
endif::doctype-book[]
41+
ifdef::doctype-book[]
42+
<ulink url="{target}.html">{target}{0?({0})}</ulink>
43+
endif::doctype-book[]
3444

3545
[literal-inlinemacro]
3646
{eval:re.sub(r'(&lt;[-a-zA-Z0-9.]+&gt;)', r'<emphasis>\1</emphasis>', re.sub(r'([\[\s|()>]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,\/_^\$]+\.?)+)',r'\1<literal>\2</literal>', re.sub(r'(\.\.\.?)([^\]$.])', r'<literal>\1</literal>\2', macros.passthroughs[int(attrs['passtext'][1:-1])] if attrs['passtext'][1:-1].isnumeric() else attrs['passtext'][1:-1])))}

Documentation/user-manual.conf

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)