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

Re: [PATCH] Force listingblocks to be monospaced in manpages

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2007, 23:56 UTC
Message-ID
<7vr6n55krx.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070718213725.31383.50523.julian@quantumfyre.co.uk>
Julian Phillips <julian@quantumfyre.co.uk> writes:
Show 36 quoted lines
> For the html output we can use a stylesheet to make sure that the
> listingblocks are presented in a monospaced font.  For the manpages do
> it manually by inserting a ".ft C" before and ".ft" after the block in
> question.
>
> In order for these roff commands to get through to the manpage they
> have to be element encoded to prevent quoting.
>
> Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
> ...
> How about this?
>
> Seems to work for me - but I'm not an asciidoc/docbook/roff expert ...
>
>  Documentation/asciidoc.conf |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
> index 6b6220d..d54fe29 100644
> --- a/Documentation/asciidoc.conf
> +++ b/Documentation/asciidoc.conf
> @@ -27,7 +27,13 @@ ifdef::backend-docbook[]
>  [listingblock]
>  <example><title>{title}</title>
>  <literallayout>
> +ifdef::doctype-manpage[]
> +&#10;&#x2302;ft C&#10;
> +endif::doctype-manpage[]
>  |
> +ifdef::doctype-manpage[]
> +&#10;&#x2302;ft&#10;
> +endif::doctype-manpage[]
>  </literallayout>
>  {title#}</example>
>  endif::backend-docbook[]
> -- 

I tried with your patch, both with asciidoc7 and asciidoc8. Did you really mean "&#x2302;" above? Replacing them with "." gave me a series of these changes (diff between output before and after your patch with the "s/\&#x2302;/./g" fixup):

        @@ -83,10 +83,13 @@
         .sp
         .RS 3n
         .nf
        +.ft C
             *** Commands ***
               1: status       2: update       3: revert       4: add untracked
               5: patch        6: diff         7: quit         8: help
             What now> 1
        +.ft
        +
         .fi
         .RE
         You also could say "s" or "sta" or "status" above as long as the choice is unique.

which seems reasonable, but I did not render them through roff. WIth "&#x2302;" I was getting:

        @@ -83,10 +83,14 @@
         .sp
         .RS 3n
         .nf
        +
        +	ft C
             *** Commands ***
               1: status       2: update       3: revert       4: add untracked
               5: patch        6: diff         7: quit         8: help
             What now> 1
        +	ft
        +
         .fi
         .RE
         You also could say "s" or "sta" or "status" above as long as the choice is unique.
whatever that 2302 is...
Previous: Julian PhillipsNext: Julian Phillips
Message 5 of 16 in “Manpage rendering faults”
  1. Fredrik TolfJul 18, 2007
  2. Julian PhillipsJul 18, 2007
  3. Fredrik TolfJul 18, 2007
  4. Force listingblocks to be monospaced in manpagesJulian Phillips, Jul 18, 2007
  5. Junio C HamanoJul 18, 2007
  6. Julian PhillipsJul 19, 2007
  7. Force listingblocks to be monospaced in manpagesJulian Phillips, Jul 18, 2007
  8. Junio C HamanoJul 20, 2007
  9. Julian PhillipsJul 20, 2007
  10. Update listingblock monospace fix to support all docbook versionsJulian Phillips, Jul 20, 2007
  11. Junio C HamanoJul 20, 2007
  12. Brian GernhardtJul 20, 2007
  13. Julian PhillipsJul 20, 2007
  14. Force listingblocks to be monospaced in manpagesJonas Fonseca, Jul 19, 2007
  15. Julian PhillipsJul 19, 2007
  16. Jonas FonsecaJul 19, 2007

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.