From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: "Martin Ågren" <martin.agren@gmail.com>
Subject: [PATCH v3 3/3] asciidoctor-extensions: fix spurious space after linkgit
Date: Mon, 11 Mar 2019 18:26:05 +0900 [thread overview]
Message-ID: <20190311092605.259322-3-gitster@pobox.com> (raw)
In-Reply-To: <20190311092605.259322-1-gitster@pobox.com>
From: Martin Ågren <martin.agren@gmail.com>
When we render, e.g., "linkgit:gitglossary[7]." with Asciidoctor, we get
"gitglossary(7) ." with a space between the linkgit macro expansion and
the punctuation. We can fix this by dropping the trailing newline after
we've turned `linkgit:foo[bar]` into `<citerefentry>..</citerefentry>`.
The diff produced by `USE_ASCIIDOCTOR=Yes ./doc-diff HEAD^ HEAD` is
almost 6000 lines large and shows how this fixes "git-foo(x) ,", "(see
git-bar(y) )" and so on. One might wonder whether this also turns, e.g.,
"see linkgit:foo[1] for more" into "see foo(1)for more", but no. We get
"...</citerefentry> for more" in the XML, see, e.g., git-am.xml, so the
space ends up in git-am.1 just fine. The same is true for the HTML output.
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/asciidoctor-extensions.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb
index ec83b4959e..0089e0cfb8 100644
--- a/Documentation/asciidoctor-extensions.rb
+++ b/Documentation/asciidoctor-extensions.rb
@@ -11,12 +11,12 @@ module Git
def process(parent, target, attrs)
if parent.document.basebackend? 'html'
prefix = parent.document.attr('git-relative-html-prefix')
- %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>\n)
+ %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>)
elsif parent.document.basebackend? 'docbook'
"<citerefentry>\n" \
"<refentrytitle>#{target}</refentrytitle>" \
"<manvolnum>#{attrs[1]}</manvolnum>\n" \
- "</citerefentry>\n"
+ "</citerefentry>"
end
end
end
--
2.21.0-155-ge902e9bcae
next prev parent reply other threads:[~2019-03-11 9:26 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 20:02 [PATCH 0/3] asciidoctor-extensions: fix spurious space after linkgit Martin Ågren
2019-02-25 20:02 ` [PATCH 1/3] Documentation/Makefile: add missing xsl dependencies for manpages Martin Ågren
2019-02-25 20:08 ` Eric Sunshine
2019-02-25 20:28 ` Martin Ågren
2019-02-25 21:00 ` Eric Sunshine
2019-02-26 5:59 ` Martin Ågren
2019-02-26 12:47 ` Eric Sunshine
2019-02-27 18:19 ` Martin Ågren
2019-02-25 20:02 ` [PATCH 2/3] Documentation/Makefile: add missing dependency on asciidoctor-extensions Martin Ågren
2019-02-25 20:02 ` [PATCH 3/3] asciidoctor-extensions: fix spurious space after linkgit Martin Ågren
2019-02-26 3:20 ` brian m. carlson
2019-02-26 3:22 ` [PATCH 0/3] " brian m. carlson
2019-02-26 6:03 ` Martin Ågren
2019-02-27 18:17 ` [PATCH v2 " Martin Ågren
2019-02-27 18:17 ` [PATCH v2 1/3] Documentation/Makefile: add missing xsl dependencies for manpages Martin Ågren
2019-02-27 18:17 ` [PATCH v2 2/3] Documentation/Makefile: add missing dependency on asciidoctor-extensions Martin Ågren
2019-02-27 18:17 ` [PATCH v2 3/3] asciidoctor-extensions: fix spurious space after linkgit Martin Ågren
2019-02-28 23:50 ` [PATCH v2 0/3] " brian m. carlson
2019-03-03 1:25 ` Junio C Hamano
2019-03-10 15:14 ` [PATCH 0/2] fix spurious space after linkgit, now in *.html Martin Ågren
2019-03-10 15:14 ` [PATCH 1/2] Documentation/Makefile: add missing dependencies on asciidoctor-extensions Martin Ågren
2019-03-10 15:14 ` [PATCH 2/2] asciidoctor-extensions: fix spurious space after linkgit in *.html Martin Ågren
2019-03-11 2:59 ` [PATCH 0/2] fix spurious space after linkgit, now " Jeff King
2019-03-11 5:47 ` Martin Ågren
2019-03-11 3:02 ` Junio C Hamano
2019-03-11 5:40 ` Martin Ågren
2019-03-11 9:24 ` Junio C Hamano
2019-03-11 9:26 ` [PATCH v3 1/3] Documentation/Makefile: add missing xsl dependencies for manpages Junio C Hamano
2019-03-11 9:26 ` [PATCH v3 2/3] Documentation/Makefile: add missing dependency on asciidoctor-extensions Junio C Hamano
2019-03-11 9:26 ` Junio C Hamano [this message]
2019-03-11 11:02 ` [PATCH 0/2] fix spurious space after linkgit, now in *.html Martin Ågren
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190311092605.259322-3-gitster@pobox.com \
--to=gitster@pobox.com \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).