List:Commits« Previous MessageNext Message »
From:paul Date:February 8 2008 8:06pm
Subject:svn commit - mysqldoc@docsrva: r9753 - in trunk: . make.d tools/MySQL/DynXML xsl.d
View as plain text  
Author: paul
Date: 2008-02-08 21:06:20 +0100 (Fri, 08 Feb 2008)
New Revision: 9753

Log:
 r29069@arctic:  paul | 2008-02-08 14:04:57 -0600
 Strip command option summary tables from manpages (they're unneeded for
 this output format). The implementation has two parts:
 - The dynamic-docs script that generates the tables adds a
   role="commandoptions" attribute to each <table> element so that they
   can be recognized.
 - dbk-prep.xsl recognizes the role and drops the affected tables from the
   output if $strip.command.options.tables is non-zero.


Modified:
   trunk/make.d/xml-prep
   trunk/tools/MySQL/DynXML/Optvar.pm
   trunk/xsl.d/dbk-prep.xsl

Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:34985
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:29021
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:29065
   + 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:34985
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:29021
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:29069


Modified: trunk/make.d/xml-prep
===================================================================
--- trunk/make.d/xml-prep	2008-02-08 19:20:29 UTC (rev 9752)
+++ trunk/make.d/xml-prep	2008-02-08 20:06:20 UTC (rev 9753)
Changed blocks: 1, Lines Added: 7, Lines Deleted: 4; 1184 bytes

@@ -50,15 +50,18 @@
 	mv $@.tmp $@
 endif
 
-# For manpage preprocessing, suppress the mapping of <refentry>
-# elements to <section> elements that is done by default.
-# Also, manpages are GPL rather than copyright, so select the GPL
-# copyright text from legalnotice.$(DOC_LANG).xml.
+# For manpage preprocessing:
+# - Suppress the mapping of <refentry> elements to <section> elements
+#   that is done by default.
+# - Manpages are GPL rather than copyright, so select the GPL
+#   copyright text from legalnotice.$(DOC_LANG).xml.
+# - Strip the dynamic command option tables. These are not useful in manpages.
 
 %-manprepped.xml: %.xml $(DBK_PREP_XSL_DEPS) $(GET_SVN_REVISION) $(BUG_PREP)
 	$(XSLTPROC) \
 		--stringparam repository.revision "`$(GET_SVN_REVISION)`" \
 		--param map.refentry.to.section 0 \
+		--param strip.command.option.tables 1 \
 		--stringparam legalnotice.type "legalnotice-gpl" \
 		--stringparam qandaset.style "$(QANDASET_STYLE)" \
 		--param strip.ads 1 \


Modified: trunk/tools/MySQL/DynXML/Optvar.pm
===================================================================
--- trunk/tools/MySQL/DynXML/Optvar.pm	2008-02-08 19:20:29 UTC (rev 9752)
+++ trunk/tools/MySQL/DynXML/Optvar.pm	2008-02-08 20:06:20 UTC (rev 9753)
Changed blocks: 2, Lines Added: 6, Lines Deleted: 1; 814 bytes

@@ -266,6 +266,11 @@
     return($idlist);
 }
 
+# The role="commandoptions" attribute for the <table> element
+# enables this type of table to be recognized so that it can be
+# ignored for production of manpages, for which these tables are
+# not useful.
+
 sub commandoptions_summary_table
 {
     my ($td,$idlist,$options) = @_;

@@ -278,7 +283,7 @@
     my $outfile = IO::String->new();
 
     print $outfile <<EOF;
-<table>
+<table role="commandoptions">
 <title><command>$options->{command}</command> Option Reference</title>
 <tgroup cols="4">
 <colspec colwidth="20*"/>


Modified: trunk/xsl.d/dbk-prep.xsl
===================================================================
--- trunk/xsl.d/dbk-prep.xsl	2008-02-08 19:20:29 UTC (rev 9752)
+++ trunk/xsl.d/dbk-prep.xsl	2008-02-08 20:06:20 UTC (rev 9753)
Changed blocks: 1, Lines Added: 17, Lines Deleted: 0; 991 bytes

@@ -226,6 +226,23 @@
   </xsl:template>
 
   <!--
+    For manpage production, strip command option summary tables, which
+    are <table> elements with a role attribute of "commandoptions".
+  -->
+
+  <xsl:param name="strip.command.option.tables" select="0"/>
+
+  <xsl:template match="table[@role='commandoptions']">
+    <xsl:if test="$strip.command.option.tables = 0">
+      <!-- pass table through unchanged -->
+      <table>
+        <xsl:copy-of select="@*"/>
+        <xsl:apply-templates/>
+      </table>
+    </xsl:if>
+  </xsl:template>
+
+  <!--
     Strip advertisements if $strip.ads is non-zero. Setting this non-zero
     can be done for prep formats where we know that we don't need the ads.
     (For example, manpage prep.) For prep formats that are used in common


Thread
svn commit - mysqldoc@docsrva: r9753 - in trunk: . make.d tools/MySQL/DynXML xsl.dpaul8 Feb