From: Patrick Steinhardt <ps@pks.im>
To: "Martin Ågren" <martin.agren@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/3] asciidoctor-extensions.rb.in: delete existing <refmiscinfo/>
Date: Sat, 21 Dec 2024 11:42:54 +0100 [thread overview]
Message-ID: <Z2abqCTOHjIlRcxx@pks.im> (raw)
In-Reply-To: <8bdc26c1ae74b59f2c3cd3408111336ce3af1447.1734734612.git.martin.agren@gmail.com>
On Sat, Dec 21, 2024 at 12:18:16AM +0100, Martin Ågren wrote:
> 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.
Okay. So if I understand correctly, we used to have the exact same
values for those tags twice with newer versions of Asciidoctor, but
starting with the change we have one "empty" set of tags and one set of
tags that contain the replaced values. And because Asciidoctor ignores
the latter the end result is that we have empty ref info.
> Post-a38edab7c8, we don't provide these attributes and Asciidoctor
> inserts empty-ish values. After our additions from 7a30134358, we get
>
> <refmiscinfo class="source"> </refmiscinfo>
> <refmiscinfo class="manual"> </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.
Okay, makes sense.
> Signed-off-by: Martin Ågren <martin.agren@gmail.com>
> ---
> Documentation/asciidoctor-extensions.rb.in | 2 ++
> 1 file changed, 2 insertions(+)
>
> 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"
And this looks as expected.
Patrick
next prev parent reply other threads:[~2024-12-21 10:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 23:18 [PATCH 0/3] Asciidoctor fixes for 2.48.0 Martin Ågren
2024-12-20 23:18 ` [PATCH 1/3] asciidoctor-extensions.rb.in: delete existing <refmiscinfo/> Martin Ågren
2024-12-21 10:42 ` Patrick Steinhardt [this message]
2024-12-20 23:18 ` [PATCH 2/3] asciidoctor-extensions.rb.in: add missing word Martin Ågren
2024-12-20 23:18 ` [PATCH 3/3] asciidoctor-extensions.rb.in: inject GIT_DATE Martin Ågren
2024-12-21 2:42 ` [PATCH 0/3] Asciidoctor fixes for 2.48.0 Junio C Hamano
2024-12-21 10:43 ` Patrick Steinhardt
2024-12-21 16:58 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z2abqCTOHjIlRcxx@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=martin.agren@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).