You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by he...@apache.org on 2007/01/18 18:40:28 UTC

svn commit: r497508 - in /velocity/docbook/trunk: README build-docbook.xml docbook.properties src/styles/custom.xsl src/styles/html.xsl src/styles/html/titlepage.xml src/styles/htmlsingle.xsl src/styles/pdf.xsl src/styles/pdf/titlepage.xml

Author: henning
Date: Thu Jan 18 09:40:25 2007
New Revision: 497508

URL: http://svn.apache.org/viewvc?view=rev&rev=497508
Log:
Make the docbook framework really standalone, it loads all specific
stuff from the project.


Added:
    velocity/docbook/trunk/src/styles/custom.xsl
Removed:
    velocity/docbook/trunk/src/styles/html/titlepage.xml
    velocity/docbook/trunk/src/styles/pdf/titlepage.xml
Modified:
    velocity/docbook/trunk/README
    velocity/docbook/trunk/build-docbook.xml
    velocity/docbook/trunk/docbook.properties
    velocity/docbook/trunk/src/styles/html.xsl
    velocity/docbook/trunk/src/styles/htmlsingle.xsl
    velocity/docbook/trunk/src/styles/pdf.xsl

Modified: velocity/docbook/trunk/README
URL: http://svn.apache.org/viewvc/velocity/docbook/trunk/README?view=diff&rev=497508&r1=497507&r2=497508
==============================================================================
--- velocity/docbook/trunk/README (original)
+++ velocity/docbook/trunk/README Thu Jan 18 09:40:25 2007
@@ -1,5 +1,5 @@
-		      Velocity DocBook Framework
-		      ==========================
+		       DocBook Framework (DBF)
+		       =======================
 
 
 This project started out as a framework to render documentation for
@@ -183,7 +183,7 @@
 build-docbook.xml contains three main targets: pdf, html and
 htmlsingle. Each is responsible for rendering one format.
 
-Most settings are done in the project.properties file and there should
+Most settings are done in the docbook.properties file and there should
 be no need to change these properties.
 
 

Modified: velocity/docbook/trunk/build-docbook.xml
URL: http://svn.apache.org/viewvc/velocity/docbook/trunk/build-docbook.xml?view=diff&rev=497508&r1=497507&r2=497508
==============================================================================
--- velocity/docbook/trunk/build-docbook.xml (original)
+++ velocity/docbook/trunk/build-docbook.xml Thu Jan 18 09:40:25 2007
@@ -19,21 +19,21 @@
 <project name="docbook" default="all" basedir=".">
 
   <!-- Load our properties -->
-  <property file="docbook.properties"/>
+  <property file="${dbf.basedir}/docbook.properties"/>
 
   <!-- ======================================================================== -->
   <!-- ==                                                                    == -->
   <!-- == Set up the classpath for the XSLT conversion                       == -->
   <!-- ==                                                                    == -->
   <!-- ======================================================================== -->
-  <path id="docbook.classpath">
-    <fileset dir="${docbook.basedir}/lib">
+  <path id="dbf.classpath">
+    <fileset dir="${dbf.basedir}/lib">
       <include name="*.jar"/>
     </fileset>
-    <fileset dir="${docbook.xsl.dir}/extensions">
+    <fileset dir="${dbf.xsl.dir}/extensions">
       <include name="${xslt-db.jar}"/>
     </fileset>
-    <pathelement location="${docbook.basedir}"/>
+    <pathelement location="${dbf.basedir}"/>
   </path>
 
   <!-- ======================================================================== -->
@@ -41,12 +41,12 @@
   <!-- == Prepare Path elements to be used when filtering the XSL files      == -->
   <!-- ==                                                                    == -->
   <!-- ======================================================================== -->
