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

Re: [PATCH] manpage-bold-literal.xsl: provide namespaced template for "d:literal"

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 31, 2019, 02:31 UTC
Message-ID
<20191031023150.mdbj74sthrftnqie@camp.crustytoothpaste.net>
In-Reply-To
<20191030204104.19603-1-martin.agren@gmail.com>
On 2019-10-30 at 20:41:04, Martin Ågren wrote:
Show 5 quoted lines
>  I've kept thinking lately that "wow, are we behind on marking up stuff
>  to be monospaced/boldened"...
> 
>  I'm pretty sure about the background here, but I'm not at all sure 
>  that this is the prettiest or correctest fix.

This fix is correct. Thanks for sending a patch for this, and sorry about regressing our bolding behavior.

Show 23 quoted lines
> diff --git a/Documentation/manpage-bold-literal.xsl b/Documentation/manpage-bold-literal.xsl
> index 608eb5df62..172388d6cf 100644
> --- a/Documentation/manpage-bold-literal.xsl
> +++ b/Documentation/manpage-bold-literal.xsl
> @@ -1,11 +1,20 @@
>  <!-- manpage-bold-literal.xsl:
>       special formatting for manpages rendered from asciidoc+docbook -->
>  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> +		xmlns:d="http://docbook.org/ns/docbook"
>  		version="1.0">
>  
>  <!-- render literal text as bold (instead of plain or monospace);
>       this makes literal text easier to distinguish in manpages
>       viewed on a tty -->
> +<xsl:template match="d:literal">
> +	<xsl:value-of select="$git.docbook.backslash"/>
> +	<xsl:text>fB</xsl:text>
> +	<xsl:apply-templates/>
> +	<xsl:value-of select="$git.docbook.backslash"/>
> +	<xsl:text>fR</xsl:text>
> +</xsl:template>
> +
>  <xsl:template match="literal">

If you want to avoid duplication, you can write the existing template as follows:

  <xsl:template match="literal|d:literal">

That will match both literal and d:literal tags. You still need the namespace declaration you added, of course.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Martin ÅgrenNext: Martin Ågren
Message 4 of 7 in “manpage-bold-literal.xsl: provide namespaced template for "d:literal"”
  1. manpage-bold-literal.xsl: provide namespaced template for "d:literal"Martin Ågren, Oct 30, 2019
  2. Jeff KingOct 30, 2019
  3. Martin ÅgrenOct 31, 2019
  4. brian m. carlsonOct 31, 2019
  5. Martin ÅgrenOct 31, 2019
  6. Junio C HamanoNov 2, 2019
  7. manpage-bold-literal.xsl: match for namespaced "d:literal" in templateMartin Ågren, Oct 31, 2019

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.