git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] asciidoc: add minor workaround to add an empty line after code blocks

From
Jonas Fonseca <fonseca@diku.dk>
Date
Oct 30, 2008, 10:45 UTC
Message-ID
<20081030104503.GA17131@diku.dk>
In-Reply-To
<87od13ujm4.fsf@iki.fi>

Insert an empty <simpara> in manpages after code blocks to force and empty line.

The problem can be seen on the manpage for the git tutorial, where an example command and the following paragraph is printed with no empty line between them:

     First, note that you can get documentation for a command such as git
     log --graph with:
 
         $ man git-log             
     It is a good idea to introduce yourself to git [...]
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
 Documentation/asciidoc.conf |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
 Teemu Likonen <tlikonen@iki.fi> wrote Thu, Oct 30, 2008:
 > In case someone is interested there is still a minor flaw that an
 > example command and the following paragraph is printed with no empty
 > line between them. Like in the beginning of "git help tutorial", for
 > example:
 > 
 >     First, note that you can get documentation for a command such as git
 >     log --graph with:
 > 
 >         $ man git-log             
 >     It is a good idea to introduce yourself to git [...]
 > 
 > It would be nicer if there was empty line after "$ man git-log". I can't
 > remember if this is new issue or not. This applies only to man pages; in
 > html pages there are nice boxes around example commands and equal
 > spacing before and after them.
 This is an old issue reported by Theodore Ts'o and fixed partially in
 commit 63c97ce228f2d2697a8ed954a9592dfb5f286338 for the URL section of
 the fetch/pull/push manpages. I have fixed this in tig using an
 approach similar to the attached. Simple and clean, but only tested
 with docbook-xsl version 1.72 so I have made it conditional.
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index 40d43b7..2da867d 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -40,6 +40,26 @@ endif::doctype-manpage[]
 </literallayout>
 {title#}</example>
 endif::docbook-xsl-172[]
+
+ifdef::docbook-xsl-172[]
+ifdef::doctype-manpage[]
+# The following two small workarounds insert a simple paragraph after screen
+[listingblock]
+<example><title>{title}</title>
+<screen>
+|
+</screen><simpara></simpara>
+{title#}</example>
+
+[verseblock]
+<formalpara{id? id="{id}"}><title>{title}</title><para>
+{title%}<literallayout{id? id="{id}"}>
+{title#}<literallayout>
+|
+</literallayout><simpara></simpara>
+{title#}</para></formalpara>
+endif::doctype-manpage[]
+endif::docbook-xsl-172[]
 endif::backend-docbook[]
 
 ifdef::doctype-manpage[]
-- 
1.6.0.3.756.gb776d.dirty

-- 
Jonas Fonseca
Previous: Teemu LikonenNext: Teemu Likonen
Message 4 of 12 in “A typesetting problem with git man pages”
  1. Teemu LikonenOct 29, 2008
  2. Jonas FonsecaOct 29, 2008
  3. Teemu LikonenOct 29, 2008
  4. asciidoc: add minor workaround to add an empty line after code blocksJonas Fonseca, Oct 30, 2008
  5. Teemu LikonenOct 30, 2008
  6. Junio C HamanoNov 1, 2008
  7. Thomas AdamNov 1, 2008
  8. Kalle Olavi NiemitaloNov 3, 2008
  9. Teemu LikonenOct 31, 2008
  10. Teemu LikonenOct 31, 2008
  11. Jeff KingOct 29, 2008
  12. Jonas FonsecaOct 29, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.