-  <path id="docbook.xml.path" location="${docbook.xml.dir}"/>
-  <path id="docbook.xsl.path" location="${docbook.xsl.dir}"/>
+  <path id="dbf.xml.path" location="${dbf.xml.dir}"/>
+  <path id="dbf.xsl.path" location="${dbf.xsl.dir}"/>
   <path id="src.dir.path" location="${src.dir}"/>
   <path id="tmp.dir.path" location="${tmp.dir}"/>
-  <pathconvert dirsep="/" property="docbook.xml.path" refid="docbook.xml.path"/>
-  <pathconvert dirsep="/" property="docbook.xsl.path" refid="docbook.xsl.path"/>
+  <pathconvert dirsep="/" property="dbf.xml.path" refid="dbf.xml.path"/>
+  <pathconvert dirsep="/" property="dbf.xsl.path" refid="dbf.xsl.path"/>
   <pathconvert dirsep="/" property="src.dir.path" refid="src.dir.path"/>
   <pathconvert dirsep="/" property="tmp.dir.path" refid="tmp.dir.path"/>
 
@@ -59,11 +59,11 @@
 
   <!-- This filterset is used to convert the style sheets to reference
        the actual locations of the docbook XSLT files -->
-  <filterset id="filterset.docbook.location">
+  <filterset id="filterset.dbf.location">
     <filter token="paper.type" value="${paper.type}" />
     <filter token="file.prefix" value="${file.prefix}" />
-    <filter token="docbook.xml" value="${docbook.xml.path}" />
-    <filter token="docbook.xsl" value="${docbook.xsl.path}" />
+    <filter token="dbf.xml" value="${dbf.xml.path}" />
+    <filter token="dbf.xsl" value="${dbf.xsl.path}" />
     <filter token="src.dir" value="${src.dir.path}" />
     <filter token="tmp.dir" value="${tmp.dir.path}" />
   </filterset>
@@ -83,7 +83,7 @@
     <attribute name="style"/>
     <sequential>
       <java classname="com.icl.saxon.StyleSheet" fork="true"
-            dir="${basedir}" classpathref="docbook.classpath">
+            dir="${basedir}" classpathref="dbf.classpath">
         <arg line="-x org.apache.xml.resolver.tools.ResolvingXMLReader"/>
         <arg line="-y org.apache.xml.resolver.tools.ResolvingXMLReader"/>
         <arg line="-r org.apache.xml.resolver.tools.CatalogResolver"/>
@@ -113,27 +113,44 @@
     <attribute name="target"/>
     <attribute name="dir"/>
     <attribute name="file"/>
+    <attribute name="xsl"/>
     <sequential>
 
     <property name="@{type}.target.dir" value="${target.dir}/@{dir}/@{target}"/>
     <property name="@{type}.target.file" value="${@{type}.target.dir}/@{file}"/>
     <property name="@{type}.tmp.style" value="${tmp.dir}/@{type}.xsl"/>
+    <property name="@{type}.tmp.custom" value="${tmp.dir}/@{type}-style.xsl"/>
+    <property name="@{type}.tmp.titlepage" value="${tmp.dir}/@{type}-titlepage"/>
 
     <path id="@{type}.target.path" location="${@{type}.target.dir}"/>
     <pathconvert dirsep="/" property="@{type}.target.path" refid="@{type}.target.path"/>
 
-    <copy overwrite="true" filtering="on" file="${style.src.dir}/@{type}.xsl" tofile="${@{type}.tmp.style}">
-      <filterset refid="filterset.docbook.location"/>
+    <copy overwrite="true" filtering="on" file="${dbf.style.src.dir}/@{type}.xsl" tofile="${@{type}.tmp.style}">
+      <filterset refid="filterset.dbf.location"/>
       <filterset>
         <filter token="@{type}.target.dir" value="${@{type}.target.path}" />
       </filterset>
     </copy>
 
