summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorMartin Ågren <martin.agren@gmail.com>2024-12-21 00:18:16 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-21 02:34:35 +0100
commit298805c823067ca32b1577662c87f77240e36aec (patch)
tree198956bf0438ee19b6286cf9351cb70e64b0553a /Documentation
parentMerge branch 'ps/build-hotfix' into ma/asciidoctor-build-fixes (diff)
downloadgit-298805c823067ca32b1577662c87f77240e36aec.tar.xz
git-298805c823067ca32b1577662c87f77240e36aec.zip
asciidoctor-extensions.rb.in: delete existing <refmiscinfo/>
After the recent a38edab7c8 (Makefile: generate doc versions via GIT-VERSION-GEN, 2024-12-06), building with Asciidoctor results in manpages where the headers no longer contain "Git Manual" and the footers no longer identify the built Git version. Before a38edab7c8, we used to just provide a few attributes to Asciidoctor (and asciidoc). Commit 7a30134358 (asciidoctor-extensions: provide `<refmiscinfo/>`, 2019-09-16) noted that older versions of Asciidoctor didn't propagate those attributes into the built XML files, so we started injecting them ourselves from this script. With newer versions of Asciidoctor, we'd end up with some harmless duplication among the tags in the final XML. Post-a38edab7c8, we don't provide these attributes and Asciidoctor inserts empty-ish values. After our additions from 7a30134358, we get <refmiscinfo class="source">&#160;</refmiscinfo> <refmiscinfo class="manual">&#160;</refmiscinfo> <refmiscinfo class="source">2.47.1.[...]</refmiscinfo> <refmiscinfo class="manual">Git Manual</refmiscinfo> When these are handled, it appears to be first come first served, meaning that our additions have no effect and we regress as described in the first paragraph. Remove existing "source" or "manual" <refmiscinfo/> tags before adding ours. I considered removing all <refmiscinfo/> to get a nice clean slate, instead of just those two that we want to replace to be a bit more precise. I opted for the latter. Maybe one day, Asciidoctor learns to insert something useful there which `xmlto` can pick up and make good use of -- let's not interfere. Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/asciidoctor-extensions.rb.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/Documentation/asciidoctor-extensions.rb.in b/Documentation/asciidoctor-extensions.rb.in
index c4c200dace..d8d06f9a57 100644
--- a/Documentation/asciidoctor-extensions.rb.in
+++ b/Documentation/asciidoctor-extensions.rb.in
@@ -29,6 +29,8 @@ module Git
class DocumentPostProcessor < Asciidoctor::Extensions::Postprocessor
def process document, output
if document.basebackend? 'docbook'
+ output = output.sub(/<refmiscinfo class="source">.*?<\/refmiscinfo>/, "")
+ output = output.sub(/<refmiscinfo class="manual">.*?<\/refmiscinfo>/, "")
new_tags = "" \
"<refmiscinfo class=\"source\">@GIT_VERSION@</refmiscinfo>\n" \
"<refmiscinfo class=\"manual\">Git Manual</refmiscinfo>\n"