Browse files

docs: monospace listings in docbook output

When asciidoc converts a listing block like:

$ git log --merge

it marks it to be displayed in a monospace font. This works
fine when generating HTML output. However, when generating
docbook output, we override the expansion of a listingblock
to work around bugs in some versions of the docbook
toolchain. Our override did not mark the listingblock with
the "monospaced" class.

The main output that uses docbook as an intermediate format
is the manpages. We didn't notice any issue there because
the monospaced class seems to be ignored when generating
roff from the docbook manpages.

However, when generating texinfo to make info pages, docbook
does respect this class. The resulting texinfo output
properly uses "@example" blocks to display the listing in
this case. Besides possibly looking prettier in some texinfo
backends,  one important effect is that the monospace font
suppresses texinfo's expansion of "--" and "---" into
en-dashes and em-dashes.  With the current code, the example
above ends up looking like "git log -merge", which is
confusing and wrong.

Signed-off-by: Jeff King <>
Signed-off-by: Junio C Hamano <>
  • Loading branch information...
1 parent 828ea97 commit c2a7f5d43843d16850a460e7f202affb0d24dc48 @peff peff committed with gitster Aug 7, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 Documentation/asciidoc.conf
  2. +1 −1 Documentation/user-manual.conf
@@ -36,7 +36,7 @@ ifndef::git-asciidoc-no-roff[]
# v1.72 breaks with this because it replaces dots not in roff requests.
+<literallayout class="monospaced">
&#10;.ft C&#10;
@@ -53,7 +53,7 @@ ifdef::doctype-manpage[]
# The following two small workarounds insert a simple paragraph after screen
+<literallayout class="monospaced">
@@ -14,7 +14,7 @@ ifdef::backend-docbook[]
# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
+<literallayout class="monospaced">

0 comments on commit c2a7f5d

Please sign in to comment.