Skip to content

Commit 298805c

Browse files
Martin Ågrengitster
authored andcommitted
asciidoctor-extensions.rb.in: delete existing <refmiscinfo/>
After the recent a38edab (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 a38edab, we used to just provide a few attributes to Asciidoctor (and asciidoc). Commit 7a30134 (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 7a30134, 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f5f82c0 commit 298805c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Documentation/asciidoctor-extensions.rb.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module Git
2929
class DocumentPostProcessor < Asciidoctor::Extensions::Postprocessor
3030
def process document, output
3131
if document.basebackend? 'docbook'
32+
output = output.sub(/<refmiscinfo class="source">.*?<\/refmiscinfo>/, "")
33+
output = output.sub(/<refmiscinfo class="manual">.*?<\/refmiscinfo>/, "")
3234
new_tags = "" \
3335
"<refmiscinfo class=\"source\">@GIT_VERSION@</refmiscinfo>\n" \
3436
"<refmiscinfo class=\"manual\">Git Manual</refmiscinfo>\n"

0 commit comments

Comments
 (0)