Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<refentry xmlns=""
          version="5.0" xml:id="">
<refmiscinfo class="other" otherclass="datatype">rtf</refmiscinfo>
<refpurpose>Specifies a set of string substitutions</refpurpose>

<src:fragment xml:id="">
<xsl:param name="">

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

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

  <!-- * squeeze multiple newlines before a roff request  -->
  <ss:substitution oldstring="&#10;&#10;." newstring="&#10;."/>
  <!-- * remove any .sp instances that directly precede a .PP  -->
  <ss:substitution oldstring=".sp&#10;.PP" newstring=".PP"/>
  <!-- * remove any .sp instances that directly follow a .PP  -->
  <ss:substitution oldstring=".sp&#10;.sp" newstring=".sp"/>
  <!-- * squeeze multiple .sp instances into a single .sp-->
  <ss:substitution oldstring=".PP&#10;.sp" newstring=".PP"/>
  <!-- * squeeze multiple newlines after start of no-fill (verbatim) env. -->
  <ss:substitution oldstring=".nf&#10;&#10;" newstring=".nf&#10;"/>
  <!-- * squeeze multiple newlines after REstoring margin -->
  <ss:substitution oldstring=".RE&#10;&#10;" newstring=".RE&#10;"/>
  <!-- * U+2591 is a marker we add before and after every Parameter in -->
  <!-- * Funcprototype output -->
  <ss:substitution oldstring="&#x2591;" newstring=" "/>
  <!-- * U+2592 is a marker we add for the newline before output of <sbr>; -->
  <ss:substitution oldstring="&#x2592;" newstring="&#10;"/>
  <!-- * -->
  <!-- * Now deal with some other characters that are added by the -->
  <!-- * stylesheets during processing. -->
  <!-- * -->
  <!-- * bullet -->
  <ss:substitution oldstring="•" newstring="\(bu"/>
  <!-- * left double quote -->
  <ss:substitution oldstring="“" newstring="\(lq"/>
  <!-- * right double quote -->
  <ss:substitution oldstring="”" newstring="\(rq"/>
  <!-- * left single quote -->
  <ss:substitution oldstring="‘" newstring="\(oq"/>
  <!-- * right single quote -->
  <ss:substitution oldstring="’" newstring="\(cq"/>
  <!-- * copyright sign -->
  <ss:substitution oldstring="©" newstring="\(co"/>
  <!-- * registered sign -->
  <ss:substitution oldstring="®" newstring="\(rg"/>
  <!-- * ...servicemark... -->
  <!-- * There is no groff equivalent for it. -->
  <ss:substitution oldstring="&#x2120;" newstring="(SM)"/>
  <!-- * ...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)"/>



<para>The <parameter></parameter> parameter
contains <link linkend="map">a map</link> 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
<parameter>man.charmap.enabled</parameter> parameter is non-zero,
before applying the roff character map.</para>

<para>You can use <parameter></parameter> as a
“lightweight” character map to perform “essential” substitutions --
that is, substitutions that are <emphasis>always</emphasis> performed,
even if the value of the <parameter>man.charmap.enabled</parameter>
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.</para>

  <para>Do you not change value of the
  <parameter></parameter> parameter unless you are
  sure what you are doing. First consider adding your
  string-substitution mappings to either or both of the following
      <listitem><para>applied before
      <listitem><para>applied after
  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.</para>

  <para>If you remove any of default mappings from the value of the
  <parameter></parameter> 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.</para>


<refsection xml:id="map">
    <title>Contents of the substitution map</title>
  <para>The string-substitution map contains one or more
  <tag>ss:substitution</tag> elements, each of which has two
        <simpara>string to replace</simpara>
        <simpara>string with which to replace <tag
  It may also include XML comments (that is, delimited with
  "<literal>&lt;!--</literal>" and "<literal>--&gt;</literal>").

New to GrepCode? Check out our FAQ X