From: Thomas Rast <trast@student.ethz.ch>
To: Miklos Vajna <vmiklos@frugalware.org>
Cc: bill lam <cbill.lam@gmail.com>, git <git@vger.kernel.org>
Subject: Re: quote in help code example
Date: Tue, 13 Oct 2009 22:15:44 +0200 [thread overview]
Message-ID: <200910132215.46840.trast@student.ethz.ch> (raw)
In-Reply-To: <20091013153031.GX23777@genesis.frugalware.org>
[-- Attachment #1: Type: Text/Plain, Size: 2721 bytes --]
Miklos Vajna wrote:
> On Tue, Oct 13, 2009 at 10:06:23PM +0800, bill lam <cbill.lam@gmail.com> wrote:
> > 2. now the .ft pair fixed but it still displayed incorrect quote.
> >
> > git filter-branch --tree-filter ´rm filename´ HEAD
> >
> > it should be 'rm filename' not ´rm filename´
>
> I can reproduce that here as well, that's how it is in the official
> manpages as well (see the man branch), so that's not specific to your
> system.
Same here. The patch below is a band-aid fix that works for me, but
I'd rather have it tested on various docbook/asciidoc combinations if
anyone still runs them.
My findings so far were that asciidoc correctly turns the apostrophe
into an ' entity in the .xml output, and xmlto then turns it into
\' instead of just ' in the troff output. Then, if the terminal
appears to support Unicode (this can be disabled with LC_ALL=C or
such) the formatter turns it into a "real" apostrophe that, of course,
is not understood by any ASCII-based tool.
So far so good, and sounded like an easy debugging job, right? Not
so. The buzzword-compliance people apparently felt it would be nice
to wrap a bad joke of a language in the bad joke of a language that
XML already is, and thus was XSL invented. Deep in the horrors of
these XSL files, in my case in
/usr/share/xml/docbook/stylesheet/nwalsh/1.75.2/manpages/other.xsl
there's a template that, according to the comment near it, maltreats
our apostrophes:
* The backslash, dot, dash, and apostrophe (\, ., -, ') characters
* have special meaning for roff, so before we do any other
* processing, we must escape those characters where they appear in
* the source content.
The patch below just replaces said template with a no-op for git's
manpage creation. I have not been able to substantiate the claim that
apostrophes are special, and in fact with the patch my manpages look
fine. Then again I don't know anything about roff syntax either, and
manuals seem a bit hard to come by.
Grrr.
diff --git i/Documentation/manpage-base.xsl w/Documentation/manpage-base.xsl
index a264fa6..7c14469 100644
--- i/Documentation/manpage-base.xsl
+++ w/Documentation/manpage-base.xsl
@@ -7,6 +7,11 @@
<xsl:param name="man.output.quietly" select="1"/>
<xsl:param name="refentry.meta.get.quietly" select="1"/>
+<xsl:template name="escape.apostrophe">
+ <xsl:param name="content"/>
+ <xsl:value-of select="$content"/>
+</xsl:template>
+
<!-- convert asciidoc callouts to man page format;
git.docbook.backslash and git.docbook.dot params
must be supplied by another XSL file or other means -->
--
Thomas Rast
trast@{inf,student}.ethz.ch
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-10-13 20:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 10:29 quote in help code example bill lam
2009-10-12 19:40 ` Miklos Vajna
2009-10-13 2:16 ` bill lam
2009-10-13 10:19 ` Miklos Vajna
2009-10-13 14:06 ` bill lam
2009-10-13 15:30 ` Miklos Vajna
2009-10-13 20:15 ` Thomas Rast [this message]
2009-10-15 12:02 ` Thomas Rast
2009-10-21 8:24 ` [PATCH] Quote ' as \(aq in manpages Thomas Rast
2009-10-21 10:38 ` Miklos Vajna
2009-10-21 18:01 ` Anders Kaseorg
2009-10-21 18:57 ` [PATCH v2] " Thomas Rast
2009-10-21 21:31 ` [PATCH] Document GNU_ROFF in Makefile Miklos Vajna
2009-10-21 22:22 ` Junio C Hamano
2009-10-21 22:51 ` Anders Kaseorg
2009-10-22 8:19 ` [PATCH v3] Quote ' as \(aq in manpages Thomas Rast
2009-10-21 21:42 ` [PATCH v2] " Anders Kaseorg
2009-10-12 21:06 ` quote in help code example 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=200910132215.46840.trast@student.ethz.ch \
--to=trast@student.ethz.ch \
--cc=cbill.lam@gmail.com \
--cc=git@vger.kernel.org \
--cc=vmiklos@frugalware.org \
/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).