{"thread":{"id":"52165","subject":"[PATCH] manpage-bold-literal.xsl: provide namespaced template for \"d:literal\"","startedAt":"2019-10-30T20:41:46Z","lastAt":"2019-11-02T05:45:52Z","messageCount":7,"participants":["Martin Ågren","Jeff King","brian m. carlson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"385181","messageId":"20191030204104.19603-1-martin.agren@gmail.com","threadId":"52165","inReplyTo":null,"subject":"[PATCH] manpage-bold-literal.xsl: provide namespaced template for \"d:literal\"","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2019-10-30T20:41:04Z","receivedAt":"2019-10-30T20:41:46Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"We recently regressed our rendering of \"literal\" elements in our\nmanpages, i.e, stuff we have placed within `backticks` in order to\nrender as monospace. In particular, we lost the bold rendering of such\nliteral text.\n\nThe culprit is f6461b82b9 (\"Documentation: fix build with Asciidoctor 2\",\n2019-09-15), where we switched from DocBook 4.5 to DocBook 5 with\nAsciidoctor. As part of the switch, we started using the namespaced\nDocBook XSLT stylesheets rather than the non-namespaced ones. (See\nf6461b82b9 for more details on why we changed to the namespaced ones.)\n\nThe bold literals are implemented as an XSLT snippet <xsl:template\nmatch=\"literal\">...</xsl:template>. Now that we use namespaces, this\ndoesn't pick up our literals like it used to.\n\nAdd an exact copy of the template where we match for \"d:literal\" instead\nof just \"literal\", after defining the d namespace. (\"d\" is what\nhttp://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl\nuses.) Note that we need to keep the non-namespaced version for\nAsciiDoc.\n\nThis boldness was introduced by 5121a6d993 (\"Documentation: option to\nrender literal text as bold for manpages\", 2009-03-27) and made the\ndefault in 5945717009 (\"Documentation: bold literals in man\",\n2016-05-31).\n\nOne reason this was not caught in review is that our doc-diff tool diffs\nwithout any boldness, i.e., it \"only\" compares text.\n\nThis has been optically tested with AsciiDoc 8.6.10, Asciidoctor 1.5.5\nand Asciidoctor 2.0.10. I've also verified that doc-diff produces the\nempty output in all three cases, as expected.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\n---\n I've kept thinking lately that \"wow, are we behind on marking up stuff\n to be monospaced/boldened\"...\n\n I'm pretty sure about the background here, but I'm not at all sure \n that this is the prettiest or correctest fix.\n \n Not sure if this problem is bad enough (and the fix good enough) for\n this to go into 2.24, but I offer this anyway.\n\n There are more manpage-*.xsl -- manpage-suppress-sp.xsl looks like it\n would have the exact same problem. But before diving in too deep, I'd\n rather submit this one to see if it's in the right direction at all.\n\n Martin\n\n Documentation/manpage-bold-literal.xsl | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/Documentation/manpage-bold-literal.xsl b/Documentation/manpage-bold-literal.xsl\nindex 608eb5df62..172388d6cf 100644\n--- a/Documentation/manpage-bold-literal.xsl\n+++ b/Documentation/manpage-bold-literal.xsl\n@@ -1,11 +1,20 @@\n <!-- manpage-bold-literal.xsl:\n      special formatting for manpages rendered from asciidoc+docbook -->\n <xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n+\t\txmlns:d=\"http://docbook.org/ns/docbook\"\n \t\tversion=\"1.0\">\n \n <!-- render literal text as bold (instead of plain or monospace);\n      this makes literal text easier to distinguish in manpages\n      viewed on a tty -->\n+<xsl:template match=\"d:literal\">\n+\t<xsl:value-of select=\"$git.docbook.backslash\"/>\n+\t<xsl:text>fB</xsl:text>\n+\t<xsl:apply-templates/>\n+\t<xsl:value-of select=\"$git.docbook.backslash\"/>\n+\t<xsl:text>fR</xsl:text>\n+</xsl:template>\n+\n <xsl:template match=\"literal\">\n \t<xsl:value-of select=\"$git.docbook.backslash\"/>\n \t<xsl:text>fB</xsl:text>\n-- \n2.24.0.rc2\n\n"},{"id":"385184","messageId":"20191030212422.GE29013@sigill.intra.peff.net","threadId":"52165","inReplyTo":"20191030204104.19603-1-martin.agren@gmail.com","subject":"Re: [PATCH] manpage-bold-literal.xsl: provide namespaced template for \"d:literal\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-10-30T21:24:22Z","receivedAt":"2019-10-30T21:24:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 30, 2019 at 09:41:04PM +0100, Martin Ågren wrote:\n\n> We recently regressed our rendering of \"literal\" elements in our\n> manpages, i.e, stuff we have placed within `backticks` in order to\n> render as monospace. In particular, we lost the bold rendering of such\n> literal text.\n\nThis is just when rendering with asciidoctor, right? AFAICT the bolding\nis still fine in pages built with asciidoc.\n\n> The culprit is f6461b82b9 (\"Documentation: fix build with Asciidoctor 2\",\n> 2019-09-15), where we switched from DocBook 4.5 to DocBook 5 with\n> Asciidoctor. As part of the switch, we started using the namespaced\n> DocBook XSLT stylesheets rather than the non-namespaced ones. (See\n> f6461b82b9 for more details on why we changed to the namespaced ones.)\n> \n> The bold literals are implemented as an XSLT snippet <xsl:template\n> match=\"literal\">...</xsl:template>. Now that we use namespaces, this\n> doesn't pick up our literals like it used to.\n>\n> Add an exact copy of the template where we match for \"d:literal\" instead\n> of just \"literal\", after defining the d namespace. (\"d\" is what\n> http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl\n> uses.) Note that we need to keep the non-namespaced version for\n> AsciiDoc.\n\nBoth the explanation and the solution make sense. We'd eventually be\nable to drop this duplicate xsl if we go asciidoctor-only.\n\nI have more general thoughts below, but the patch itself looks good to\nme (and IMHO is worth taking for 2.24).\n\n> This boldness was introduced by 5121a6d993 (\"Documentation: option to\n> render literal text as bold for manpages\", 2009-03-27) and made the\n> default in 5945717009 (\"Documentation: bold literals in man\",\n> 2016-05-31).\n\nI somehow missed that we turned on this bolding by default. I can\nfinally delete MAN_BOLD_LITERAL from my config.mak. ;)\n\n> One reason this was not caught in review is that our doc-diff tool diffs\n> without any boldness, i.e., it \"only\" compares text.\n\nI don't think this was intentional, but just a consequence of\nredirecting man's stdout to a non-terminal. Doing:\n\n  MAN_KEEP_FORMATTING=1 ./doc-diff --asciidoctor HEAD^ HEAD\n\non your patch shows the improvement, though note that the diffed version\nis kind of ugly. It looks like the bolding is done with ^H characters,\nand it interacts in a funny way with our diff coloring, as well as with\ndiff-highlight if you use it. Piping the above through \"less\" looks\ndecent, but it gives me pause on whether we should be setting that\nvariable inside the script.\n\nOne other annoyance is that the directory names we use as a key for\ncaching results from run to run don't know about MAN_KEEP_FORMATTING. So\nyou may need \"-f\".\n\nSpeaking of annoyances, is it just me, or does the rendering stage of\ndoc-diff not actually proceed in parallel? Doing this seems to help, but\nI'm not sure why:\n\ndiff --git a/Documentation/doc-diff b/Documentation/doc-diff\nindex 88a9b20168..1694300e50 100755\n--- a/Documentation/doc-diff\n+++ b/Documentation/doc-diff\n@@ -127,7 +127,7 @@ generate_render_makefile () {\n \twhile read src\n \tdo\n \t\tdst=$2/${src#$1/}\n-\t\tprintf 'all:: %s\\n' \"$dst\"\n+\t\tprintf 'all: %s\\n' \"$dst\"\n \t\tprintf '%s: %s\\n' \"$dst\" \"$src\"\n \t\tprintf '\\t@echo >&2 \"  RENDER $(notdir $@)\" && \\\\\\n'\n \t\tprintf '\\tmkdir -p $(dir $@) && \\\\\\n'\n\n> This has been optically tested with AsciiDoc 8.6.10, Asciidoctor 1.5.5\n> and Asciidoctor 2.0.10. I've also verified that doc-diff produces the\n> empty output in all three cases, as expected.\n\nI like the phrase \"optically tested\". :)\n\nI also confirmed with the MAN_KEEP_FORMATTING trick above that \"doc-diff\n--asciidoctor\" fixes the problem as advertised, and \"--asciidoc\" has no\nchange at all.\n\n>  I'm pretty sure about the background here, but I'm not at all sure \n>  that this is the prettiest or correctest fix.\n>  \n>  Not sure if this problem is bad enough (and the fix good enough) for\n>  this to go into 2.24, but I offer this anyway.\n\nIt will only be noticed by people building with asciidoctor. But it _is_\na regression for them in 2.24, and the patch seems pretty safe. So I\nthink it's probably worth doing, but if it doesn't happen until the next\nmaint release, I don't think it's the end of the world.\n\n>  There are more manpage-*.xsl -- manpage-suppress-sp.xsl looks like it\n>  would have the exact same problem. But before diving in too deep, I'd\n>  rather submit this one to see if it's in the right direction at all.\n\nIt looks like a lot of them don't actually match on the namespaced\ntagnames, and so are OK. Some of them require special options to enable,\nso we wouldn't necessarily notice problems via doc-diff.\n\nFrom my brief look, I think suppress-sp is the only one that needs\nattention. I kind of wonder if we can just drop it. According to the\nMakefile comment, it's needed only for docbook 1.69.1-1.71.0. But 1.71.1\ncame out in 2006. Surely even RHEL7 or whatever ancient system people\nuse is past that, right? :)\n\nOr alternatively, as I've argued elsewhere, we could simply be a little\nmore aggressive about deprecating old doc build tools. According to the\nMakefile, no extra settings are needed with docbook >1.73.0. That came\nout in 2007. I'd be willing to just call that the cutoff point, and\nanybody without it can install the pre-formatted pages.\n\n-Peff\n"},{"id":"385195","messageId":"20191031023150.mdbj74sthrftnqie@camp.crustytoothpaste.net","threadId":"52165","inReplyTo":"20191030204104.19603-1-martin.agren@gmail.com","subject":"Re: [PATCH] manpage-bold-literal.xsl: provide namespaced template for \"d:literal\"","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-31T02:31:51Z","receivedAt":"2019-10-31T02:32:00Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2019-10-30 at 20:41:04, Martin Ågren wrote:\n>  I've kept thinking lately that \"wow, are we behind on marking up stuff\n>  to be monospaced/boldened\"...\n> \n>  I'm pretty sure about the background here, but I'm not at all sure \n>  that this is the prettiest or correctest fix.\n\nThis fix is correct.  Thanks for sending a patch for this, and sorry\nabout regressing our bolding behavior.\n\n> diff --git a/Documentation/manpage-bold-literal.xsl b/Documentation/manpage-bold-literal.xsl\n> index 608eb5df62..172388d6cf 100644\n> --- a/Documentation/manpage-bold-literal.xsl\n> +++ b/Documentation/manpage-bold-literal.xsl\n> @@ -1,11 +1,20 @@\n>  <!-- manpage-bold-literal.xsl:\n>       special formatting for manpages rendered from asciidoc+docbook -->\n>  <xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n> +\t\txmlns:d=\"http://docbook.org/ns/docbook\"\n>  \t\tversion=\"1.0\">\n>  \n>  <!-- render literal text as bold (instead of plain or monospace);\n>       this makes literal text easier to distinguish in manpages\n>       viewed on a tty -->\n> +<xsl:template match=\"d:literal\">\n> +\t<xsl:value-of select=\"$git.docbook.backslash\"/>\n> +\t<xsl:text>fB</xsl:text>\n> +\t<xsl:apply-templates/>\n> +\t<xsl:value-of select=\"$git.docbook.backslash\"/>\n> +\t<xsl:text>fR</xsl:text>\n> +</xsl:template>\n> +\n>  <xsl:template match=\"literal\">\n\nIf you want to avoid duplication, you can write the existing template as\nfollows:\n\n  <xsl:template match=\"literal|d:literal\">\n\nThat will match both literal and d:literal tags.  You still need the\nnamespace declaration you added, of course.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"385198","messageId":"CAN0heSrWqc2cyqOBVaWQOJHs4+48viAGL7YPGP6QnDrf+m_Jpw@mail.gmail.com","threadId":"52165","inReplyTo":"20191030212422.GE29013@sigill.intra.peff.net","subject":"Re: [PATCH] manpage-bold-literal.xsl: provide namespaced template for \"d:literal\"","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2019-10-31T06:19:30Z","receivedAt":"2019-10-31T06:19:45Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On Wed, 30 Oct 2019 at 22:24, Jeff King <peff@peff.net> wrote:\n>\n> On Wed, Oct 30, 2019 at 09:41:04PM +0100, Martin Ågren wrote:\n>\n> > We recently regressed our rendering of \"literal\" elements in our\n> > manpages, i.e, stuff we have placed within `backticks` in order to\n> > render as monospace. In particular, we lost the bold rendering of such\n> > literal text.\n>\n> This is just when rendering with asciidoctor, right? AFAICT the bolding\n> is still fine in pages built with asciidoc.\n\nRight. Sorry for being unclear. Fixed in v2.\n\n> > One reason this was not caught in review is that our doc-diff tool diffs\n> > without any boldness, i.e., it \"only\" compares text.\n>\n> I don't think this was intentional, but just a consequence of\n> redirecting man's stdout to a non-terminal. Doing:\n>\n>   MAN_KEEP_FORMATTING=1 ./doc-diff --asciidoctor HEAD^ HEAD\n>\n> on your patch shows the improvement, though note that the diffed version\n> is kind of ugly. It looks like the bolding is done with ^H characters,\n> and it interacts in a funny way with our diff coloring, as well as with\n> diff-highlight if you use it. Piping the above through \"less\" looks\n> decent, but it gives me pause on whether we should be setting that\n> variable inside the script.\n\nVery interesting! Thanks for this trick.\n\n> Speaking of annoyances, is it just me, or does the rendering stage of\n> doc-diff not actually proceed in parallel? Doing this seems to help, but\n> I'm not sure why:\n>\n> diff --git a/Documentation/doc-diff b/Documentation/doc-diff\n> index 88a9b20168..1694300e50 100755\n> --- a/Documentation/doc-diff\n> +++ b/Documentation/doc-diff\n> @@ -127,7 +127,7 @@ generate_render_makefile () {\n>         while read src\n>         do\n>                 dst=$2/${src#$1/}\n> -               printf 'all:: %s\\n' \"$dst\"\n> +               printf 'all: %s\\n' \"$dst\"\n>                 printf '%s: %s\\n' \"$dst\" \"$src\"\n>                 printf '\\t@echo >&2 \"  RENDER $(notdir $@)\" && \\\\\\n'\n>                 printf '\\tmkdir -p $(dir $@) && \\\\\\n'\n>\n\nHm, didn't look into this. Will try to find the time.\n\n> I also confirmed with the MAN_KEEP_FORMATTING trick above that \"doc-diff\n> --asciidoctor\" fixes the problem as advertised, and \"--asciidoc\" has no\n> change at all.\n\nThanks!\n\n> >  There are more manpage-*.xsl -- manpage-suppress-sp.xsl looks like it\n> >  would have the exact same problem. But before diving in too deep, I'd\n> >  rather submit this one to see if it's in the right direction at all.\n>\n> It looks like a lot of them don't actually match on the namespaced\n> tagnames, and so are OK. Some of them require special options to enable,\n> so we wouldn't necessarily notice problems via doc-diff.\n>\n> From my brief look, I think suppress-sp is the only one that needs\n> attention. I kind of wonder if we can just drop it. According to the\n> Makefile comment, it's needed only for docbook 1.69.1-1.71.0. But 1.71.1\n> came out in 2006. Surely even RHEL7 or whatever ancient system people\n> use is past that, right? :)\n\nI also only had a brief look and realized I wouldn't know how to test\nwith such a broken version, so I didn't feel comfortable mucking around\nwith that file.\n\n> Or alternatively, as I've argued elsewhere, we could simply be a little\n> more aggressive about deprecating old doc build tools. According to the\n> Makefile, no extra settings are needed with docbook >1.73.0. That came\n> out in 2007. I'd be willing to just call that the cutoff point, and\n> anybody without it can install the pre-formatted pages.\n\nYeah, that makes sense.\n\nMartin\n"},{"id":"385199","messageId":"CAN0heSrY9jOrRmt_ViJZ8Yv96XPNh4atArxqNO1=Tr57wdt0Zw@mail.gmail.com","threadId":"52165","inReplyTo":"20191031023150.mdbj74sthrftnqie@camp.crustytoothpaste.net","subject":"Re: [PATCH] manpage-bold-literal.xsl: provide namespaced template for \"d:literal\"","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2019-10-31T06:21:32Z","receivedAt":"2019-10-31T06:21:47Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On Thu, 31 Oct 2019 at 03:32, brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n>\n> On 2019-10-30 at 20:41:04, Martin Ågren wrote:\n> >  I'm pretty sure about the background here, but I'm not at all sure\n> >  that this is the prettiest or correctest fix.\n>\n> This fix is correct.  Thanks for sending a patch for this, and sorry\n> about regressing our bolding behavior.\n\nThanks! And no worries. I should have spotted this sooner.\n\n> If you want to avoid duplication, you can write the existing template as\n> follows:\n>\n>   <xsl:template match=\"literal|d:literal\">\n>\n> That will match both literal and d:literal tags.  You still need the\n> namespace declaration you added, of course.\n\nThanks. I use this for v2.\n\nMartin\n"},{"id":"385200","messageId":"20191031062227.14535-1-martin.agren@gmail.com","threadId":"52165","inReplyTo":"20191030204104.19603-1-martin.agren@gmail.com","subject":"[PATCH v2] manpage-bold-literal.xsl: match for namespaced \"d:literal\" in template","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2019-10-31T06:22:27Z","receivedAt":"2019-10-31T06:22:59Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"We recently regressed our rendering with Asciidoctor of \"literal\"\nelements in our manpages, i.e, stuff we have placed within `backticks`\nin order to render as monospace. In particular, we lost the bold\nrendering of such literal text.\n\nThe culprit is f6461b82b9 (\"Documentation: fix build with Asciidoctor 2\",\n2019-09-15), where we switched from DocBook 4.5 to DocBook 5 with\nAsciidoctor. As part of the switch, we started using the namespaced\nDocBook XSLT stylesheets rather than the non-namespaced ones. (See\nf6461b82b9 for more details on why we changed to the namespaced ones.)\n\nThe bold literals are implemented as an XSLT snippet <xsl:template\nmatch=\"literal\">...</xsl:template>. Now that we use namespaces, this\ndoesn't pick up our literals like it used to.\n\nMatch for \"d:literal\" in addition to just \"literal\", after defining the\nd namespace. (\"d\" is what\nhttp://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl\nuses.) Note that we need to keep matching without the namespace for\nAsciiDoc.\n\nThis boldness was introduced by 5121a6d993 (\"Documentation: option to\nrender literal text as bold for manpages\", 2009-03-27) and made the\ndefault in 5945717009 (\"Documentation: bold literals in man\",\n2016-05-31).\n\nOne reason this was not caught in review is that our doc-diff tool diffs\nwithout any boldness, i.e., it \"only\" compares text. As pointed out by\nPeff in review of this patch, one can use `MAN_KEEP_FORMATTING=1\n./doc-diff <...>`\n\nThis has been optically tested with AsciiDoc 8.6.10, Asciidoctor 1.5.5\nand Asciidoctor 2.0.10. I've also verified that doc-diff produces the\nempty output for all three programs, as expected, and that with the\nMAN_KEEP_FORMATTING trick, AsciiDoc yields no diff, whereas with\nAsciidoctor, we get bold literals, just like we want.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\n---\nRange-diff against v1:\n1:  fb5372c3cf ! 1:  a22ed4896c manpage-bold-literal.xsl: provide namespaced template for \"d:literal\"\n    @@ Metadata\n     Author: Martin Ågren <martin.agren@gmail.com>\n     \n      ## Commit message ##\n    -    manpage-bold-literal.xsl: provide namespaced template for \"d:literal\"\n    +    manpage-bold-literal.xsl: match for namespaced \"d:literal\" in template\n     \n    -    We recently regressed our rendering of \"literal\" elements in our\n    -    manpages, i.e, stuff we have placed within `backticks` in order to\n    -    render as monospace. In particular, we lost the bold rendering of such\n    -    literal text.\n    +    We recently regressed our rendering with Asciidoctor of \"literal\"\n    +    elements in our manpages, i.e, stuff we have placed within `backticks`\n    +    in order to render as monospace. In particular, we lost the bold\n    +    rendering of such literal text.\n     \n         The culprit is f6461b82b9 (\"Documentation: fix build with Asciidoctor 2\",\n         2019-09-15), where we switched from DocBook 4.5 to DocBook 5 with\n    @@ Commit message\n         match=\"literal\">...</xsl:template>. Now that we use namespaces, this\n         doesn't pick up our literals like it used to.\n     \n    -    Add an exact copy of the template where we match for \"d:literal\" instead\n    -    of just \"literal\", after defining the d namespace. (\"d\" is what\n    +    Match for \"d:literal\" in addition to just \"literal\", after defining the\n    +    d namespace. (\"d\" is what\n         http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl\n    -    uses.) Note that we need to keep the non-namespaced version for\n    +    uses.) Note that we need to keep matching without the namespace for\n         AsciiDoc.\n     \n         This boldness was introduced by 5121a6d993 (\"Documentation: option to\n    @@ Commit message\n         2016-05-31).\n     \n         One reason this was not caught in review is that our doc-diff tool diffs\n    -    without any boldness, i.e., it \"only\" compares text.\n    +    without any boldness, i.e., it \"only\" compares text. As pointed out by\n    +    Peff in review of this patch, one can use `MAN_KEEP_FORMATTING=1\n    +    ./doc-diff <...>`\n     \n         This has been optically tested with AsciiDoc 8.6.10, Asciidoctor 1.5.5\n         and Asciidoctor 2.0.10. I've also verified that doc-diff produces the\n    -    empty output for all three programs, as expected.\n    +    empty output for all three programs, as expected, and that with the\n    +    MAN_KEEP_FORMATTING trick, AsciiDoc yields no diff, whereas with\n    +    Asciidoctor, we get bold literals, just like we want.\n     \n         Signed-off-by: Martin Ågren <martin.agren@gmail.com>\n     \n    @@ Documentation/manpage-bold-literal.xsl\n      <!-- render literal text as bold (instead of plain or monospace);\n           this makes literal text easier to distinguish in manpages\n           viewed on a tty -->\n    -+<xsl:template match=\"d:literal\">\n    -+\t<xsl:value-of select=\"$git.docbook.backslash\"/>\n    -+\t<xsl:text>fB</xsl:text>\n    -+\t<xsl:apply-templates/>\n    -+\t<xsl:value-of select=\"$git.docbook.backslash\"/>\n    -+\t<xsl:text>fR</xsl:text>\n    -+</xsl:template>\n    -+\n    - <xsl:template match=\"literal\">\n    +-<xsl:template match=\"literal\">\n    ++<xsl:template match=\"literal|d:literal\">\n      \t<xsl:value-of select=\"$git.docbook.backslash\"/>\n      \t<xsl:text>fB</xsl:text>\n    + \t<xsl:apply-templates/>\n\n Documentation/manpage-bold-literal.xsl | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/manpage-bold-literal.xsl b/Documentation/manpage-bold-literal.xsl\nindex 608eb5df62..94d6c1b545 100644\n--- a/Documentation/manpage-bold-literal.xsl\n+++ b/Documentation/manpage-bold-literal.xsl\n@@ -1,12 +1,13 @@\n <!-- manpage-bold-literal.xsl:\n      special formatting for manpages rendered from asciidoc+docbook -->\n <xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n+\t\txmlns:d=\"http://docbook.org/ns/docbook\"\n \t\tversion=\"1.0\">\n \n <!-- render literal text as bold (instead of plain or monospace);\n      this makes literal text easier to distinguish in manpages\n      viewed on a tty -->\n-<xsl:template match=\"literal\">\n+<xsl:template match=\"literal|d:literal\">\n \t<xsl:value-of select=\"$git.docbook.backslash\"/>\n \t<xsl:text>fB</xsl:text>\n \t<xsl:apply-templates/>\n-- \n2.24.0.rc2\n\n"},{"id":"385301","messageId":"xmqq4kzm4yra.fsf@gitster-ct.c.googlers.com","threadId":"52165","inReplyTo":"CAN0heSrY9jOrRmt_ViJZ8Yv96XPNh4atArxqNO1=Tr57wdt0Zw@mail.gmail.com","subject":"Re: [PATCH] manpage-bold-literal.xsl: provide namespaced template for \"d:literal\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-11-02T05:45:45Z","receivedAt":"2019-11-02T05:45:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Ågren <martin.agren@gmail.com> writes:\n\n>> If you want to avoid duplication, you can write the existing template as\n>> follows:\n>>\n>>   <xsl:template match=\"literal|d:literal\">\n>>\n>> That will match both literal and d:literal tags.  You still need the\n>> namespace declaration you added, of course.\n>\n> Thanks. I use this for v2.\n\nThanks, both.\n"}]}