]> granicus.if.org Git - docbook-dsssl/commitdiff
Added support for enabling users to control what appears and does
authorMichael Smith <xmldoc@users.sourceforge.net>
Tue, 5 Jul 2005 11:32:42 +0000 (11:32 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Tue, 5 Jul 2005 11:32:42 +0000 (11:32 +0000)
not appear in the content of the .TH title-line header/footer.
(Closes #1210492)

xsl/manpages/other.xsl
xsl/manpages/param.ent
xsl/manpages/param.xweb
xsl/params/man.th.extra1.suppress.xml [new file with mode: 0644]
xsl/params/man.th.extra2.max.length.xml [new file with mode: 0644]
xsl/params/man.th.extra2.suppress.xml [new file with mode: 0644]
xsl/params/man.th.extra3.max.length.xml [new file with mode: 0644]
xsl/params/man.th.extra3.suppress.xml [new file with mode: 0644]
xsl/params/man.th.title.max.length.xml

index 558f7df4ce0e540857e41236bff4692a1fe6d678..20f09085449f713b7df3d0c05feb56ae913aedd3 100644 (file)
 
      ******************************************************************** -->
 
+<xsl:param name="man.th.extra1.suppress">0</xsl:param>
+<xsl:param name="man.th.extra2.suppress">0</xsl:param>
+<xsl:param name="man.th.extra3.suppress">0</xsl:param>
+<xsl:param name="man.th.extra2.max.length">30</xsl:param>
+<xsl:param name="man.th.extra3.max.length">40</xsl:param>
+
 <!-- * This file contains named templates that are related to things -->
 <!-- * other than just assembling the actual text of the main text flow -->
 <!-- * of each man page. This "other" stuff currently amounts to: -->
     <xsl:text>.TH "</xsl:text>
     <xsl:call-template name="string.upper">
       <xsl:with-param name="string">
-        <!-- * truncate title if it exceeds max. length (user-configurable) -->
-        <xsl:value-of
-            select="normalize-space(substring($title, 1, $man.th.title.max.length))"/>
+        <xsl:choose>
+          <xsl:when test="$man.th.title.max.length != ''">
+            <xsl:value-of
+                select="normalize-space(substring($title, 1, $man.th.title.max.length))"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="normalize-space($title)"/>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:with-param>
     </xsl:call-template>
     <xsl:text>" "</xsl:text>
     <xsl:value-of select="normalize-space($section)"/>
     <xsl:text>" "</xsl:text>
-    <xsl:value-of select="normalize-space($extra1)"/>
+    <xsl:if test="$man.th.extra1.suppress = 0">
+      <!-- * there is no max.length for the extra1 field; the reason -->
+      <!-- * is, it is almost always a date, and it is not possible -->
+      <!-- * to truncate dates without changing their meaning -->
+      <xsl:value-of select="normalize-space($extra1)"/>
+    </xsl:if>
     <xsl:text>" "</xsl:text>
-    <xsl:value-of select="normalize-space($extra2)"/>
+    <xsl:if test="$man.th.extra2.suppress = 0">
+      <xsl:choose>
+        <!-- * if max.length is non-empty, use value to truncate field -->
+        <xsl:when test="$man.th.extra2.max.length != ''">
+          <xsl:value-of
+              select="normalize-space(substring($extra2, 1, $man.th.extra2.max.length))"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="normalize-space($extra2)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
     <xsl:text>" "</xsl:text>
-    <xsl:value-of select="normalize-space($extra3)"/>
+    <xsl:if test="$man.th.extra3.suppress = 0">
+      <xsl:choose>
+        <!-- * if max.length is non-empty, use value to truncate field -->
+        <xsl:when test="$man.th.extra3.max.length != ''">
+          <xsl:value-of
+              select="normalize-space(substring($extra3, 1, $man.th.extra3.max.length))"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="normalize-space($extra3)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
     <xsl:text>"&#10;</xsl:text>
     <xsl:call-template name="mark.subheading"/>
   </xsl:template>
index 577ec4458944f60c218f5150738596b8305807e4..27b259ff97d1b2cb309b20176c11db38f600804c 100644 (file)
@@ -10,7 +10,6 @@
 <!ENTITY man.charmap.subset.profile SYSTEM "../params/man.charmap.subset.profile.xml">
 <!ENTITY man.subheading.divider SYSTEM "../params/man.subheading.divider.xml">
 <!ENTITY man.subheading.divider.enabled SYSTEM "../params/man.subheading.divider.enabled.xml">
-<!ENTITY man.th.title.max.length SYSTEM "../params/man.th.title.max.length.xml">
 <!ENTITY refentry.date.profile.enabled SYSTEM "../params/refentry.date.profile.enabled.xml">
 <!ENTITY refentry.manual.profile.enabled SYSTEM "../params/refentry.manual.profile.enabled.xml">
 <!ENTITY refentry.source.name.profile.enabled SYSTEM "../params/refentry.source.name.profile.enabled.xml">
@@ -23,3 +22,9 @@
 <!ENTITY refentry.source.fallback.profile SYSTEM "../params/refentry.source.fallback.profile.xml">
 <!ENTITY refentry.source.name.profile SYSTEM "../params/refentry.source.name.profile.xml">
 <!ENTITY refentry.version.profile SYSTEM "../params/refentry.version.profile.xml">
+<!ENTITY man.th.title.max.length SYSTEM "../params/man.th.title.max.length.xml">
+<!ENTITY man.th.extra2.max.length SYSTEM "../params/man.th.extra2.max.length.xml">
+<!ENTITY man.th.extra3.max.length SYSTEM "../params/man.th.extra3.max.length.xml">
+<!ENTITY man.th.extra1.suppress SYSTEM "../params/man.th.extra1.suppress.xml">
+<!ENTITY man.th.extra2.suppress SYSTEM "../params/man.th.extra2.suppress.xml">
+<!ENTITY man.th.extra3.suppress SYSTEM "../params/man.th.extra3.suppress.xml">
index c90e75043ef0ca566eb858cf7bcc50a511d47e3c..23990cd13f8922884bed24c62362f178990dcd9a 100644 (file)
@@ -38,7 +38,6 @@
 &man.string.subst.map;
 &man.subheading.divider.enabled;
 &man.subheading.divider;
-&man.th.title.max.length;
   </reference>
   <reference id="charmap">
   <title>Character map</title>
 &refentry.version.profile.enabled;
 &refentry.manual.fallback.profile;
 &refentry.source.fallback.profile;
+  </reference>
+  <reference id="charmap">
+  <title>Page header/footer</title>
+&man.th.extra1.suppress;
+&man.th.extra2.suppress;
+&man.th.extra3.suppress;
+&man.th.title.max.length;
+&man.th.extra2.max.length;
+&man.th.extra3.max.length;
   </reference>
   <appendix id="stylesheet">
     <title>The Stylesheet</title>
 <src:fragref linkend="man.charmap.subset.profile.frag"/>
 <src:fragref linkend="man.subheading.divider.frag"/>
 <src:fragref linkend="man.subheading.divider.enabled.frag"/>
-<src:fragref linkend="man.th.title.max.length.frag"/>
 <src:fragref linkend="refentry.date.profile.enabled.frag"/>
 <src:fragref linkend="refentry.manual.profile.enabled.frag"/>
 <src:fragref linkend="refentry.source.name.profile.enabled.frag"/>
 <src:fragref linkend="refentry.source.fallback.profile.frag"/>
 <src:fragref linkend="refentry.source.name.profile.frag"/>
 <src:fragref linkend="refentry.version.profile.frag"/>
+<src:fragref linkend="man.th.title.max.length.frag"/>
+<src:fragref linkend="man.th.extra2.max.length.frag"/>
+<src:fragref linkend="man.th.extra3.max.length.frag"/>
+<src:fragref linkend="man.th.extra1.suppress.frag"/>
+<src:fragref linkend="man.th.extra2.suppress.frag"/>
+<src:fragref linkend="man.th.extra3.suppress.frag"/>
 </xsl:stylesheet>
     </src:fragment>
 
diff --git a/xsl/params/man.th.extra1.suppress.xml b/xsl/params/man.th.extra1.suppress.xml
new file mode 100644 (file)
index 0000000..0dcca9f
--- /dev/null
@@ -0,0 +1,27 @@
+<refentry id="man.th.extra1.suppress">
+<refmeta>
+<refentrytitle>man.th.extra1.suppress</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>man.th.extra1.suppress</refname>
+<refpurpose>Suppress extra1 part of header/footer?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='man.th.extra1.suppress.frag'>
+<xsl:param name="man.th.extra1.suppress">0</xsl:param></src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If the value of <parameter>man.th.extra1.suppress</parameter> is
+non-zero, then the <literal>extra1</literal> part of the
+<literal>.TH</literal> title line header/footer is suppressed.</para>
+
+<para>The content of the <literal>extra1</literal> field is almost
+always displayed in the center footer of the page and is, universally,
+a date.</para>
+
+</refsect1>
+</refentry>
diff --git a/xsl/params/man.th.extra2.max.length.xml b/xsl/params/man.th.extra2.max.length.xml
new file mode 100644 (file)
index 0000000..d8c0796
--- /dev/null
@@ -0,0 +1,37 @@
+<refentry id="man.th.extra2.max.length">
+<refmeta>
+<refentrytitle>man.th.extra2.max.length</refentrytitle>
+<refmiscinfo role="type">integer</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>man.th.extra2.max.length</refname>
+<refpurpose>Maximum length of extra2 in header/footer</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='man.th.extra2.max.length.frag'>
+<xsl:param name="man.th.extra2.max.length">40</xsl:param>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>Specifies the maximum permitted length of the
+<literal>extra2</literal> part of the man-page part of the
+<literal>.TH</literal> title line header/footer. If the
+<literal>extra2</literal> content exceeds the maxiumum specified, it
+is truncated down to the maximum permitted length.</para>
+
+<para>The content of the <literal>extra2</literal> field is usually
+displayed in the left footer of the page and is typically "source"
+data, often in the form
+<replaceable>Name</replaceable>&#160;<replaceable>Version</replaceable>;
+for example, "GTK+ 1.2" (from the <literal>gtk-options(7)</literal>
+man page).</para>
+
+<para>The default value for this parameter is reasonable (perhaps too
+liberal) but somewhat arbitrary. If you are processing pages with long
+"source" infromation, you may want to experiment with changing the
+value in order to achieve the correct aesthetic results.</para>
+</refsect1>
+</refentry>
diff --git a/xsl/params/man.th.extra2.suppress.xml b/xsl/params/man.th.extra2.suppress.xml
new file mode 100644 (file)
index 0000000..8bc0a82
--- /dev/null
@@ -0,0 +1,39 @@
+<refentry id="man.th.extra2.suppress">
+<refmeta>
+<refentrytitle>man.th.extra2.suppress</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>man.th.extra2.suppress</refname>
+<refpurpose>Suppress extra2 part of header/footer?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='man.th.extra2.suppress.frag'>
+<xsl:param name="man.th.extra2.suppress">0</xsl:param></src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If the value of <parameter>man.th.extra2.suppress</parameter> is
+non-zero, then the <literal>extra2</literal> part of the
+<literal>.TH</literal> title line header/footer is suppressed.</para>
+
+<para>The content of the <literal>extra2</literal> field is usually
+displayed in the left footer of the page and is typically "source"
+data, often in the form
+<replaceable>Name</replaceable>&#160;<replaceable>Version</replaceable>;
+for example, "GTK+ 1.2" (from the <literal>gtk-options(7)</literal>
+man page).</para>
+
+<note>
+  <para>You can use the
+  <parameter>refentry.source.name.suppress</parameter> and
+  <parameter>refentry.version.suppress</parameter> parameters to
+  independently suppress the <replaceable>Name</replaceable> and
+  <replaceable>Version</replaceable> parts of the
+  <literal>extra2</literal> field.</para>
+</note>
+
+</refsect1>
+</refentry>
diff --git a/xsl/params/man.th.extra3.max.length.xml b/xsl/params/man.th.extra3.max.length.xml
new file mode 100644 (file)
index 0000000..5406da3
--- /dev/null
@@ -0,0 +1,37 @@
+<refentry id="man.th.extra3.max.length">
+<refmeta>
+<refentrytitle>man.th.extra3.max.length</refentrytitle>
+<refmiscinfo role="type">integer</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>man.th.extra3.max.length</refname>
+<refpurpose>Maximum length of extra3 in header/footer</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='man.th.extra3.max.length.frag'>
+<xsl:param name="man.th.extra3.max.length">30</xsl:param>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>Specifies the maximum permitted length of the
+<literal>extra3</literal> part of the man-page <literal>.TH</literal>
+title line header/footer. If the <literal>extra3</literal> content
+exceeds the maxiumum specified, it is truncated down to the maximum
+permitted length.</para>
+
+<para>The content of the <literal>extra3</literal> field is usually
+displayed in the middle header of the page and is typically a "manual
+name"; for example, "GTK+ User's Manual" (from the
+<literal>gtk-options(7)</literal> man page).</para>
+
+<para>The default value for this parameter is reasonable but somewhat
+arbitrary. If you are processing pages with long "manual names" -- or
+especially if you are processing pages that have both long "title"
+parts (command/function, etc. names) <emphasis>and</emphasis> long
+manual names -- you may want to experiment with changing the value in
+order to achieve the correct aesthetic results.</para>
+</refsect1>
+</refentry>
diff --git a/xsl/params/man.th.extra3.suppress.xml b/xsl/params/man.th.extra3.suppress.xml
new file mode 100644 (file)
index 0000000..b7c51c1
--- /dev/null
@@ -0,0 +1,29 @@
+<refentry id="man.th.extra3.suppress">
+<refmeta>
+<refentrytitle>man.th.extra3.suppress</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>man.th.extra3.suppress</refname>
+<refpurpose>Suppress extra3 part of header/footer?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='man.th.extra3.suppress.frag'>
+<xsl:param name="man.th.extra3.suppress">0</xsl:param></src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If the value of <parameter>man.th.extra3.suppress</parameter> is
+non-zero, then the <literal>extra3</literal> part of the
+<literal>.TH</literal> title line header/footer is
+suppressed.</para>
+
+<para>The content of the <literal>extra3</literal> field is usually
+displayed in the middle header of the page and is typically a "manual
+name"; for example, "GTK+ User's Manual" (from the
+<literal>gtk-options(7)</literal> man page).</para>
+
+</refsect1>
+</refentry>
index 778c594e622d028569ac7d580f976d39e893c67d..c07d20ab5121054f5a43d396d4fef35df21c784b 100644 (file)
@@ -5,7 +5,7 @@
 </refmeta>
 <refnamediv>
 <refname>man.th.title.max.length</refname>
-<refpurpose>Maximum length of title in TH title line</refpurpose>
+<refpurpose>Maximum length of title in header/footer</refpurpose>
 </refnamediv>
 
 <refsynopsisdiv>
@@ -17,8 +17,9 @@
 <refsect1><title>Description</title>
 
 <para>Specifies the maximum permitted length of the title part of the
-man-page TH title line. If the title exceeds the maxiumum specified,
-it is truncated down to the maximum permitted length.</para>
+man-page <literal>.TH</literal> title line header/footer. If the title
+exceeds the maxiumum specified, it is truncated down to the maximum
+permitted length.</para>
 
 <refsect2>
   <title>Details</title>