threads / patch / 3575

patchTweak asciidoc output to work with broken docbook-xsl

Subject: [PATCH] Tweak asciidoc output to work with broken docbook-xsl

## tl;dr

3 messages between Mar 5, 2006 and Mar 6, 2006. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Francis Daly· Mar 5, 2006, 23:13 UTC · lore

docbook-xsl v1.68 incorrectly converts "<screen>" from docbook to manpage by not rendering it verbatim. v1.69 handles it correctly, but not many current popular distributions ship with it.

asciidoc by default converts "listingblock" to "<screen>". This change causes asciidoc in git to convert "listingblock" to "<literallayout>", which both old and new docbook-xsl handle correctly.

The difference can be seen in any manpage which includes a multi-line example, such as git-branch.

--- This one may want some consideration, because it involves changing how git interacts with asciidoc in order to make up for how an older version of docbook-xsl is broken. Clear?

What version of docbook-xsl are people who make git manpages using? If it's not 1.69, the manpages (at least, those with multi-line examples) display incorrectly. Many current popular distributions seem to be using version 1.68.

http://www.kernel.org/pub/software/scm/git/RPMS/x86_64/git-core-1.2.4-1.x86_64.rpm
ftp://ftp.kddlabs.co.jp/pub/Linux/packages/fedora/extras/4/i386/git-core-1.2.4-1.fc4.i386.rpm
(found on pbone, with "redhat/" removed from url; for Fedora 4)
The 1.2.1 packages linked from http://packages.debian.org/unstable/devel/git-core
all show the errors.
ftp://ftp.kddlabs.co.jp/pub/Linux/packages/fedora/extras/development/i386/git-core-1.2.4-1.fc5.i386.rpm

(found on pbone, with "redhat/" removed from the url; for Fedora Other, presumably 5)

is correct.

Clearly the *right* solution is for binary builders to update their toolchains. Maybe leaving this as-is will be an impetus for them to do so.

Below is a not-right workaround which allows the git manpages render correctly when built by someone with an old docbook-xsl package.

If this is acceptable, all well and good. If not, I'll contact the package builders and invite them to upgrade or patch before building new packages.

 Documentation/asciidoc.conf |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
1885a1ac69eabd6fa882f4464d3c66303d707566
Show changes to Documentation/asciidoc.conf +7 −0
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index fa0877d..37e9ada 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -23,4 +23,11 @@ ifdef::backend-xhtml11[]
 <a href="{target}.html">{target}{0?({0})}</a>
 endif::backend-xhtml11[]
 
+# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
+[listingblock]
+<example><title>{title}</title>
+<literallayout>
+|
+</literallayout>
+{title#}</example>
 
-- 
1.2.GIT

-- 
Francis Daly        francis@daoine.org
Junio C Hamano· Mar 6, 2006, 00:53 UTC · re: Francis Daly · lore

Re: [PATCH] Tweak asciidoc output to work with broken docbook-xsl

Francis Daly <francis@daoine.org> writes:
Show 7 quoted lines
> docbook-xsl v1.68 incorrectly converts "<screen>" from docbook to
> manpage by not rendering it verbatim. v1.69 handles it correctly, but
> not many current popular distributions ship with it.
>
> asciidoc by default converts "listingblock" to "<screen>". This change
> causes asciidoc in git to convert "listingblock" to "<literallayout>", which
> both old and new docbook-xsl handle correctly.

Have you tested html generation side? With 1.68 I seem to be getting an disaster.

How about this instead?
---
Show changes to Documentation/asciidoc.conf +10 −0
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index fa0877d..7ce7151 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -18,6 +18,16 @@ ifdef::backend-docbook[]
 {0#</citerefentry>}
 endif::backend-docbook[]
 
+ifdef::backend-docbook[]
+# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
+[listingblock]
+<example><title>{title}</title>
+<literallayout>
+|
+</literallayout>
+{title#}</example>
+endif::backend-docbook[]
+
 ifdef::backend-xhtml11[]
 [gitlink-inlinemacro]
 <a href="{target}.html">{target}{0?({0})}</a>
Francis Daly· Mar 6, 2006, 01:09 UTC · re: Junio C Hamano · lore

Re: [PATCH] Tweak asciidoc output to work with broken docbook-xsl

On Sun, Mar 05, 2006 at 04:53:11PM -0800, Junio C Hamano wrote:
> Francis Daly <francis@daoine.org> writes:
Show 6 quoted lines
> > asciidoc by default converts "listingblock" to "<screen>". This change
> > causes asciidoc in git to convert "listingblock" to "<literallayout>", which
> > both old and new docbook-xsl handle correctly.
> 
> Have you tested html generation side?  With 1.68 I seem to be
> getting an disaster.
Oh how stupid of me.
Yes, of course you're right.  The backend matters.

Clearly, I don't read the html pages; and no-one (with old stylesheets) reads the man pages ;-)

Thanks,
	f
-- 
Francis Daly        francis@daoine.org

← back to recent threads