archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <>
To: Miklos Vajna <>
Cc: bill lam <>, git <>
Subject: Re: quote in help code example
Date: Tue, 13 Oct 2009 22:15:44 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

[-- Attachment #1: Type: Text/Plain, Size: 2721 bytes --]

Miklos Vajna wrote:
> On Tue, Oct 13, 2009 at 10:06:23PM +0800, bill lam <> 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 &apos; 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


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.


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"/>
 <!-- convert asciidoc callouts to man page format;
      git.docbook.backslash and params
      must be supplied by another XSL file or other means -->

Thomas Rast

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  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 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: quote in help code example' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).