man.string.subst.map.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <refentry xmlns="http://docbook.org/ns/docbook"
  2. xmlns:xlink="http://www.w3.org/1999/xlink"
  3. xmlns:xi="http://www.w3.org/2001/XInclude"
  4. xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6. xmlns:ss="http://docbook.sf.net/xmlns/string.subst/1.0"
  7. version="5.0" xml:id="man.string.subst.map">
  8. <refmeta>
  9. <refentrytitle>man.string.subst.map</refentrytitle>
  10. <refmiscinfo class="other" otherclass="datatype">rtf</refmiscinfo>
  11. </refmeta>
  12. <refnamediv>
  13. <refname>man.string.subst.map</refname>
  14. <refpurpose>Specifies a set of string substitutions</refpurpose>
  15. </refnamediv>
  16. <refsynopsisdiv>
  17. <src:fragment xml:id="man.string.subst.map.frag">
  18. <xsl:param name="man.string.subst.map">
  19. <!-- * remove no-break marker at beginning of line (stylesheet artifact) -->
  20. <ss:substitution oldstring="&#x2592;&#x2580;" newstring="&#x2592;"/>
  21. <!-- * replace U+2580 no-break marker (stylesheet-added) w/ no-break space -->
  22. <ss:substitution oldstring="&#x2580;" newstring="\ "/>
  23. <!-- ==================================================================== -->
  24. <!-- * squeeze multiple newlines before a roff request -->
  25. <ss:substitution oldstring="&#10;&#10;." newstring="&#10;."/>
  26. <!-- * remove any .sp instances that directly precede a .PP -->
  27. <ss:substitution oldstring=".sp&#10;.PP" newstring=".PP"/>
  28. <!-- * remove any .sp instances that directly follow a .PP -->
  29. <ss:substitution oldstring=".sp&#10;.sp" newstring=".sp"/>
  30. <!-- * squeeze multiple .sp instances into a single .sp-->
  31. <ss:substitution oldstring=".PP&#10;.sp" newstring=".PP"/>
  32. <!-- * squeeze multiple newlines after start of no-fill (verbatim) env. -->
  33. <ss:substitution oldstring=".nf&#10;&#10;" newstring=".nf&#10;"/>
  34. <!-- * squeeze multiple newlines after REstoring margin -->
  35. <ss:substitution oldstring=".RE&#10;&#10;" newstring=".RE&#10;"/>
  36. <!-- * U+2591 is a marker we add before and after every Parameter in -->
  37. <!-- * Funcprototype output -->
  38. <ss:substitution oldstring="&#x2591;" newstring=" "/>
  39. <!-- * U+2592 is a marker we add for the newline before output of <sbr>; -->
  40. <ss:substitution oldstring="&#x2592;" newstring="&#10;"/>
  41. <!-- * -->
  42. <!-- * Now deal with some other characters that are added by the -->
  43. <!-- * stylesheets during processing. -->
  44. <!-- * -->
  45. <!-- * bullet -->
  46. <ss:substitution oldstring="•" newstring="\(bu"/>
  47. <!-- * left double quote -->
  48. <ss:substitution oldstring="“" newstring="\(lq"/>
  49. <!-- * right double quote -->
  50. <ss:substitution oldstring="”" newstring="\(rq"/>
  51. <!-- * left single quote -->
  52. <ss:substitution oldstring="‘" newstring="\(oq"/>
  53. <!-- * right single quote -->
  54. <ss:substitution oldstring="’" newstring="\(cq"/>
  55. <!-- * copyright sign -->
  56. <ss:substitution oldstring="©" newstring="\(co"/>
  57. <!-- * registered sign -->
  58. <ss:substitution oldstring="®" newstring="\(rg"/>
  59. <!-- * ...servicemark... -->
  60. <!-- * There is no groff equivalent for it. -->
  61. <ss:substitution oldstring="&#x2120;" newstring="(SM)"/>
  62. <!-- * ...trademark... -->
  63. <!-- * We don't do "\(tm" because for console output, -->
  64. <!-- * groff just renders that as "tm"; that is: -->
  65. <!-- * -->
  66. <!-- * Product&#x2122; -> Producttm -->
  67. <!-- * -->
  68. <!-- * So we just make it to "(TM)" instead; thus: -->
  69. <!-- * -->
  70. <!-- * Product&#x2122; -> Product(TM) -->
  71. <ss:substitution oldstring="™" newstring="(TM)"/>
  72. </xsl:param>
  73. </src:fragment>
  74. </refsynopsisdiv>
  75. <refsection><info><title>Description</title></info>
  76. <para>The <parameter>man.string.subst.map</parameter> parameter
  77. contains <link linkend="map">a map</link> that specifies a set of
  78. string substitutions to perform over the entire roff source for each
  79. man page, either just before generating final man-page output (that
  80. is, before writing man-page files to disk) or, if the value of the
  81. <parameter>man.charmap.enabled</parameter> parameter is non-zero,
  82. before applying the roff character map.</para>
  83. <para>You can use <parameter>man.string.subst.map</parameter> as a
  84. “lightweight” character map to perform “essential” substitutions --
  85. that is, substitutions that are <emphasis>always</emphasis> performed,
  86. even if the value of the <parameter>man.charmap.enabled</parameter>
  87. parameter is zero. For example, you can use it to replace quotation
  88. marks or other special characters that are generated by the DocBook
  89. XSL stylesheets for a particular locale setting (as opposed to those
  90. characters that are actually in source XML documents), or to replace
  91. any special characters that may be automatically generated by a
  92. particular customization of the DocBook XSL stylesheets.</para>
  93. <warning>
  94. <para>Do you not change value of the
  95. <parameter>man.string.subst.map</parameter> parameter unless you are
  96. sure what you are doing. First consider adding your
  97. string-substitution mappings to either or both of the following
  98. parameters:
  99. <variablelist>
  100. <varlistentry>
  101. <term><parameter>man.string.subst.map.local.pre</parameter></term>
  102. <listitem><para>applied before
  103. <parameter>man.string.subst.map</parameter></para></listitem>
  104. </varlistentry>
  105. <varlistentry>
  106. <term><parameter>man.string.subst.map.local.post</parameter></term>
  107. <listitem><para>applied after
  108. <parameter>man.string.subst.map</parameter></para></listitem>
  109. </varlistentry>
  110. </variablelist>
  111. By default, both of those parameters contain no
  112. string substitutions. They are intended as a means for you to
  113. specify your own local string-substitution mappings.</para>
  114. <para>If you remove any of default mappings from the value of the
  115. <parameter>man.string.subst.map</parameter> parameter, you are
  116. likely to end up with broken output. And be very careful about adding
  117. anything to it; it’s used for doing string substitution over the
  118. entire roff source of each man page – it causes target strings to be
  119. replaced in roff requests and escapes, not just in the visible
  120. contents of the page.</para>
  121. </warning>
  122. <refsection xml:id="map">
  123. <info>
  124. <title>Contents of the substitution map</title>
  125. </info>
  126. <para>The string-substitution map contains one or more
  127. <tag>ss:substitution</tag> elements, each of which has two
  128. attributes:
  129. <variablelist>
  130. <varlistentry>
  131. <term>oldstring</term>
  132. <listitem>
  133. <simpara>string to replace</simpara>
  134. </listitem>
  135. </varlistentry>
  136. <varlistentry>
  137. <term>newstring</term>
  138. <listitem>
  139. <simpara>string with which to replace <tag
  140. class="attribute">oldstring</tag></simpara>
  141. </listitem>
  142. </varlistentry>
  143. </variablelist>
  144. It may also include XML comments (that is, delimited with
  145. "<literal>&lt;!--</literal>" and "<literal>--&gt;</literal>").
  146. </para>
  147. </refsection>
  148. </refsection>
  149. </refentry>