svn commit: r550334 - in /activemq/camel/trunk: camel-book/pom.xml camel-book/src/styles/docbook.xsl tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r550334 - in /activemq/camel/trunk: camel-book/pom.xml camel-book/src/styles/docbook.xsl tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java

jlim-2
Author: jlim
Date: Sun Jun 24 20:38:15 2007
New Revision: 550334

URL: http://svn.apache.org/viewvc?view=rev&rev=550334
Log:
- updated docbook xsl to catch the first h1 heading and make it the chapter title
- change phase to site phase

Modified:
    activemq/camel/trunk/camel-book/pom.xml
    activemq/camel/trunk/camel-book/src/styles/docbook.xsl
    activemq/camel/trunk/tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java

Modified: activemq/camel/trunk/camel-book/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-book/pom.xml?view=diff&rev=550334&r1=550333&r2=550334
==============================================================================
--- activemq/camel/trunk/camel-book/pom.xml (original)
+++ activemq/camel/trunk/camel-book/pom.xml Sun Jun 24 20:38:15 2007
@@ -58,7 +58,7 @@
             <goals>
               <goal>htmlToDocbook</goal>
             </goals>
-            <phase>generate-sources</phase>
+            <phase>site</phase>
           </execution>
         </executions>        
         <configuration>
@@ -91,7 +91,7 @@
               <goal>generate-html</goal>
               <goal>generate-manpages</goal>
             </goals>
-            <phase>generate-sources</phase>
+            <phase>site</phase>
           </execution>
         </executions>
         <dependencies>

Modified: activemq/camel/trunk/camel-book/src/styles/docbook.xsl
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-book/src/styles/docbook.xsl?view=diff&rev=550334&r1=550333&r2=550334
==============================================================================
--- activemq/camel/trunk/camel-book/src/styles/docbook.xsl (original)
+++ activemq/camel/trunk/camel-book/src/styles/docbook.xsl Sun Jun 24 20:38:15 2007
@@ -26,14 +26,17 @@
  <xsl:param name="bridgeprefix">br_</xsl:param>
  <xsl:param name="root_url" select="div/@baseURL"/>
  <!-- This template converts each "wiki-content maincontent" DIV  into a DocBook
-     section.  -->
+     section. For a title, it selects the first h1 element  -->
  <xsl:template match="div[contains(@class,'wiki-content maincontent')]">
  <chapter >
  <xsl:attribute name="id">
  <xsl:value-of select="@chapterId"/>
  </xsl:attribute>
  <title>
- <xsl:value-of select="@chapterTitle"/>
+ <xsl:value-of
+ select=".//h1[1]
+                         |.//h2[1]
+                         |.//h3[1]"/>
  </title>
  <section>
  <xsl:if test="$filename != ''">

Modified: activemq/camel/trunk/tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java?view=diff&rev=550334&r1=550333&r2=550334
==============================================================================
--- activemq/camel/trunk/tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java (original)
+++ activemq/camel/trunk/tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java Sun Jun 24 20:38:15 2007
@@ -130,7 +130,6 @@
 
  private String chapterId;
 
- private String chapterTitle;
 
  public void execute() throws MojoExecutionException {
  File outputDir = new File(outputPath);
@@ -143,7 +142,6 @@
 
  for (int i = 0; i < resources.length; ++i) {
  this.setChapterId( removeExtension(resources[i]));
- this.setChapterTitle( removeExtension(resources[i]));
 
  process(resources[i]);
  }
@@ -184,7 +182,6 @@
  // These attributes will be used by xsl to
  Element element = (Element) node;
  element.setAttribute("chapterId", chapterId);
- element.setAttribute("chapterTitle", chapterTitle);
  element.setAttribute("baseURL", baseURL);
  element.setAttribute("imageLocation", "..\\images\\");
 
@@ -370,14 +367,7 @@
  this.chapterId = chapterId;
  }
 
- public String getChapterTitle() {
- return chapterTitle;
- }
 
- public void setChapterTitle(String chapterTitle) {
- this.chapterTitle = chapterTitle;
- }
-
  public String removeExtension(String resource) {
  int index = resource.indexOf('.');
  return resource.substring(0, index);