+    <copy overwrite="true" failonerror="false" filtering="on" file="${style.src.dir}/@{type}/custom.xsl" tofile="${@{type}.tmp.custom}">
+      <filterset refid="filterset.dbf.location"/>
+      <filterset>
+        <filter token="@{type}.target.dir" value="${@{type}.target.path}" />
+      </filterset>
+    </copy>
+
+    <!-- No custom style file around. Use the vanilla one. -->
+    <copy overwrite="false" failonerror="true" file="${dbf.style.src.dir}/custom.xsl" tofile="${@{type}.tmp.custom}"/>
+
     <mkdir dir="${@{type}.target.dir}/" />
 
-    <saxon input="${src.dir}/styles/@{title}/titlepage.xml"
-           output="${tmp.dir}/@{title}-titlepage.xsl"
-           style="${docbook.xsl.dir}/template/titlepage.xsl"/>
+    <!-- copy custom title page. If we don't have one, use the custom one. -->
+    <copy file="${src.dir}/styles/@{title}/titlepage.xml" tofile="${@{type}.tmp.titlepage}.xml" overwrite="true" failonerror="false" />
+    <copy file="${dbf.xsl.dir}/@{xsl}/titlepage.templates.xml" tofile="${@{type}.tmp.titlepage}.xml" overwrite="false" failonerror="true" />
+
+    <saxon input="${@{type}.tmp.titlepage}.xml"
+           output="${@{type}.tmp.titlepage}.xsl"
+           style="${dbf.xsl.dir}/template/titlepage.xsl"/>
 
     <copy todir="${@{type}.target.dir}/images">
       <fileset dir="${src.dir}/images"/>
@@ -164,11 +181,11 @@
       </condition>
     </fail>
 
-    <fail message="You must configure the docbook.basedir from your project.properties. That is usually ${basedir}/docbook!">
+    <fail message="You must configure the dbf.basedir from your project.properties. That is usually ${basedir}/docbook!">
       <condition>
         <not>
           <and>
-            <isset property="docbook.basedir"/>
+            <isset property="dbf.basedir"/>
           </and>
         </not>
       </condition>
@@ -176,11 +193,11 @@
 
     <mkdir dir="${tmp.dir}" />
 
-    <mkdir dir="${docbook.xml.dir}" />
-    <unzip src="${zip.src.dir}/docbook-xml-${docbook.xml.version}.zip" dest="${docbook.xml.dir}" />
+    <mkdir dir="${dbf.xml.dir}" />
+    <unzip src="${dbf.zip.src.dir}/docbook-xml-${dbf.xml.version}.zip" dest="${dbf.xml.dir}" />
 
-    <mkdir dir="${docbook.xsl.dir}" />
-    <unzip src="${zip.src.dir}/docbook-xsl-${docbook.xsl.version}.zip" dest="${target.dir}" />
+    <mkdir dir="${dbf.xsl.dir}" />
+    <unzip src="${dbf.zip.src.dir}/docbook-xsl-${dbf.xsl.version}.zip" dest="${target.dir}" />
   </target>
 
   <!-- ======================================================================== -->
@@ -198,6 +215,17 @@
   <!-- ======================================================================== -->
   <target name="clean"
           description="--> Delete temporary and distribution directories for docs">
+
+    <fail message="You must configure the dbf.basedir from your project.properties. That is usually ${basedir}/docbook!">
+      <condition>
+        <not>
+          <and>
+            <isset property="dbf.basedir"/>
+          </and>
+        </not>
+      </condition>
+    </fail>
+
     <delete quiet="true" dir="${target.dir}"/>
   </target>
 
@@ -210,12 +238,12 @@
           depends="prepare"
           description="--> Generate PDF docs">
 
-    <transform type="pdf" target="tmp" title="pdf" dir="${docbook.dir}" file="${docbook.file}"/>
+    <transform type="pdf" target="tmp" title="pdf" xsl="fo" dir="${docbook.dir}" file="${docbook.file}"/>
 
     <mkdir dir="${target.dir}/${docbook.dir}/pdf"/>
 
     <java classname="org.apache.fop.apps.Fop" fork="true" maxmemory="256m"
