You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2006/01/20 01:37:39 UTC

svn commit: r370683 - in /maven/maven-1/plugins/trunk/xdoc: plugin.jelly plugin.properties xdocs/changes.xml xdocs/properties.xml

Author: ltheussl
Date: Thu Jan 19 16:37:34 2006
New Revision: 370683

URL: http://svn.apache.org/viewcvs?rev=370683&view=rev
Log:
PR: MPXDOC-183
Submitted by: Niall Pemberton
Enable user-defined custom templates

Modified:
    maven/maven-1/plugins/trunk/xdoc/plugin.jelly
    maven/maven-1/plugins/trunk/xdoc/plugin.properties
    maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml
    maven/maven-1/plugins/trunk/xdoc/xdocs/properties.xml

Modified: maven/maven-1/plugins/trunk/xdoc/plugin.jelly
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/plugin.jelly?rev=370683&r1=370682&r2=370683&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/xdoc/plugin.jelly Thu Jan 19 16:37:34 2006
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- 
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-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.
@@ -694,25 +694,29 @@
            value="${maven.docs.outputencoding}"
          />
     </j:if>
-    
+
     <j:forEach var="pomDocument" items="${pomDocuments}">
 
+      <j:set var="templateBaseDir" value="${plugin.resources}/templates"/>
+      <util:available file="${maven.xdoc.custom.templateDir}/${pomDocument}">
+          <j:set var="templateBaseDir" value="${maven.xdoc.custom.templateDir}"/>
+      </util:available>
       <!-- If the template ends with ".xml" use velocity to generate the 
            HTML. If it ends with ".jelly" use JSL. -->
       <j:choose>
         <j:when test="${pomDocument.endsWith('.xml')}">
           <velocity:merge 
             name="${maven.gen.docs}/${pomDocument}"
-            basedir="${plugin.resources}/templates"
+            basedir="${templateBaseDir}"
             template="${pomDocument}"
             inputEncoding="${encoding}"
-            outputEncoding="${encoding}" 
+            outputEncoding="${encoding}"
           />
         </j:when>
         <j:when test="${pomDocument.endsWith('.jelly')}">
           <doc:jslFile
             output="${maven.gen.docs}/${pomDocument.substring(0,pomDocument.indexOf('.jelly'))}.xml"
-            stylesheet="${plugin.resources}/templates/${pomDocument}"
+            stylesheet="${templateBaseDir}/${pomDocument}"
             outputMode="xml"
             prettyPrint="no"/>
         </j:when>

Modified: maven/maven-1/plugins/trunk/xdoc/plugin.properties
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/plugin.properties?rev=370683&r1=370682&r2=370683&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/plugin.properties (original)
+++ maven/maven-1/plugins/trunk/xdoc/plugin.properties Thu Jan 19 16:37:34 2006
@@ -72,6 +72,10 @@
                          team-list.xml,\
                          downloads.jelly
 
+# Custom user template directory,
+# if not defined, ${plugin.resources}/templates is used by plugin.jelly
+#maven.xdoc.custom.templateDir=
+
 # List of xml files (or patterns) that are copied but not transformed
 #maven.xdoc.xml.copy=
 

Modified: maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml?rev=370683&r1=370682&r2=370683&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml Thu Jan 19 16:37:34 2006
@@ -27,6 +27,7 @@
   </properties>
   <body>
     <release version="1.10-SNAPSHOT" date="in SVN">
+      <action dev="ltheussl" type="add" issue="MPXDOC-183" due-to="Niall Pemberton">Enable user-defined custom templates.</action>
       <action dev="ltheussl" type="fix" issue="MPXDOC-187">Correct cvs checkout instructions on cvs-usage page.</action>
       <action dev="ltheussl" type="fix" issue="MPXDOC-125" due-to="Shinobu Kawai Yoshida">Url and timezone not used for contributor.</action>
       <action dev="ltheussl" type="fix" issue="MPXDOC-186">Mailing list links break if the address starts with http.</action>

Modified: maven/maven-1/plugins/trunk/xdoc/xdocs/properties.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/xdocs/properties.xml?rev=370683&r1=370682&r2=370683&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/xdocs/properties.xml (original)
+++ maven/maven-1/plugins/trunk/xdoc/xdocs/properties.xml Thu Jan 19 16:37:34 2006
@@ -280,6 +280,19 @@
           </td>
         </tr>
         <tr>
+          <td>maven.xdoc.custom.templateDir</td>
+          <td>Yes</td>
+          <td>
+            A directory where custom templates for Maven generated sites may
+            be defined. The template files should have the same names as
+            the ones used by the xdoc plugin (<code>mail-lists.xml</code>,
+            <code>issue-tracking.xml</code>, etc.). By default, the templates
+            in the <code>${plugin.resources}/templates</code> directory
+            of the xdoc plugin are used.
+          </td>
+        </tr>
+        
+        <tr>
           <td>maven.xdoc.crumb.separator</td>
           <td>Yes</td>
           <td>The separator between links. Defaults to <code>|</code></td>