man.string.subst.map
Prev | Character/string substitution | Next

## man.string.subst.map

man.string.subst.map — Specifies a set of string substitutions

## Synopsis

    <xsl:param name="man.string.subst.map">

      <!-- * remove no-break marker at beginning of line (stylesheet artifact) -->
      <ss:substitution oldstring="▒▀" newstring="▒"></ss:substitution>
      <!-- * replace U+2580 no-break marker (stylesheet-added) w/ no-break space -->
      <ss:substitution oldstring="▀" newstring="\ "></ss:substitution>

      <!-- ==================================================================== -->

      <!-- * squeeze multiple newlines before a roff request  -->
      <ss:substitution oldstring="

    ." newstring="
    ."></ss:substitution>
      <!-- * remove any .sp instances that directly precede a .PP  -->
      <ss:substitution oldstring=".sp
    .PP" newstring=".PP"></ss:substitution>
      <!-- * remove any .sp instances that directly follow a .PP  -->
      <ss:substitution oldstring=".PP
    .sp" newstring=".PP"></ss:substitution>
      <!-- * squeeze multiple newlines after start of no-fill (verbatim) env. -->
      <ss:substitution oldstring=".nf

    " newstring=".nf
    "></ss:substitution>
      <!-- * squeeze multiple newlines after REstoring margin -->
      <ss:substitution oldstring=".RE

    " newstring=".RE
    "></ss:substitution>
      <!-- * U+2591 is a marker we add before and after every Parameter in -->
      <!-- * Funcprototype output -->
      <ss:substitution oldstring="░" newstring=" "></ss:substitution>
      <!-- * U+2592 is a marker we add for the newline before output of <sbr>; -->
      <ss:substitution oldstring="▒" newstring="
    "></ss:substitution>
      <!-- * -->
      <!-- * Now deal with some other characters that are added by the -->
      <!-- * stylesheets during processing. -->
      <!-- * -->
      <!-- * bullet -->
      <ss:substitution oldstring="•" newstring="\(bu"></ss:substitution>
      <!-- * left double quote -->
      <ss:substitution oldstring="“" newstring="\(lq"></ss:substitution>
      <!-- * right double quote -->
      <ss:substitution oldstring="”" newstring="\(rq"></ss:substitution>
      <!-- * left single quote -->
      <ss:substitution oldstring="‘" newstring="\(oq"></ss:substitution>
      <!-- * right single quote -->
      <ss:substitution oldstring="’" newstring="\(cq"></ss:substitution>
      <!-- * copyright sign -->
      <ss:substitution oldstring="©" newstring="\(co"></ss:substitution>
      <!-- * registered sign -->
      <ss:substitution oldstring="®" newstring="\(rg"></ss:substitution>
      <!-- * ...servicemark... -->
      <!-- * There is no groff equivalent for it. -->
      <ss:substitution oldstring="℠" newstring="(SM)"></ss:substitution>
      <!-- * ...trademark... -->
      <!-- * We don't do "\(tm" because for console output, -->
      <!-- * groff just renders that as "tm"; that is: -->
      <!-- * -->
      <!-- *   Product&#x2122; -> Producttm -->
      <!-- * -->
      <!-- * So we just make it to "(TM)" instead; thus: -->
      <!-- * -->
      <!-- *   Product&#x2122; -> Product(TM) -->
      <ss:substitution oldstring="™" newstring="(TM)"></ss:substitution>

    </xsl:param>

## Description

The `man.string.subst.map` parameter contains a map that specifies a set of string substitutions to perform over the entire roff source for each man page, either just before generating final man-page output (that is, before writing man-page files to disk) or, if the value of the `man.charmap.enabled` parameter is non-zero, before applying the roff character map.

You can use `man.string.subst.map` as a “lightweight” character map to perform “essential” substitutions -- that is, substitutions that are always performed, even if the value of the `man.charmap.enabled` parameter is zero. For example, you can use it to replace quotation marks or other special characters that are generated by the DocBook XSL stylesheets for a particular locale setting (as opposed to those characters that are actually in source XML documents), or to replace any special characters that may be automatically generated by a particular customization of the DocBook XSL stylesheets.

### Warning

Do you not change value of the `man.string.subst.map` parameter unless you are sure what you are doing. First consider adding your string-substitution mappings to either or both of the following parameters:

`man.string.subst.map.local.pre`

  applied before `man.string.subst.map`

`man.string.subst.map.local.post`

  applied after `man.string.subst.map`

By default, both of those parameters contain no string substitutions. They are intended as a means for you to specify your own local string-substitution mappings.

If you remove any of default mappings from the value of the `man.string.subst.map` parameter, you are likely to end up with broken output. And be very careful about adding anything to it; it’s used for doing string substitution over the entire roff source of each man page – it causes target strings to be replaced in roff requests and escapes, not just in the visible contents of the page.

### Contents of the substitution map

The string-substitution map contains one or more `ss:substitution` elements, each of which has two attributes:

oldstring
  string to replace
newstring
  string with which to replace `oldstring`

It may also include XML comments (that is, delimited with "`<!--`" and "`-->`").

Prev | Up | Next
man.string.subst.map.local.pre | Home | man.string.subst.map.local.post