-          dir="${basedir}" classpathref="docbook.classpath">
+          dir="${basedir}" classpathref="dbf.classpath">
       <arg value="${pdf.target.file}.xml"/>
       <arg value="${target.dir}/${docbook.dir}/pdf/${docbook.file}.pdf"/>
     </java>
@@ -230,10 +258,10 @@
           depends="prepare"
           description="--> Generate HTML docs in multiple files">
 
-    <transform type="html" target="html" title="html" dir="${docbook.dir}" file="${docbook.file}"/>
+    <transform type="html" target="html" title="html" xsl="html" dir="${docbook.dir}" file="${docbook.file}"/>
 
     <copy todir="${html.target.dir}/images">
-      <fileset dir="${docbook.xsl.dir}/images/"/>
+      <fileset dir="${dbf.xsl.dir}/images/"/>
     </copy>
 
     <copy todir="${html.target.dir}/css">
@@ -257,10 +285,10 @@
           depends="prepare"
           description="--> Generate HTML docs in a single, big file">
 
-    <transform type="htmlsingle" target="htmlsingle" title="html" dir="${docbook.dir}" file="${docbook.file}"/>
+    <transform type="htmlsingle" target="htmlsingle" title="html" xsl="html" dir="${docbook.dir}" file="${docbook.file}"/>
 
     <copy todir="${htmlsingle.target.dir}/images">
-      <fileset dir="${docbook.xsl.dir}/images/"/>
+      <fileset dir="${dbf.xsl.dir}/images/"/>
     </copy>
 
     <copy todir="${htmlsingle.target.dir}/css">

Modified: velocity/docbook/trunk/docbook.properties
URL: http://svn.apache.org/viewvc/velocity/docbook/trunk/docbook.properties?view=diff&rev=497508&r1=497507&r2=497508
==============================================================================
--- velocity/docbook/trunk/docbook.properties (original)
+++ velocity/docbook/trunk/docbook.properties Thu Jan 18 09:40:25 2007
@@ -14,14 +14,17 @@
 
 # The docbook XML and Style sheet versions used.
 # These must match the archives in src/zip!
-docbook.xml.version = 4.4
-docbook.xsl.version = 1.70.0
+dbf.xml.version = 4.4
+dbf.xsl.version = 1.70.0
 
 # Where all the sources are located
-docbook.src.dir = ${docbook.basedir}/src
+dbf.src.dir = ${dbf.basedir}/src
 
 # Location of the docbook reference archives
-docbook.zip.src.dir = ${docbook.src.dir}/zip
+dbf.zip.src.dir = ${dbf.src.dir}/zip
+
+# Location of the generic style xsl files.
+dbf.style.src.dir = ${dbf.src.dir}/styles
 
 ########################################################################
 #
@@ -35,7 +38,7 @@
 paper.type= Letter
 
 # Target Directory
-target.dir = ${docbook.basedir}/target
+target.dir = ${dbf.basedir}/target
 
 # Directory for temporary files
 tmp.dir = ${target.dir}/tmp
@@ -43,8 +46,8 @@
 ########################################################################
 
 # Directories into which the docbook reference archives are expanded
-docbook.xml.dir = ${target.dir}/docbook-xml-${docbook.xml.version}
-docbook.xsl.dir = ${target.dir}/docbook-xsl-${docbook.xsl.version}
+dbf.xml.dir = ${target.dir}/docbook-xml-${dbf.xml.version}
+dbf.xsl.dir = ${target.dir}/docbook-xsl-${dbf.xsl.version}
 
 # We use SAXON as our XSLT processor and this is the custom jar included with
 # the docbook XML distribution.

Added: velocity/docbook/trunk/src/styles/custom.xsl
URL: http://svn.apache.org/viewvc/velocity/docbook/trunk/src/styles/custom.xsl?view=auto&rev=497508
==============================================================================
--- velocity/docbook/trunk/src/styles/custom.xsl (added)
+++ velocity/docbook/trunk/src/styles/custom.xsl Thu Jan 18 09:40:25 2007
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 2006 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License")
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version='1.0'>
+
+</xsl:stylesheet>

