{"thread":{"id":"9097","subject":"Manpage rendering faults","startedAt":"2007-07-18T18:47:37Z","lastAt":"2007-07-20T22:14:07Z","messageCount":16,"participants":["Fredrik Tolf","Julian Phillips","Junio C Hamano","Jonas Fonseca","Brian Gernhardt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47763","messageId":"m3odi9im5y.fsf@pc7.dolda2000.com","threadId":"9097","inReplyTo":null,"subject":"Manpage rendering faults","fromName":"Fredrik Tolf","fromEmail":"fredrik@dolda2000.com","sentAt":"2007-07-18T18:47:37Z","receivedAt":"2007-07-18T18:47:37Z","isPatch":false,"sender":{"key":"fredrik@dolda2000.com","avatar":null},"body":"I often read manpages using a `man -t whatever | ggv -' command, since\nI like how it is rendered in PostScript. However, it turns out that\nsome things in the Git manpages don't really render very well using\nthat method. For example, in the git-rebase manpage, there are two\nhistory graphs that look like this when reading the manpages normally\nin a terminal:\n\n      A---B---C topic\n     /\nD---E---F---G master\n\nand then\n\n              A'--B'--C' topic\n             /\nD---E---F---G master\n\nHowever, in the PostScript rendering, they look rather like this:\n\n  A---B---C topic\n /\nD---E---F---G master\n\nand then\n\n      A'--B'--C' topic\n     /\nD---E---F---G master\n\nIt took me quite a while to figure out that the rendering was\nwrong. Before that, I just couldn't figure out why git-rebase would do\nthat. :)\n\nUnfortunately, I can't say that I have a fix available -- particularly\nas I don't really know anything at all about asciidoc. I thought I'd\nat least let you know, though.\n\nFredrik Tolf\n"},{"id":"47765","messageId":"Pine.LNX.4.64.0707182024440.734@reaper.quantumfyre.co.uk","threadId":"9097","inReplyTo":"m3odi9im5y.fsf@pc7.dolda2000.com","subject":"Re: Manpage rendering faults","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-18T19:29:48Z","receivedAt":"2007-07-18T19:29:48Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Wed, 18 Jul 2007, Fredrik Tolf wrote:\n\n> I often read manpages using a `man -t whatever | ggv -' command, since\n> I like how it is rendered in PostScript. However, it turns out that\n> some things in the Git manpages don't really render very well using\n> that method. For example, in the git-rebase manpage, there are two\n> history graphs that look like this when reading the manpages normally\n> in a terminal:\n\nIt's a proportional font issue ...\n\nRunning \"groff -Tps -f C -man $(man -w git-rebase) | ggv -\" should display \nit correctly.  (The \"-f C\" being the part the man doesn't do)\n\nNo idea how to make it use that font by default though ... not even sure \nif you can put that kind of information into a man page?\n\n-- \nJulian\n\n  ---\nDinner suggestion #302 (Hacker's De-lite):\n \t1 tin imported Brisling sardines in tomato sauce\n \t1 pouch Chocolate Malt Carnation Instant Breakfast\n \t1 carton milk\n"},{"id":"47767","messageId":"m3k5sxiiib.fsf@pc7.dolda2000.com","threadId":"9097","inReplyTo":"Pine.LNX.4.64.0707182024440.734@reaper.quantumfyre.co.uk","subject":"Re: Manpage rendering faults","fromName":"Fredrik Tolf","fromEmail":"fredrik@dolda2000.com","sentAt":"2007-07-18T20:06:36Z","receivedAt":"2007-07-18T20:06:36Z","isPatch":false,"sender":{"key":"fredrik@dolda2000.com","avatar":null},"body":"Julian Phillips <julian@quantumfyre.co.uk> writes:\n\n> On Wed, 18 Jul 2007, Fredrik Tolf wrote:\n>\n>> I often read manpages using a `man -t whatever | ggv -' command, since\n>> I like how it is rendered in PostScript. However, it turns out that\n>> some things in the Git manpages don't really render very well using\n>> that method. For example, in the git-rebase manpage, there are two\n>> history graphs that look like this when reading the manpages normally\n>> in a terminal:\n>\n> It's a proportional font issue ...\n>\n> Running \"groff -Tps -f C -man $(man -w git-rebase) | ggv -\" should\n> display it correctly.  (The \"-f C\" being the part the man doesn't do)\n>\n> No idea how to make it use that font by default though ... not even\n> sure if you can put that kind of information into a man page?\n\nWell, if it were a \"pure\" manpage, I'd try to use pic(1) to do it for\nthe PS version, but I don't suspect asciidoc has a similar feature. I\ndon't actually know, though -- again, I know virtually nothing about\nasciidoc.\n\nFredrik Tolf\n"},{"id":"47774","messageId":"20070718213725.31383.50523.julian@quantumfyre.co.uk","threadId":"9097","inReplyTo":"m3k5sxiiib.fsf@pc7.dolda2000.com","subject":"[PATCH] Force listingblocks to be monospaced in manpages","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-18T21:33:57Z","receivedAt":"2007-07-18T21:33:57Z","isPatch":true,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"For the html output we can use a stylesheet to make sure that the\nlistingblocks are presented in a monospaced font.  For the manpages do\nit manually by inserting a \".ft C\" before and \".ft\" after the block in\nquestion.\n\nIn order for these roff commands to get through to the manpage they\nhave to be element encoded to prevent quoting.\n\nSigned-off-by: Julian Phillips <julian@quantumfyre.co.uk>\n---\n\nOn Wed, 18 Jul 2007, Fredrik Tolf wrote:\n\n> Julian Phillips <julian@quantumfyre.co.uk> writes:\n>\n>> On Wed, 18 Jul 2007, Fredrik Tolf wrote:\n>>\n>>> I often read manpages using a `man -t whatever | ggv -' command, since\n>>> I like how it is rendered in PostScript. However, it turns out that\n>>> some things in the Git manpages don't really render very well using\n>>> that method. For example, in the git-rebase manpage, there are two\n>>> history graphs that look like this when reading the manpages normally\n>>> in a terminal:\n>>\n>> It's a proportional font issue ...\n>>\n>> Running \"groff -Tps -f C -man $(man -w git-rebase) | ggv -\" should\n>> display it correctly.  (The \"-f C\" being the part the man doesn't do)\n>>\n>> No idea how to make it use that font by default though ... not even\n>> sure if you can put that kind of information into a man page?\n>\n> Well, if it were a \"pure\" manpage, I'd try to use pic(1) to do it for\n> the PS version, but I don't suspect asciidoc has a similar feature. I\n> don't actually know, though -- again, I know virtually nothing about\n> asciidoc.\n\nHow about this?\n\nSeems to work for me - but I'm not an asciidoc/docbook/roff expert ...\n\n Documentation/asciidoc.conf |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf\nindex 6b6220d..d54fe29 100644\n--- a/Documentation/asciidoc.conf\n+++ b/Documentation/asciidoc.conf\n@@ -27,7 +27,13 @@ ifdef::backend-docbook[]\n [listingblock]\n <example><title>{title}</title>\n <literallayout>\n+ifdef::doctype-manpage[]\n+&#10;&#x2302;ft C&#10;\n+endif::doctype-manpage[]\n |\n+ifdef::doctype-manpage[]\n+&#10;&#x2302;ft&#10;\n+endif::doctype-manpage[]\n </literallayout>\n {title#}</example>\n endif::backend-docbook[]\n-- \n1.5.2.2\n"},{"id":"47795","messageId":"20070719014852.4573.65336.julian@quantumfyre.co.uk","threadId":"9097","inReplyTo":"Pine.LNX.4.64.0707190157430.1964@beast.quantumfyre.co.uk","subject":"[PATCH] Force listingblocks to be monospaced in manpages","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-18T21:33:57Z","receivedAt":"2007-07-18T21:33:57Z","isPatch":true,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"For the html output we can use a stylesheet to make sure that the\nlistingblocks are presented in a monospaced font.  For the manpages do\nit manually by inserting a \".ft C\" before and \".ft\" after the block in\nquestion.  This makes the ascii-art diagrams readable in PS output.\n\nIn order for these roff commands to get through to the manpage they\nhave to be element encoded to prevent quoting.  In particular with\ndocbook xsl 1.72.0 and newer we have to use U+2302 instead of . to\nprevent the roff command being escaped.  We also add a small perl\nscript for docbook < 1.72.0.\n\nSigned-off-by: Julian Phillips <julian@quantumfyre.co.uk>\n---\n\nOn Thu, 19 Jul 2007, Julian Phillips wrote:\n\n> On Wed, 18 Jul 2007, Junio C Hamano wrote:\n>\n>>  I tried with your patch, both with asciidoc7 and asciidoc8.  Did\n>>  you really mean \"&#x2302;\" above?  Replacing them with \".\"  gave\n>>  me a series of these changes (diff between output before and\n>>  after your patch with the \"s/\\&#x2302;/./g\" fixup):\n>\n> I did mean it.  I originally just had .ft, but I was getting \\&.ft in the\n> manpage, which then just came out as .ft in the console.\n>\n> I got the &#x2302; from\n> http://docbook.sourceforge.net/release/xsl/current/manpages/utility.xsl, so I\n> assumed it was the \"correct\" thing to use ...\n>\n> This was with asciidoc 7 and docbook xsl stylesheet 1.72.0.\n>\n>\n>>  whatever that 2302 is...\n>\n> &#x2302; (or U+2302) seems to be a character from the unicode \"Misc.\n> Technical\" section ... looks a bit like a house.\n>\n> See sixth bullet from\n> http://docbook.sourceforge.net/release/xsl/current/RELEASE-NOTES.html#V1.72.0$\n>\n> looks like it may need to depend on which docbook xsl version you are using\n> ...\n>\n>\n\nI couldn't find any way to detect the docbook version - perhaps someone more\nwith more knowledge of asciidoc might know?\n\nOtherwise, something like this perhaps?\n\n Documentation/Makefile          |    3 +++\n Documentation/asciidoc.conf     |    6 ++++++\n Documentation/replace_U+2303.pl |    6 ++++++\n 3 files changed, 15 insertions(+), 0 deletions(-)\n create mode 100755 Documentation/replace_U+2303.pl\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex b062757..e381b2e 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -121,6 +121,9 @@ clean:\n \n %.1 %.5 %.7 : %.xml\n \txmlto -m callouts.xsl man $<\n+\tmv $@ $@.tmp\n+\t./replace_U+2303.pl < $@.tmp > $@\n+\t$(RM) $@.tmp\n \n %.xml : %.txt\n \t$(RM) $@+ $@\ndiff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf\nindex 6b6220d..d54fe29 100644\n--- a/Documentation/asciidoc.conf\n+++ b/Documentation/asciidoc.conf\n@@ -27,7 +27,13 @@ ifdef::backend-docbook[]\n [listingblock]\n <example><title>{title}</title>\n <literallayout>\n+ifdef::doctype-manpage[]\n+&#10;&#x2302;ft C&#10;\n+endif::doctype-manpage[]\n |\n+ifdef::doctype-manpage[]\n+&#10;&#x2302;ft&#10;\n+endif::doctype-manpage[]\n </literallayout>\n {title#}</example>\n endif::backend-docbook[]\ndiff --git a/Documentation/replace_U+2303.pl b/Documentation/replace_U+2303.pl\nnew file mode 100755\nindex 0000000..b086949\n--- /dev/null\n+++ b/Documentation/replace_U+2303.pl\n@@ -0,0 +1,6 @@\n+#!/usr/bin/perl -w\n+\n+while ($line = <>) {\n+\t$line =~ s/^\\x{2302}/./;\n+\tprint $line;\n+}\n-- \n1.5.2.2\n"},{"id":"47786","messageId":"7vr6n55krx.fsf@assigned-by-dhcp.cox.net","threadId":"9097","inReplyTo":"20070718213725.31383.50523.julian@quantumfyre.co.uk","subject":"Re: [PATCH] Force listingblocks to be monospaced in manpages","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-18T23:56:02Z","receivedAt":"2007-07-18T23:56:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Julian Phillips <julian@quantumfyre.co.uk> writes:\n\n> For the html output we can use a stylesheet to make sure that the\n> listingblocks are presented in a monospaced font.  For the manpages do\n> it manually by inserting a \".ft C\" before and \".ft\" after the block in\n> question.\n>\n> In order for these roff commands to get through to the manpage they\n> have to be element encoded to prevent quoting.\n>\n> Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>\n> ...\n> How about this?\n>\n> Seems to work for me - but I'm not an asciidoc/docbook/roff expert ...\n>\n>  Documentation/asciidoc.conf |    6 ++++++\n>  1 files changed, 6 insertions(+), 0 deletions(-)\n>\n> diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf\n> index 6b6220d..d54fe29 100644\n> --- a/Documentation/asciidoc.conf\n> +++ b/Documentation/asciidoc.conf\n> @@ -27,7 +27,13 @@ ifdef::backend-docbook[]\n>  [listingblock]\n>  <example><title>{title}</title>\n>  <literallayout>\n> +ifdef::doctype-manpage[]\n> +&#10;&#x2302;ft C&#10;\n> +endif::doctype-manpage[]\n>  |\n> +ifdef::doctype-manpage[]\n> +&#10;&#x2302;ft&#10;\n> +endif::doctype-manpage[]\n>  </literallayout>\n>  {title#}</example>\n>  endif::backend-docbook[]\n> -- \n\nI tried with your patch, both with asciidoc7 and asciidoc8.  Did\nyou really mean \"&#x2302;\" above?  Replacing them with \".\"  gave\nme a series of these changes (diff between output before and\nafter your patch with the \"s/\\&#x2302;/./g\" fixup):\n\n        @@ -83,10 +83,13 @@\n         .sp\n         .RS 3n\n         .nf\n        +.ft C\n             *** Commands ***\n               1: status       2: update       3: revert       4: add untracked\n               5: patch        6: diff         7: quit         8: help\n             What now> 1\n        +.ft\n        +\n         .fi\n         .RE\n         You also could say \"s\" or \"sta\" or \"status\" above as long as the choice is unique.\n\nwhich seems reasonable, but I did not render them through roff.\nWIth \"&#x2302;\" I was getting:\n\n        @@ -83,10 +83,14 @@\n         .sp\n         .RS 3n\n         .nf\n        +\n        +\tft C\n             *** Commands ***\n               1: status       2: update       3: revert       4: add untracked\n               5: patch        6: diff         7: quit         8: help\n             What now> 1\n        +\tft\n        +\n         .fi\n         .RE\n         You also could say \"s\" or \"sta\" or \"status\" above as long as the choice is unique.\n\nwhatever that 2302 is...\n"},{"id":"47793","messageId":"Pine.LNX.4.64.0707190157430.1964@beast.quantumfyre.co.uk","threadId":"9097","inReplyTo":"7vr6n55krx.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Force listingblocks to be monospaced in manpages","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-19T01:21:49Z","receivedAt":"2007-07-19T01:21:49Z","isPatch":true,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Wed, 18 Jul 2007, Junio C Hamano wrote:\n\n> I tried with your patch, both with asciidoc7 and asciidoc8.  Did\n> you really mean \"&#x2302;\" above?  Replacing them with \".\"  gave\n> me a series of these changes (diff between output before and\n> after your patch with the \"s/\\&#x2302;/./g\" fixup):\n\nI did mean it.  I originally just had .ft, but I was getting \\&.ft in the \nmanpage, which then just came out as .ft in the console.\n\nI got the &#x2302; from \nhttp://docbook.sourceforge.net/release/xsl/current/manpages/utility.xsl, \nso I assumed it was the \"correct\" thing to use ...\n\nThis was with asciidoc 7 and docbook xsl stylesheet 1.72.0.\n\n\n> whatever that 2302 is...\n\n&#x2302; (or U+2302) seems to be a character from the unicode \"Misc. \nTechnical\" section ... looks a bit like a house.\n\nSee sixth bullet from \nhttp://docbook.sourceforge.net/release/xsl/current/RELEASE-NOTES.html#V1.72.0_Manpages\n\nlooks like it may need to depend on which docbook xsl version you are \nusing ...\n\n-- \nJulian\n\n  ---\nThe only way to amuse some people is to slip and fall on an icy pavement.\n"},{"id":"47844","messageId":"20070719113743.GA27553@diku.dk","threadId":"9097","inReplyTo":"Pine.LNX.4.64.0707190157430.1964@beast.quantumfyre.co.uk","subject":"[PATCH] Force listingblocks to be monospaced in manpages","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2007-07-19T11:37:43Z","receivedAt":"2007-07-19T11:37:43Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"For the html output we can use a stylesheet to make sure that the\nlistingblocks are presented in a monospaced font.  For the manpages do\nit manually by inserting a \".ft C\" before and \".ft\" after the block in\nquestion.\n\nIn addition, also add an empty line after all verbatim blocks.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n\n  Julian Phillips <julian@quantumfyre.co.uk> wrote Thu, Jul 19, 2007:\n  > On Wed, 18 Jul 2007, Junio C Hamano wrote:\n  > \n  > >I tried with your patch, both with asciidoc7 and asciidoc8.  Did\n  > >you really mean \"&#x2302;\" above?  Replacing them with \".\"  gave\n  > >me a series of these changes (diff between output before and\n  > >after your patch with the \"s/\\&#x2302;/./g\" fixup):\n  > \n  > I did mean it.  I originally just had .ft, but I was getting \\&.ft in the \n  > manpage, which then just came out as .ft in the console.\n  \n  This is because AsciiDoc does the escaping. I think it would be cleaner\n  to do this thing when converting from DocBook to roff like we already\n  do for other things.\n\n  While fixing the above, a fix for separating verbatim blocks from any\n  following blocks is easy to apply.\n\ndiff --git a/Documentation/callouts.xsl b/Documentation/callouts.xsl\nindex 6a361a2..44ab77d 100644\n--- a/Documentation/callouts.xsl\n+++ b/Documentation/callouts.xsl\n@@ -27,4 +27,93 @@\n   </xsl:if>\n </xsl:template>\n \n+<!-- * Yes, address, synopsis, and funcsynopsisinfo are verbatim environments. -->\n+<xsl:template match=\"literallayout|programlisting|screen|\n+                     address|synopsis|funcsynopsisinfo\">\n+  <xsl:param name=\"indent\">\n+    <!-- * Only indent this verbatim if $man.indent.verbatims is -->\n+    <!-- * non-zero and it is not a child of a *synopsis element -->\n+    <xsl:if test=\"not($man.indent.verbatims = 0) and\n+                  not(substring(local-name(..),\n+                  string-length(local-name(..))-7) = 'synopsis')\">\n+      <xsl:text>Yes</xsl:text>\n+    </xsl:if>\n+  </xsl:param>\n+\n+  <xsl:choose>\n+    <!-- * Check to see if this verbatim item is within a parent element that -->\n+    <!-- * allows mixed content. -->\n+    <!-- * -->\n+    <!-- * If it is within a mixed-content parent, then a line space is -->\n+    <!-- * already added before it by the mixed-block template, so we don't -->\n+    <!-- * need to add one here. -->\n+    <!-- * -->\n+    <!-- * If it is not within a mixed-content parent, then we need to add a -->\n+    <!-- * line space before it. -->\n+    <xsl:when test=\"parent::caption|parent::entry|parent::para|\n+                    parent::td|parent::th\" /> <!-- do nothing -->\n+    <xsl:otherwise>\n+      <xsl:text>&#10;</xsl:text>\n+      <xsl:text>.sp&#10;</xsl:text>\n+    </xsl:otherwise>\n+  </xsl:choose>\n+  <xsl:if test=\"$indent = 'Yes'\">\n+    <!-- * start indented section -->\n+    <xsl:text>.RS</xsl:text>\n+    <xsl:if test=\"not($man.indent.width = '')\">\n+      <xsl:text> </xsl:text>\n+      <xsl:value-of select=\"$man.indent.width\"/>\n+    </xsl:if>\n+    <xsl:text>&#10;</xsl:text>\n+  </xsl:if>\n+  <xsl:choose>\n+    <xsl:when test=\"self::funcsynopsisinfo\">\n+      <!-- * All Funcsynopsisinfo content is by default rendered in bold, -->\n+      <!-- * because the man(7) man page says this: -->\n+      <!-- * -->\n+      <!-- *   For functions, the arguments are always specified using -->\n+      <!-- *   italics, even in the SYNOPSIS section, where the rest of -->\n+      <!-- *   the function is specified in bold -->\n+      <!-- * -->\n+      <!-- * Look through the contents of the man/man2 and man3 directories -->\n+      <!-- * on your system, and you'll see that most existing pages do follow -->\n+      <!-- * this \"bold everything in function synopsis\" rule. -->\n+      <!-- * -->\n+      <!-- * Users who don't want the bold output can choose to adjust the -->\n+      <!-- * man.font.funcsynopsisinfo parameter on their own. So even if you -->\n+      <!-- * don't personally like the way it looks, please don't change the -->\n+      <!-- * default to be non-bold - because it's a convention that's -->\n+      <!-- * followed is the vast majority of existing man pages that document -->\n+      <!-- * functions, and we need to follow it by default, like it or no. -->\n+      <xsl:text>.ft </xsl:text>\n+      <xsl:value-of select=\"$man.font.funcsynopsisinfo\"/>\n+      <xsl:text>&#10;</xsl:text>\n+      <xsl:text>.nf&#10;</xsl:text>\n+      <xsl:apply-templates/>\n+      <xsl:text>&#10;</xsl:text>\n+      <xsl:text>.fi&#10;</xsl:text>\n+      <xsl:text>.ft&#10;</xsl:text>\n+    </xsl:when>\n+    <xsl:otherwise>\n+      <!-- * Other verbatims do not need to get bolded -->\n+      <xsl:text>.nf&#10;</xsl:text>\n+      <xsl:text>.ft C&#10;</xsl:text>\n+      <xsl:apply-templates/>\n+      <xsl:text>&#10;</xsl:text>\n+      <xsl:text>.ft&#10;</xsl:text>\n+      <xsl:text>&#10;</xsl:text>\n+      <xsl:text>&#10;.fi&#10;</xsl:text>\n+    </xsl:otherwise>\n+  </xsl:choose>\n+  <xsl:if test=\"$indent = 'Yes'\">\n+    <!-- * end indented section -->\n+    <xsl:text>.RE&#10;</xsl:text>\n+  </xsl:if>\n+  <!-- * if first following sibling node of this verbatim -->\n+  <!-- * environment is a text node, output a line of space before it -->\n+  <xsl:if test=\"following-sibling::node()[1][name(.) = '']\">\n+    <xsl:text>.sp&#10;</xsl:text>\n+  </xsl:if>\n+</xsl:template>\n+\n </xsl:stylesheet>\n-- \nJonas Fonseca\n"},{"id":"47846","messageId":"Pine.LNX.4.64.0707191239050.32611@reaper.quantumfyre.co.uk","threadId":"9097","inReplyTo":"20070719113743.GA27553@diku.dk","subject":"Re: [PATCH] Force listingblocks to be monospaced in manpages","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-19T11:44:05Z","receivedAt":"2007-07-19T11:44:05Z","isPatch":true,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Thu, 19 Jul 2007, Jonas Fonseca wrote:\n\n> For the html output we can use a stylesheet to make sure that the\n> listingblocks are presented in a monospaced font.  For the manpages do\n> it manually by inserting a \".ft C\" before and \".ft\" after the block in\n> question.\n>\n> In addition, also add an empty line after all verbatim blocks.\n>\n> Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n> ---\n>\n>  Julian Phillips <julian@quantumfyre.co.uk> wrote Thu, Jul 19, 2007:\n>  > On Wed, 18 Jul 2007, Junio C Hamano wrote:\n>  >\n>  > >I tried with your patch, both with asciidoc7 and asciidoc8.  Did\n>  > >you really mean \"&#x2302;\" above?  Replacing them with \".\"  gave\n>  > >me a series of these changes (diff between output before and\n>  > >after your patch with the \"s/\\&#x2302;/./g\" fixup):\n>  >\n>  > I did mean it.  I originally just had .ft, but I was getting \\&.ft in the\n>  > manpage, which then just came out as .ft in the console.\n>\n>  This is because AsciiDoc does the escaping. I think it would be cleaner\n>  to do this thing when converting from DocBook to roff like we already\n>  do for other things.\n\nNo.  Docbook does the escaping (as it says here: \nhttp://docbook.sourceforge.net/release/xsl/current/RELEASE-NOTES.html#V1.72.0\n).  I tried your approach first, but 1) I idn't want to copy that much \nfrom the docbook xsl, as then we won't get updates/changes/fixes etc, 2) I \nstill had to use &#x2302; _anyway_.\n\nJust compare the chunk that you have copied from the docbook xsl to the \nversion from 1.72.0 and you will find that all the '.'s have become \n&#x2302;s ...\n\n-- \nJulian\n\n  ---\n\"It's when they say 2 + 2 = 5 that I begin to argue.\"\n-- Eric Pepke\n"},{"id":"47854","messageId":"20070719122541.GA28414@diku.dk","threadId":"9097","inReplyTo":"Pine.LNX.4.64.0707191239050.32611@reaper.quantumfyre.co.uk","subject":"Re: [PATCH] Force listingblocks to be monospaced in manpages","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2007-07-19T12:25:41Z","receivedAt":"2007-07-19T12:25:41Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Julian Phillips <julian@quantumfyre.co.uk> wrote Thu, Jul 19, 2007:\n> On Thu, 19 Jul 2007, Jonas Fonseca wrote:\n> > This is because AsciiDoc does the escaping. I think it would be cleaner\n> > to do this thing when converting from DocBook to roff like we already\n> > do for other things.\n> \n> No.  Docbook does the escaping (as it says here: \n> http://docbook.sourceforge.net/release/xsl/current/RELEASE-NOTES.html#V1.72.0\n> ).\n\nOops, yes, you are right.\n\n> I tried your approach first, but 1) I idn't want to copy that much \n> from the docbook xsl, as then we won't get updates/changes/fixes etc, 2) I \n> still had to use &#x2302; _anyway_.\n\nOK, I didn't think you tried it. Nevermind then.\n\n-- \nJonas Fonseca\n"},{"id":"47935","messageId":"7v3azj1rva.fsf@assigned-by-dhcp.cox.net","threadId":"9097","inReplyTo":"20070719014852.4573.65336.julian@quantumfyre.co.uk","subject":"Re: [PATCH] Force listingblocks to be monospaced in manpages","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-20T07:00:57Z","receivedAt":"2007-07-20T07:00:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Julian Phillips <julian@quantumfyre.co.uk> writes:\n\n> In order for these roff commands to get through to the manpage they\n> have to be element encoded to prevent quoting.  In particular with\n> docbook xsl 1.72.0 and newer we have to use U+2302 instead of . to\n> prevent the roff command being escaped.  We also add a small perl\n> script for docbook < 1.72.0.\n\nThis does not work at all for docbook 1.71.  I get \"^<TAB>ft C\"\nas output from xmlto.\n"},{"id":"47937","messageId":"Pine.LNX.4.64.0707200806540.20056@beast.quantumfyre.co.uk","threadId":"9097","inReplyTo":"7v3azj1rva.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Force listingblocks to be monospaced in manpages","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-20T07:09:49Z","receivedAt":"2007-07-20T07:09:49Z","isPatch":true,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Fri, 20 Jul 2007, Junio C Hamano wrote:\n\n> Julian Phillips <julian@quantumfyre.co.uk> writes:\n>\n>> In order for these roff commands to get through to the manpage they\n>> have to be element encoded to prevent quoting.  In particular with\n>> docbook xsl 1.72.0 and newer we have to use U+2302 instead of . to\n>> prevent the roff command being escaped.  We also add a small perl\n>> script for docbook < 1.72.0.\n>\n> This does not work at all for docbook 1.71.  I get \"^<TAB>ft C\"\n> as output from xmlto.\n\nOh, well ... that's handy? :S\n\nI've just checked, and I do have a machine with docbook < 1.72, so I'll \nsee if I can get something working on both.  Probably early next week \nsince I'm away this weekend.\n\n-- \nJulian\n\n  ---\nWords are the voice of the heart.\n"},{"id":"47960","messageId":"20070720121153.23352.73276.julian@quantumfyre.co.uk","threadId":"9097","inReplyTo":"Pine.LNX.4.64.0707200806540.20056@beast.quantumfyre.co.uk","subject":"[PATCH] Update listingblock monospace fix to support all docbook versions","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-20T12:06:21Z","receivedAt":"2007-07-20T12:06:21Z","isPatch":true,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"The previous fix to force the listingblock to be monospaced would not\nwork for docbook versions 1.72 or newer, as they now escape leading\n'.'s and you have to use U+2302 instead.  However you can't use U+2302\nin ealier versions ...\n\nSo this uses the string '#GIT#SET#MAN#FONT#', and then changes that to\n.ft using a post-process perl script.\n\nNot pretty, but it works.\n\nSigned-off-by: Julian Phillips <julian@quantumfyre.co.uk>\n---\n\nOn Fri, 20 Jul 2007, Julian Phillips wrote:\n\n> On Fri, 20 Jul 2007, Junio C Hamano wrote:\n>\n>>  Julian Phillips <julian@quantumfyre.co.uk> writes:\n>>\n>> >  In order for these roff commands to get through to the manpage they\n>> >  have to be element encoded to prevent quoting.  In particular with\n>> >  docbook xsl 1.72.0 and newer we have to use U+2302 instead of . to\n>> >  prevent the roff command being escaped.  We also add a small perl\n>> >  script for docbook < 1.72.0.\n>>\n>>  This does not work at all for docbook 1.71.  I get \"^<TAB>ft C\"\n>>  as output from xmlto.\n>\n> Oh, well ... that's handy? :S\n>\n> I've just checked, and I do have a machine with docbook < 1.72, so I'll see\n> if I can get something working on both.  Probably early next week since I'm\n> away this weekend.\n\nThis works ... but I'm not particularly proud of it.\n\nI've done this a patch ontop of master, since you seem to have already pushed\nout the tweaked version of my original patch.\n\n Documentation/Makefile                    |    3 +++\n Documentation/asciidoc.conf               |    4 ++--\n Documentation/insert_man_font_commands.pl |    6 ++++++\n 3 files changed, 11 insertions(+), 2 deletions(-)\n create mode 100755 Documentation/insert_man_font_commands.pl\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex b062757..70f4b44 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -121,6 +121,9 @@ clean:\n \n %.1 %.5 %.7 : %.xml\n \txmlto -m callouts.xsl man $<\n+\tmv $@ $@.tmp\n+\t./insert_man_font_commands.pl < $@.tmp > $@\n+\t$(RM) $@.tmp\n \n %.xml : %.txt\n \t$(RM) $@+ $@\ndiff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf\nindex af5b155..83fa03f 100644\n--- a/Documentation/asciidoc.conf\n+++ b/Documentation/asciidoc.conf\n@@ -28,11 +28,11 @@ ifdef::backend-docbook[]\n <example><title>{title}</title>\n <literallayout>\n ifdef::doctype-manpage[]\n-&#10;.ft C&#10;\n+&#10;#GIT#SET#MAN#FONT# C&#10;\n endif::doctype-manpage[]\n |\n ifdef::doctype-manpage[]\n-&#10;.ft&#10;\n+&#10;#GIT#SET#MAN#FONT#&#10;\n endif::doctype-manpage[]\n </literallayout>\n {title#}</example>\ndiff --git a/Documentation/insert_man_font_commands.pl b/Documentation/insert_man_font_commands.pl\nnew file mode 100755\nindex 0000000..c100534\n--- /dev/null\n+++ b/Documentation/insert_man_font_commands.pl\n@@ -0,0 +1,6 @@\n+#!/usr/bin/perl -w\n+\n+while ($line = <>) {\n+\t$line =~ s/^#GIT#SET#MAN#FONT#/.ft/;\n+\tprint $line;\n+}\n-- \n1.5.2.2\n"},{"id":"47971","messageId":"7vfy3jxbzs.fsf@assigned-by-dhcp.cox.net","threadId":"9097","inReplyTo":"20070720121153.23352.73276.julian@quantumfyre.co.uk","subject":"Re: [PATCH] Update listingblock monospace fix to support all docbook versions","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-20T16:42:47Z","receivedAt":"2007-07-20T16:42:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Julian Phillips <julian@quantumfyre.co.uk> writes:\n\n> So this uses the string '#GIT#SET#MAN#FONT#', and then changes that to\n> .ft using a post-process perl script.\n>\n> Not pretty, but it works.\n\nOwwwww... pain.\n\nUnless anybody else has better fix I'd say we go with this.\n\nThanks.\n"},{"id":"47991","messageId":"3A4230BE-5F05-4AE9-AAB3-3B66C30DEF76@silverinsanity.com","threadId":"9097","inReplyTo":"20070720121153.23352.73276.julian@quantumfyre.co.uk","subject":"Re: [PATCH] Update listingblock monospace fix to support all docbook versions","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-07-20T19:32:38Z","receivedAt":"2007-07-20T19:32:38Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Jul 20, 2007, at 8:06 AM, Julian Phillips wrote:\n\n> +while ($line = <>) {\n> +\t$line =~ s/^#GIT#SET#MAN#FONT#/.ft/;\n> +\tprint $line;\n> +}\n\nWhy not use `perl -pe \"s/^#GIT#SET#MAN#FONT#/.ft/\"` or an equivalent  \nsed command in the Makefile instead of having this as a separate script?\n\n~~ Brian\n"},{"id":"47996","messageId":"Pine.LNX.4.64.0707202309220.16498@reaper.quantumfyre.co.uk","threadId":"9097","inReplyTo":"3A4230BE-5F05-4AE9-AAB3-3B66C30DEF76@silverinsanity.com","subject":"Re: [PATCH] Update listingblock monospace fix to support all docbook versions","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-20T22:14:07Z","receivedAt":"2007-07-20T22:14:07Z","isPatch":true,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Fri, 20 Jul 2007, Brian Gernhardt wrote:\n\n>\n> On Jul 20, 2007, at 8:06 AM, Julian Phillips wrote:\n>\n>> +while ($line = <>) {\n>> +\t$line =~ s/^#GIT#SET#MAN#FONT#/.ft/;\n>> +\tprint $line;\n>> +}\n>\n> Why not use `perl -pe \"s/^#GIT#SET#MAN#FONT#/.ft/\"` or an equivalent sed \n> command in the Makefile instead of having this as a separate script?\n\nOnly because my perl foo is too weak to know the perl form, and I didn't \nknow how to get sed to replace unicode characters - which the original \nversion of the script did.  I rewrote the script in my lunchbreak after I \nfailed to find any better way to solve the problem, and it didn't occur to \nme to move it to sed at that point.\n\nHowever, given the other issues with docbook xsl 1.72 I think it would \ncleaner to simply say that git doesn't support 1.72.  I wouldn't be \nsurprised if other projects weren't taking that approach.\n\n-- \nJulian\n\n  ---\nIt's computer hardware, of course it's worth having <g>\n \t-- Espy on #Debian\n"}]}