List:Commits« Previous MessageNext Message »
From:paul Date:July 5 2007 11:48pm
Subject:svn commit - mysqldoc@docsrva: r7027 - in trunk: . make.d xsl.d
View as plain text  
Author: paul
Date: 2007-07-05 23:48:18 +0200 (Thu, 05 Jul 2007)
New Revision: 7027

Log:
 r27312@polar:  paul | 2007-07-05 16:40:20 -0500
 Add %.todos transform (a variant of %.remarks that extracts only
 remarks with a role of "todo")


Modified:
   trunk/make.d/xml-remark
   trunk/xsl.d/extract-remark.xsl

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


Modified: trunk/make.d/xml-remark
===================================================================
--- trunk/make.d/xml-remark	2007-07-05 20:28:18 UTC (rev 7026)
+++ trunk/make.d/xml-remark	2007-07-05 21:48:18 UTC (rev 7027)
Changed blocks: 1, Lines Added: 27, Lines Deleted: 8; 1705 bytes

@@ -1,23 +1,42 @@
-# target rules for extracting and counting <remark> elements
-# (these often are todo items, so this helps us see what we
-# still need to do)
+# Target rules for extracting and counting <remark> elements.
+# The todo-variant extracts only those remarks with a role of "todo".
+# These transforms help us identify outstanding issues that need to
+# be take care of.
 
-# Extract <remark> elements
+# Extract or count <remark> elements
 
 %.remarks: %-remprepped.xml $(EXTRACT_REMARK_XSL_DEPS)
-	$(XSLTPROC) --output - $(EXTRACT_REMARK_XSL) $< | $(WRAP_REMARK) > $@-tmp
+	$(XSLTPROC) \
+		--output - \
+		$(EXTRACT_REMARK_XSL) \
+		$< \
+	| $(WRAP_REMARK) > $@-tmp
 	mv $@-tmp $@
 
-# Count <remark> elements
-
 %.remark-count: %-remprepped.xml $(COUNT_REMARK_XSL_DEPS)
-	$(XSLTPROC) --output $@-tmp $(COUNT_REMARK_XSL) $<
+	$(XSLTPROC) \
+		--output $@-tmp \
+		$(COUNT_REMARK_XSL) \
+		$<
 	mv $@-tmp $@
 
+# Extract only <remark> elements with a role of "todo"
+
+%.todos: %-remprepped.xml $(EXTRACT_REMARK_XSL_DEPS)
+	$(XSLTPROC) \
+		--param todos.only 1 \
+		--output - \
+		$(EXTRACT_REMARK_XSL) \
+		$< \
+	| $(WRAP_REMARK) > $@-tmp
+	mv $@-tmp $@
+
 clean::
 	$(RM) *.remarks *.remarks-tmp
 	$(RM) *.remark-count *.remark-count-tmp
+	$(RM) *.todos *.todos-tmp
 
 help::
 	@echo "make file.remarks         - extract <remark> elements from file.xml"
 	@echo "make file.remark-count    - count <remark> elements in file.xml"
+	@echo "make file.todos           - extract todo <remark> elements from file.xml"


Modified: trunk/xsl.d/extract-remark.xsl
===================================================================
--- trunk/xsl.d/extract-remark.xsl	2007-07-05 20:28:18 UTC (rev 7026)
+++ trunk/xsl.d/extract-remark.xsl	2007-07-05 21:48:18 UTC (rev 7027)
Changed blocks: 3, Lines Added: 20, Lines Deleted: 12; 1838 bytes

@@ -14,6 +14,9 @@
   - appendix
   - section
 
+  if $todos.only is zero, extract all remarks.
+  if $todos.only is non-zero, extract only remarks with @role="todo".
+
   TODO:
   - Can I process titles without explicitly pulling them?
   - Map special chars

@@ -32,6 +35,9 @@
 <!-- define explicit newline variable that contains a newline character -->
 <xsl:variable name="newline" select="'&#xA;'"/>
 
+<!-- extract only remarks with @role="todo"? (default: extract all) -->
+<xsl:param name="todos.only" select="0"/>
+
 <!--
   Important default behaviors:
   - Default element processing rule is to apply-templates to the

@@ -67,19 +73,21 @@
 -->
 
 <xsl:template match="remark">
-  <xsl:text>-- </xsl:text>
-  <xsl:if test="@role != ''">
-    <xsl:text>[</xsl:text>
-    <xsl:value-of select="@role"/>
-    <xsl:text>] </xsl:text>
+  <xsl:if test="$todos.only = 0 or @role = 'todo'">
+    <xsl:text>-- </xsl:text>
+    <xsl:if test="@role != ''">
+      <xsl:text>[</xsl:text>
+      <xsl:value-of select="@role"/>
+      <xsl:text>] </xsl:text>
+    </xsl:if>
+    <xsl:variable name="text">
+      <xsl:apply-templates mode="get.contents"/>
+    </xsl:variable>
+    <xsl:call-template name="map-text">
+      <xsl:with-param name="text" select="normalize-space($text)"/>
+    </xsl:call-template>
+    <xsl:value-of select="$newline"/>
   </xsl:if>
-  <xsl:variable name="text">
-    <xsl:apply-templates mode="get.contents"/>
-  </xsl:variable>
-  <xsl:call-template name="map-text">
-    <xsl:with-param name="text" select="normalize-space($text)"/>
-  </xsl:call-template>
-  <xsl:value-of select="$newline"/>
 </xsl:template>
 
 <!--


Thread
svn commit - mysqldoc@docsrva: r7027 - in trunk: . make.d xsl.dpaul5 Jul