Modified: velocity/docbook/trunk/src/styles/html.xsl
URL: http://svn.apache.org/viewvc/velocity/docbook/trunk/src/styles/html.xsl?view=diff&rev=497508&r1=497507&r2=497508
==============================================================================
--- velocity/docbook/trunk/src/styles/html.xsl (original)
+++ velocity/docbook/trunk/src/styles/html.xsl Thu Jan 18 09:40:25 2007
@@ -19,8 +19,8 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 version='1.0'>
 
-  <xsl:import href="@file.prefix@@docbook.xsl@/html/chunk.xsl" />
-  <xsl:import href="@file.prefix@@src.dir@/styles/html/custom.xsl" />
+  <xsl:import href="@file.prefix@@dbf.xsl@/html/chunk.xsl" />
+  <xsl:import href="@file.prefix@@tmp.dir@/html-style.xsl" />
   <xsl:include href="@file.prefix@@tmp.dir@/html-titlepage.xsl" />
 
   <!-- Do not use the file.prefix and make sure that you keep the trailing slash! -->

Modified: velocity/docbook/trunk/src/styles/htmlsingle.xsl
URL: http://svn.apache.org/viewvc/velocity/docbook/trunk/src/styles/htmlsingle.xsl?view=diff&rev=497508&r1=497507&r2=497508
==============================================================================
--- velocity/docbook/trunk/src/styles/htmlsingle.xsl (original)
+++ velocity/docbook/trunk/src/styles/htmlsingle.xsl Thu Jan 18 09:40:25 2007
@@ -19,8 +19,8 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 version='1.0'>
 
-  <xsl:import href="@file.prefix@@docbook.xsl@/html/docbook.xsl" />
-  <xsl:import href="@file.prefix@@src.dir@/styles/html/custom.xsl" />
+  <xsl:import href="@file.prefix@@dbf.xsl@/html/docbook.xsl" />
+  <xsl:import href="@file.prefix@@tmp.dir@/html-style.xsl" />
   <xsl:include href="@file.prefix@@tmp.dir@/html-titlepage.xsl" />
 
 </xsl:stylesheet>

Modified: velocity/docbook/trunk/src/styles/pdf.xsl
URL: http://svn.apache.org/viewvc/velocity/docbook/trunk/src/styles/pdf.xsl?view=diff&rev=497508&r1=497507&r2=497508
==============================================================================
--- velocity/docbook/trunk/src/styles/pdf.xsl (original)
+++ velocity/docbook/trunk/src/styles/pdf.xsl Thu Jan 18 09:40:25 2007
@@ -19,19 +19,10 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 version='1.0'>
 
-  <xsl:import href="@file.prefix@@docbook.xsl@/fo/docbook.xsl" />
-  <xsl:import href="@file.prefix@@src.dir@/styles/pdf/custom.xsl" />
-  <xsl:include href="@file.prefix@@tmp.dir@/pdf-titlepage.xsl" />
-
-<!-- ##################################################################
-     # Admonitions - Must be here or the filter does not get applied! #
-     ################################################################## -->   
+  <xsl:import href="@file.prefix@@dbf.xsl@/fo/docbook.xsl" />
+  <xsl:import href="@file.prefix@@tmp.dir@/pdf-style.xsl" />
 
-  <!-- Use nice graphics for admonitions -->
-  <xsl:param name="admon.graphics">'1'</xsl:param>
-  <xsl:param name="admon.graphics.path">@file.prefix@@docbook.xsl@/images/</xsl:param>
-  <xsl:param name="draft.watermark.image" select="'@file.prefix@@docbook.xsl@/images/draft.png'"/>
-  <xsl:param name="paper.type" select="'@paper.type@'"/>
+  <xsl:include href="@file.prefix@@tmp.dir@/pdf-titlepage.xsl" />
 
 </xsl:stylesheet>