Jrst-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
January 2009
- 1 participants
- 10 discussions
Author: chatellier
Date: 2009-01-16 18:21:20 +0000 (Fri, 16 Jan 2009)
New Revision: 253
Modified:
jrst/trunk/src/site/site_en.xml
jrst/trunk/src/site/site_fr.xml
Log:
Correction du lien des releases
Modified: jrst/trunk/src/site/site_en.xml
===================================================================
--- jrst/trunk/src/site/site_en.xml 2009-01-16 17:56:03 UTC (rev 252)
+++ jrst/trunk/src/site/site_en.xml 2009-01-16 18:21:20 UTC (rev 253)
@@ -36,7 +36,7 @@
<item href="/user/index.html" name="About"/>
<item href="/user/RSTpresentation.html" name="A ReStructuredText Primer"/>
<item href="/user/functionality.html" name="Functionalities suggested"/>
- <item href="http://labs.libre-entreprise.org/frs/?group_id=54&release_id=252" name="download"/>
+ <item href="http://labs.libre-entreprise.org/frs/?group_id=54" name="Download"/>
</menu>
Modified: jrst/trunk/src/site/site_fr.xml
===================================================================
--- jrst/trunk/src/site/site_fr.xml 2009-01-16 17:56:03 UTC (rev 252)
+++ jrst/trunk/src/site/site_fr.xml 2009-01-16 18:21:20 UTC (rev 253)
@@ -36,7 +36,7 @@
<item href="/user/index.html" name="Présentation du JRST"/>
<item href="/user/presentationRST.html" name="Introduction à ReStructuredText"/>
<item href="/user/fonctionnalites.html" name="Fonctionnalités incluses"/>
- <item href="http://labs.libre-entreprise.org/frs/?group_id=54&release_id=252" name="Télécharger"/>
+ <item href="http://labs.libre-entreprise.org/frs/?group_id=54" name="Télécharger"/>
</menu>
<menu name="Developpeur">
1
0
16 Jan '09
Author: chatellier
Date: 2009-01-16 17:56:03 +0000 (Fri, 16 Jan 2009)
New Revision: 252
Modified:
jrst/trunk/src/main/resources/xsl/rst2xhtml.xsl
Log:
Ajout d'une balise <a> s'il y a un target sur l'image
Modified: jrst/trunk/src/main/resources/xsl/rst2xhtml.xsl
===================================================================
--- jrst/trunk/src/main/resources/xsl/rst2xhtml.xsl 2009-01-16 17:14:33 UTC (rev 251)
+++ jrst/trunk/src/main/resources/xsl/rst2xhtml.xsl 2009-01-16 17:56:03 UTC (rev 252)
@@ -241,7 +241,15 @@
</xsl:template>
<xsl:template match="image">
- <img alt="{@alt}" src="{@uri}"><xsl:apply-templates/></img>
+ <!-- todo manage heigth and witdh -->
+ <xsl:if test="@target">
+ <a href="{@target}">
+ <img alt="{@alt}" src="{@uri}"><xsl:apply-templates/></img>
+ </a>
+ </xsl:if>
+ <xsl:if test="not(@target)">
+ <img alt="{@alt}" src="{@uri}"><xsl:apply-templates/></img>
+ </xsl:if>
</xsl:template>
1
0
r251 - jrst/trunk/src/main/java/org/codelutin/jrst/directive
by chatellier@users.labs.libre-entreprise.org 16 Jan '09
by chatellier@users.labs.libre-entreprise.org 16 Jan '09
16 Jan '09
Author: chatellier
Date: 2009-01-16 17:14:33 +0000 (Fri, 16 Jan 2009)
New Revision: 251
Modified:
jrst/trunk/src/main/java/org/codelutin/jrst/directive/ImageDirective.java
Log:
Ne match pas avec des \\s+ car la ligne est trim()?\195?\169e apres
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/directive/ImageDirective.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/directive/ImageDirective.java 2009-01-16 13:39:59 UTC (rev 250)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/directive/ImageDirective.java 2009-01-16 17:14:33 UTC (rev 251)
@@ -63,7 +63,7 @@
}
result.addAttribute("uri", e.attributeValue(JRSTLexer.DIRECTIVE_VALUE));
- Pattern arg = Pattern.compile("\\s+:([^:]+):\\s*(.*)");
+ Pattern arg = Pattern.compile(":([^:]+):\\s*(.*)");
String[] lines = e.getText().split("\n");
for (String l : lines) {
Matcher matcher = arg.matcher(l.trim());
1
0
r250 - jrst/trunk/src/main/java/org/codelutin/jrst
by chatellier@users.labs.libre-entreprise.org 16 Jan '09
by chatellier@users.labs.libre-entreprise.org 16 Jan '09
16 Jan '09
Author: chatellier
Date: 2009-01-16 13:39:59 +0000 (Fri, 16 Jan 2009)
New Revision: 250
Modified:
jrst/trunk/src/main/java/org/codelutin/jrst/ReStructuredText.java
Log:
Suppression du caractere _ final dans les liens inline
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/ReStructuredText.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/ReStructuredText.java 2009-01-16 13:26:49 UTC (rev 249)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/ReStructuredText.java 2009-01-16 13:39:59 UTC (rev 250)
@@ -187,7 +187,7 @@
public static final Pattern REGEX_REFERENCE = Pattern
.compile("(http://[-/%#[\\&&&[^(>)]]\\._\\w]+\\w+)((\\W|&|$)+)");
public static final Pattern REGEX_INLINE_REFERENCE = Pattern
- .compile("`(.+) \\<\\;(http://[-/%#&\\._\\w]+)(\\>\\;)`");
+ .compile("`(.+) \\<\\;(http://[-/%#&\\._\\w]+)(\\>\\;)`_");
public static final Pattern REGEX_EMAIL = Pattern
.compile("(^|[^_\\w])([-\\._\\w]+(a)[-\\._\\w]+)([^-\\._\\w]|$)");
public static final Pattern REGEX_FOOTNOTE_REFERENCE = Pattern
1
0
r249 - in jrst/trunk: . src/main/resources/xsl
by chatellier@users.labs.libre-entreprise.org 16 Jan '09
by chatellier@users.labs.libre-entreprise.org 16 Jan '09
16 Jan '09
Author: chatellier
Date: 2009-01-16 13:26:49 +0000 (Fri, 16 Jan 2009)
New Revision: 249
Modified:
jrst/trunk/changelog.txt
jrst/trunk/src/main/resources/xsl/rst2xhtml.xsl
Log:
Fix summary anchor problem
Modified: jrst/trunk/changelog.txt
===================================================================
--- jrst/trunk/changelog.txt 2009-01-15 18:31:16 UTC (rev 248)
+++ jrst/trunk/changelog.txt 2009-01-16 13:26:49 UTC (rev 249)
@@ -1,5 +1,6 @@
ver-0.8.4 xxx 2009XXXX
+ * Fix anchor in content
* Update xml2rst.xsl stylesheet
* Re add i18n plugin on build
* Reenable tests during maven build
Modified: jrst/trunk/src/main/resources/xsl/rst2xhtml.xsl
===================================================================
--- jrst/trunk/src/main/resources/xsl/rst2xhtml.xsl 2009-01-15 18:31:16 UTC (rev 248)
+++ jrst/trunk/src/main/resources/xsl/rst2xhtml.xsl 2009-01-16 13:26:49 UTC (rev 249)
@@ -21,12 +21,10 @@
<xsl:template match="title">
<xsl:if test="name(..)='document'">
<h1 class="mainTitle">
-
<xsl:apply-templates/>
</h1>
-
-
</xsl:if>
+
<xsl:if test="not(name(..)='document')">
<xsl:element name="h{count(ancestor::section) + 1}">
<xsl:attribute name="class">title</xsl:attribute>
@@ -36,7 +34,6 @@
<xsl:if test="not(@refid)">
<xsl:apply-templates/>
</xsl:if>
-
</xsl:element>
</xsl:if>
</xsl:template>
@@ -113,6 +110,7 @@
</xsl:template>
<xsl:template match="section">
+ <a name="{@id}"></a>
<xsl:apply-templates/>
</xsl:template>
@@ -134,8 +132,6 @@
</xsl:if>
<xsl:if test="not(@refid)">
<a href="{@refuri}" id="{@id}"><xsl:apply-templates/></a>
-
-
</xsl:if>
</xsl:template>
@@ -192,9 +188,11 @@
</xsl:template>
<xsl:template match="field">
+
<xsl:if test="not(../../docinfo)">
<div class="field"><xsl:apply-templates/></div>
</xsl:if>
+
<xsl:if test="../../docinfo">
<tr>
<th class="docinfo-name">
@@ -204,20 +202,16 @@
<xsl:apply-templates select="field_body/*"/>
</td>
</tr>
-
</xsl:if>
</xsl:template>
<xsl:template match="field_name">
<span class="field_name"><xsl:apply-templates/></span>
-
-
</xsl:template>
<xsl:template match="field_body">
<span class="field_body"><xsl:apply-templates/></span>
-
</xsl:template>
<xsl:template match="definition_list">
@@ -261,10 +255,10 @@
<p class="header"><xsl:apply-templates/></p>
<hr/>
</xsl:template>
+
<!--
| Table
+-->
-
<xsl:template match="table">
<table border="1">
<colgroup>
@@ -331,7 +325,6 @@
<xsl:template match="block_quote">
<blockquote>
-
<xsl:if test="./attribution">
<p><xsl:apply-templates select="child::*[position()=1]"/></p>
<p class="attribution">
@@ -340,9 +333,9 @@
</xsl:if>
<xsl:if test="not(./attribution)">
<xsl:apply-templates select="child::*"/>
-
</xsl:if>
</blockquote>
+
</xsl:template>
<xsl:template match="doctest_block">
@@ -399,9 +392,7 @@
<col class="option" />
<col class="description" />
<tbody valign="top">
-
<xsl:apply-templates/>
-
</tbody>
</table>
</xsl:template>
1
0
r248 - in jrst/trunk: . src/main/java/org/codelutin/jrst src/main/resources/i18n src/site src/test/java/org/codelutin/jrst src/test/resources
by chatellier@users.labs.libre-entreprise.org 15 Jan '09
by chatellier@users.labs.libre-entreprise.org 15 Jan '09
15 Jan '09
Author: chatellier
Date: 2009-01-15 18:31:16 +0000 (Thu, 15 Jan 2009)
New Revision: 248
Added:
jrst/trunk/src/main/resources/i18n/jrst-en_GB.properties
Removed:
jrst/trunk/build-release.sh
jrst/trunk/src/main/resources/i18n/jrst-en_US.properties
Modified:
jrst/trunk/changelog.txt
jrst/trunk/pom.xml
jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java
jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java
jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java
jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java
jrst/trunk/src/main/resources/i18n/jrst-fr_FR.properties
jrst/trunk/src/site/site_en.xml
jrst/trunk/src/site/site_fr.xml
jrst/trunk/src/test/java/org/codelutin/jrst/AdvancedReaderTest.java
jrst/trunk/src/test/java/org/codelutin/jrst/Compare.java
jrst/trunk/src/test/java/org/codelutin/jrst/GutterColor.java
jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java
jrst/trunk/src/test/java/org/codelutin/jrst/JRSTReaderTest.java
jrst/trunk/src/test/java/org/codelutin/jrst/ThreadRedirection.java
jrst/trunk/src/test/java/org/codelutin/jrst/XMLCaseTest.java
jrst/trunk/src/test/resources/test2.rst
jrst/trunk/src/test/resources/text.rst
Log:
Re add i18n plugin on build
Reenable tests during maven build
Move test to junit 4
Switch to lutinproject 3.3
Deleted: jrst/trunk/build-release.sh
===================================================================
--- jrst/trunk/build-release.sh 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/build-release.sh 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-APP_NAME=jrst
-
-# script pour la creation d'un zip de release
-
-if [ "$USER" = "poussin" ]; then
- LABS_LOGIN=bpoussin
-else
- LABS_LOGIN=$USER
-fi
-
-dir=$(dirname $0)
-cd $dir
-
-VER=$(xmlstarlet sel -N "p=http://maven.apache.org/POM/4.0.0" -t -v "/p:project/p:version" pom.xml)
-RELEASE=${APP_NAME}-$VER
-echo "build release $RELEASE"
-
-# recuperation de tous les jar dans un r�pertoire
-# target/${APP_NAME}-$VER/WEB-INF/lib/
-echo "prepare jar ..."
-mvn -o compile jar:jar war:war
-
-# creation du repertoire cible
-TARGET=/tmp/$RELEASE
-mkdir -p $TARGET/lib
-
-echo "copy library ..."
-cp target/$RELEASE/WEB-INF/lib/* $TARGET/lib
-echo "copy ${APP_NAME} ..."
-cp target/$RELEASE.jar $TARGET
-
-# creation du Class Path
-echo "create classpath ..."
-cd $TARGET
-SEPW=";"
-SEP=":"
-CP=$RELEASE.jar
-CPW=$RELEASE.jar
-for f in lib/*; do
- CP="$CP$SEP$f"
- CPW="$CPW$SEPW$f"
-done
-
-echo "create script ..."
-cat << EOF > $TARGET/${APP_NAME}.bat
-java -cp $CPW org.codelutin.jrst.JRST %1 %2 %3 %4 %5 %6 %7 %8 %9
-EOF
-
-cat << EOF > $TARGET/${APP_NAME}.sh
-java -cp $CP org.codelutin.jrst.JRST \$*
-EOF
-
-chmod +x $TARGET/${APP_NAME}.sh
-
-echo "create zip /tmp/$RELEASE.zip ..."
-cd /tmp
-zip -q -r $RELEASE.zip $RELEASE
-
-echo "copy zip to labs ..."
-ssh $LABS_LOGIN(a)labs.libre-entreprise.org "mkdir -p /home/groups/${APP_NAME}/htdocs/download"
-scp $RELEASE.zip $LABS_LOGIN@labs.libre-entreprise.org:/home/groups/${APP_NAME}/htdocs/download/
Modified: jrst/trunk/changelog.txt
===================================================================
--- jrst/trunk/changelog.txt 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/changelog.txt 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,4 +1,12 @@
-ver-0.8 xxx xxx
+ver-0.8.4 xxx 2009XXXX
+
+ * Update xml2rst.xsl stylesheet
+ * Re add i18n plugin on build
+ * Reenable tests during maven build
+ * Move test to junit 4
+ * switch to lutinproject 3.3
+
+ver-0.8.3 chemit 20081009
* Add title property in xdoc xslt
* Switch license to lgpl
Modified: jrst/trunk/pom.xml
===================================================================
--- jrst/trunk/pom.xml 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/pom.xml 2009-01-15 18:31:16 UTC (rev 248)
@@ -31,9 +31,6 @@
<!-- nom du projet sur le labs -->
<labs.project>jrst</labs.project>
-
- <!-- Test -->
- <maven.test.skip>true</maven.test.skip>
<!-- Site en et fr -->
<maven.site.locales>fr,en</maven.site.locales>
@@ -48,7 +45,21 @@
<build>
<plugins>
+ <!-- i18n -->
<plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-i18n-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>parserJava</goal>
+ <goal>gen</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -15,18 +15,6 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-/* *
- * DocumentWalker.java
- *
- * Created: 30 oct. 06 10:28:10
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package org.codelutin.jrst;
import org.apache.commons.logging.Log;
@@ -39,10 +27,16 @@
import java.util.List;
/**
+ * DocumentWalker.
+ *
+ * Created: 30 oct. 06 10:28:10
+ *
* @author poussin
- *
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-
public class DocumentWalker {
static private Log log = LogFactory.getLog(DocumentWalker.class);
@@ -63,7 +57,6 @@
handler.endDocument(doc);
}
- @SuppressWarnings("unchecked")
public void walk(Element elem) {
handler.startElement(elem);
for (Node node : (List<Node>) elem.content()) {
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -28,6 +28,33 @@
*/
package org.codelutin.jrst;
+import static org.codelutin.i18n.I18n._;
+
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.URIResolver;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamSource;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.fop.apps.FOUserAgent;
@@ -41,37 +68,13 @@
import org.dom4j.Document;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
+
import uk.co.flamingpenguin.jewel.cli.Cli;
import uk.co.flamingpenguin.jewel.cli.CliFactory;
import uk.co.flamingpenguin.jewel.cli.CommandLineInterface;
import uk.co.flamingpenguin.jewel.cli.Option;
import uk.co.flamingpenguin.jewel.cli.Unparsed;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.stream.StreamSource;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-
/**
* FIXME: 'JRST --help' doesn't work, but 'JRST --help toto' work :( FIXME:
* 'JRST -c' doesn't work, but 'JRST -c toto'
@@ -155,8 +158,12 @@
}
static public void main(String[] args) throws Exception {
- if (args.length == 0)
+
+ I18n.init();
+
+ if (args.length == 0) {
args = askOption();
+ }
if (args == null) {
System.exit(0);
}
@@ -216,6 +223,7 @@
*/
private static String[] askOptionGraph() throws SecurityException,
NoSuchMethodException {
+
Method m = JRSTOption.class.getMethod("getOutType");
Option a = m.getAnnotation(Option.class);
JRSTInterface graph = new JRSTInterface(a.pattern());
@@ -232,23 +240,24 @@
*/
private static String[] askOptionText() throws IOException {
// language
- if (Locale.getDefault().getLanguage() == "fr")
+ /*if (Locale.getDefault().getLanguage() == "fr")
I18n.init("fr", "FR");
else
- I18n.init("en", "US");
- ResourceBundle bundle = ResourceBundle
- .getBundle("org.codelutin.i18n.I18nBundleBridge");
- System.out.println(bundle.getString("help?"));
+ I18n.init("en", "US");*/
+
+ //I18n.init();
+
+ System.out.println(_("help?"));
Boolean done = false;
String cheminRST = "";
while (!done) {
- System.out.println(bundle.getString("rstFile?"));
+ System.out.println(_("rstFile?"));
cheminRST = lireFile(false, false);
if (cheminRST.length() == 0)
System.exit(0);
File fileRST = new File(cheminRST);
if (!fileRST.exists()) {
- System.out.println(bundle.getString("dontExist"));
+ System.out.println(_("dontExist"));
cheminRST = "";
} else
done = true;
@@ -257,7 +266,7 @@
String type = "";
while (!done) {
type = "";
- System.out.println(bundle.getString("outputFormat?"));
+ System.out.println(_("outputFormat?"));
type = lire();
if (type.matches("xhtml|docbook|xml|html|xdoc|rst|pdf|odt|rtf")
|| type.length() == 0)
@@ -267,7 +276,7 @@
if (type.length() == 0) {
done = false;
while (!done) {
- System.out.println(bundle.getString("xslFile?"));
+ System.out.println(_("xslFile?"));
String cheminXSLtmp = lireFile(false, true);
File fileRST = new File(cheminXSLtmp);
@@ -278,12 +287,12 @@
done = true;
} else {
if (!fileRST.exists()) {
- System.out.println(bundle.getString("dontExist"));
+ System.out.println(_("dontExist"));
} else {
cheminXSL += cheminXSLtmp;
String other = "";
do {
- System.out.println(bundle.getString("other?"));
+ System.out.println(_("other?"));
other = lire();
} while (!other.matches("y|n|o"));
if (other.equals("y") || other.equals("o"))
@@ -303,14 +312,14 @@
done = false;
String cheminSortie = "";
while (!done) {
- System.out.println(bundle.getString("outputFile?"));
+ System.out.println(_("outputFile?"));
cheminSortie = lireFile(true, true);
File fileRST = new File(cheminSortie);
if (fileRST.exists()) {
String strEcraser = "";
do {
- System.out.println(bundle.getString("overwrite?"));
+ System.out.println(_("overwrite?"));
strEcraser = lire();
} while (!strEcraser.matches("y|n|o"));
if (strEcraser.equals("y") || strEcraser.equals("o")) {
@@ -415,6 +424,24 @@
throw new FileNotFoundException("Can't find stylesheet: "
+ xsl);
}
+
+ // add uri resolver
+ /*gen.setUriResolver(new URIResolver() {
+ public Source resolve(String href, String base) {
+ System.out.println("RESOLVING: href: "+href+" base: "+base);
+
+ return null;
+ try {
+ System.out.println("RESOLVING: href: "+href+" base: "+base);
+ StreamSource ss = new StreamSource(new FileInputStream(new File(href)));
+ return ss;
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+ });*/
+
doc = gen.transform(doc, stylesheet);
}
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -18,6 +18,8 @@
*/
package org.codelutin.jrst;
+import static org.codelutin.i18n.I18n._;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
@@ -29,7 +31,6 @@
import java.io.File;
import java.util.LinkedList;
import java.util.Locale;
-import java.util.ResourceBundle;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
@@ -106,24 +107,16 @@
private ImageIcon open = Resource.getIcon("icone/open.png");
private ImageIcon delete = Resource.getIcon("icone/cancel.png");
private ImageIcon more = Resource.getIcon("icone/more.gif");
- private ResourceBundle bundle = null;
private LinkedList<Container> composantsXSL = null;
/**
* le parametre initialise les options disponibles
*
- * @param String
- * o
+ * @param o
*/
public JRSTInterface(String o) {
- // language
- if (Locale.getDefault().getLanguage() == "fr")
- I18n.init("fr", "FR");
- else
- I18n.init("en", "US");
- bundle = ResourceBundle
- .getBundle("org.codelutin.i18n.I18nBundleBridge");
+
this.setFormats(o);
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
this.setTitle("JRST");
@@ -178,7 +171,7 @@
private JButton getBoutonConvertir() {
if (boutonConvertir == null) {
boutonConvertir = new JButton();
- boutonConvertir.setText(bundle.getString("btnConvert"));
+ boutonConvertir.setText(_("btnConvert"));
boutonConvertir.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
convert();
@@ -191,7 +184,7 @@
private JButton getBoutonAnnuler() {
if (boutonAnnuler == null) {
boutonAnnuler = new JButton();
- boutonAnnuler.setText(bundle.getString("btnCancel"));
+ boutonAnnuler.setText(_("btnCancel"));
boutonAnnuler.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
annuler();
@@ -389,7 +382,7 @@
private JRadioButton getXslRadio() {
if (xslRadio == null) {
- xslRadio = new JRadioButton(bundle.getString("externalXSL"));
+ xslRadio = new JRadioButton(_("externalXSL"));
}
return xslRadio;
}
@@ -411,7 +404,7 @@
if (savePanel == null) {
savePanel = new JPanel();
savePanel.setLayout(new FlowLayout());
- savePanel.add(new JLabel(bundle.getString("saveAs")));
+ savePanel.add(new JLabel(_("saveAs")));
savePanel.add(getSaveText());
savePanel.add(getBoutonSaveLocation());
}
@@ -436,7 +429,7 @@
if (openPanel == null) {
openPanel = new JPanel();
openPanel.setLayout(new FlowLayout());
- openPanel.add(new JLabel(bundle.getString("open")));
+ openPanel.add(new JLabel(_("open")));
openPanel.add(getOpenText());
openPanel.add(getBoutonOpenLocation());
}
@@ -502,8 +495,7 @@
}
public int askEcraser() {
- int choix = JOptionPane.showConfirmDialog(this, bundle
- .getObject("overwriteGraph?"));
+ int choix = JOptionPane.showConfirmDialog(this, _("overwriteGraph?"));
return choix;
}
@@ -519,7 +511,7 @@
private void convert() {
boolean exit = false;
if (getOpenText().getText().equals("")) {
- getErrorLabel().setText(bundle.getString("openEmpty?"));
+ getErrorLabel().setText(_("openEmpty?"));
getErrorLabel().setForeground(Color.RED);
this.pack();
} else {
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -394,7 +394,7 @@
return result;
} catch (Exception eee) {
- log.error(_("JRST parsing error line {0} char {1}:\n{2}", lexer
+ log.error(_("JRST parsing error line %d char %s:\n%s", lexer
.getLineNumber(), lexer.getCharNumber(), lexer
.readNotBlanckLine()));
throw eee;
@@ -596,8 +596,7 @@
anonym.addAttribute("anonymous", "1");
idMax++;
anonym.addAttribute("id", "id" + idMax);
- anonym
- .addAttribute("refuri", e.attributeValue("refuri")
+ anonym.addAttribute("refuri", e.attributeValue("refuri")
.trim());
eTargetAnonymous.add(anonym);
eTargetAnonymousCopy.add(anonym);
Added: jrst/trunk/src/main/resources/i18n/jrst-en_GB.properties
===================================================================
--- jrst/trunk/src/main/resources/i18n/jrst-en_GB.properties (rev 0)
+++ jrst/trunk/src/main/resources/i18n/jrst-en_GB.properties 2009-01-15 18:31:16 UTC (rev 248)
@@ -0,0 +1,20 @@
+JRST\ parsing\ error\ line\ %d\ char\ %s\:\\n%s=JRST parsing error line %d char %s\:\\n%s
+annuler=.. to cancel or return to parent directory
+btnCancel=Cancel
+btnConvert=Convert
+dontExist=Invalid file path
+entrer=Enter to display file list, or to complete path
+exit=Enter "\!q" to exit
+externalXSL=External(s) XSL(s)
+help?=JRST --help to display help
+open=Open file \:
+openEmpty?=This field must be fill in.
+other?=Want you add an other XSL file ?(y/n)
+outputFile?=Please enter outpout path (empty to display in console)
+outputFormat?=Please enter output format (xhtml, docbook, xml(by default), html, xdoc, rst, pdf, odt ou rtf)\n(empty to enter XSL files to use)
+overwrite?=This file exists, do you want to overwrite it ? (y/n)
+overwriteGraph?=This file existe, do you want to overwrite it ?
+rstFile?=Please enter reStructuredText file path (empty to exit)
+save=Enter "\!s" in the end of the file name to save
+saveAs=Save as \:
+xslFile?=Please enter XSL file path (XML output if empty)
Deleted: jrst/trunk/src/main/resources/i18n/jrst-en_US.properties
===================================================================
--- jrst/trunk/src/main/resources/i18n/jrst-en_US.properties 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/main/resources/i18n/jrst-en_US.properties 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,19 +0,0 @@
-help?=JRST\ \-\-help\ to\ display\ help
-rstFile?=Please\ enter\ reStructuredText\ file\ path\ \(empty\ to\ exit\)
-dontExist=Invalid\ file\ path
-outputFormat?=Please\ enter\ output\ format \(xhtml\,\ docbook\,\ xml\(by\ default\)\,\ html\,\ xdoc\,\ rst\,\ pdf\,\ odt\ ou\ rtf\)\n\(empty\ to\ enter\ XSL\ files\ to\ use\)
-xslFile?=Please\ enter\ XSL\ file\ path\ \(XML\ output\ if\ empty\)
-outputFile?=Please\ enter\ outpout\ path\ \(empty\ to\ display\ in\ console\)
-overwrite?=This\ file\ exists\,\ do\ you\ want\ to\ overwrite\ it\ \?\ \(y\/n\)
-btnConvert=Convert
-btnCancel=Cancel
-externalXSL=External(s) XSL\(s\)
-saveAs=Save as \:
-open=Open file \:
-overwriteGraph?=This file existe, do you want to overwrite it \?
-openEmpty?=This field must be fill in.
-other?=Want you add an other XSL file \?\(y\/n\)
-annuler=\.\.\ to\ cancel\ or\ return\ to\ parent\ directory
-entrer=Enter\ to\ display\ file\ list\,\ or\ to\ complete\ path
-save=Enter \"\!s\" in the end of the file name to save
-exit=Enter \"\!q\" to exit
\ No newline at end of file
Modified: jrst/trunk/src/main/resources/i18n/jrst-fr_FR.properties
===================================================================
--- jrst/trunk/src/main/resources/i18n/jrst-fr_FR.properties 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/main/resources/i18n/jrst-fr_FR.properties 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,19 +1,20 @@
+JRST\ parsing\ error\ line\ %d\ char\ %s\:\\n%s=
+annuler=.. pour annuler ou pour revenir au repertoire precedent
+btnCancel=Annuler
+btnConvert=Convertir
+dontExist=Ce fichier n'existe pas
+entrer=Entrer pour afficher la liste des fichiers, ou pour completer le chemin
+exit=Saisir "\!q" pour quitter
+externalXSL=XSL(s) externe(s)
help?=JRST --help pour afficher l'aide
+open=Ouvrir le fichier \:
+openEmpty?=Ce champ doit etre rempli.
+other?=Voulez-vous ajouter un autre fichier XSL ?(o/n)
+outputFile?=Veuillez saisir le chemin du fichier sortie (Laissez vide pour l'afficher dans la sortie standard)
+outputFormat?=Veuillez saisir le format de sortie (xhtml, docbook, xml(par default), html, xdoc, rst, pdf, odt ou rtf)\n(Laissez vide pour specifier le ou les XSL de generations \u00E0 utiliser)
+overwrite?=Ce fichier existe, etes-vous sur de vouloir ecraser le fichier ?(o/n)
+overwriteGraph?=Ce fichier existe, etes-vous sur de vouloir ecraser le fichier ?
rstFile?=Veuillez saisir le chemin du fichier reStructuredText (Laissez vide pour quitter)
-dontExist=Ce fichier n'existe pas
-outputFormat?=Veuillez saisir le format de sortie (xhtml, docbook, xml(par default), html, xdoc, rst, pdf, odt ou rtf)\n(Laissez vide pour specifier le ou les XSL de generations à utiliser)
+save=Saisir "\!s" a la fin du nom de fichier pour l'enregistrer
+saveAs=Enregistrer sous \:
xslFile?=Veuillez saisir le chemin du fichier XSL (Sortie XML si vide)
-outputFile?=Veuillez saisir le chemin du fichier sortie (Laissez vide pour l'afficher dans la sortie standard)
-overwrite?=Ce fichier existe, etes-vous sur de vouloir ecraser le fichier \?\(o\/n\)
-other?=Voulez-vous ajouter un autre fichier XSL \?\(o\/n\)
-btnConvert=Convertir
-btnCancel=Annuler
-externalXSL=XSL\(s\) externe\(s\)
-saveAs=Enregistrer sous \:
-open=Ouvrir le fichier \:
-overwriteGraph?=Ce fichier existe, etes-vous sur de vouloir ecraser le fichier \?
-openEmpty?=Ce champ doit etre rempli.
-annuler=\.\.\ pour\ annuler\ ou\ pour\ revenir\ au\ repertoire\ precedent
-entrer=Entrer\ pour\ afficher\ la\ liste\ des\ fichiers\,\ ou\ pour\ completer\ le\ chemin
-save=Saisir \"\!s\" a la fin du nom de fichier pour l\'enregistrer
-exit=Saisir \"\!q\" pour quitter
\ No newline at end of file
Modified: jrst/trunk/src/site/site_en.xml
===================================================================
--- jrst/trunk/src/site/site_en.xml 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/site/site_en.xml 2009-01-15 18:31:16 UTC (rev 248)
@@ -4,11 +4,12 @@
<skin>
<groupId>org.codelutin</groupId>
<artifactId>maven-lutin-skin</artifactId>
- <version>0.2</version>
+ <version>0.2.2</version>
</skin>
<bannerLeft>
<name>Java ReStructuredText parser</name>
+ <href>/</href>
</bannerLeft>
<bannerRight>
Modified: jrst/trunk/src/site/site_fr.xml
===================================================================
--- jrst/trunk/src/site/site_fr.xml 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/site/site_fr.xml 2009-01-15 18:31:16 UTC (rev 248)
@@ -4,11 +4,12 @@
<skin>
<groupId>org.codelutin</groupId>
<artifactId>maven-lutin-skin</artifactId>
- <version>0.2</version>
+ <version>0.2.2</version>
</skin>
<bannerLeft>
<name>Java ReStructuredText parser</name>
+ <href>/</href>
</bannerLeft>
<bannerRight>
Modified: jrst/trunk/src/test/java/org/codelutin/jrst/AdvancedReaderTest.java
===================================================================
--- jrst/trunk/src/test/java/org/codelutin/jrst/AdvancedReaderTest.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/test/java/org/codelutin/jrst/AdvancedReaderTest.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,5 +1,5 @@
/* *##% JRst
- * Copyright (C) 2004 - 2008 CodeLutin
+ * Copyright (C) 2004 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -15,50 +15,47 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-/* *
- * AdvancedReaderTest.java
- *
- * Created: 27 oct. 06 01:03:26
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package org.codelutin.jrst;
-import junit.framework.TestCase;
-
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
+import java.io.IOException;
import java.io.StringReader;
import java.io.Writer;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
/**
+ * AdvancedReaderTest.
+ *
+ * Created: 27 oct. 06 01:03:26
+ *
* @author poussin
- *
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
+public class AdvancedReaderTest {
-public class AdvancedReaderTest extends TestCase {
-
- String text = "\t\t\n" + "1 toto tata tutu\n" + "2 toto tata tutu\n"
+ protected String text = "\t\t\n" + "1 toto tata tutu\n" + "2 toto tata tutu\n"
+ "3 toto tata tutu\n" + "4 toto tata tutu\n"
+ "5 toto tata tutu\n" + "6 toto tata tutu\n"
+ "7 toto tata tutu\n" + "8 toto tata tutu\n"
+ "9 toto tata tutu\n";
- File file = null;
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
+ protected File file;
+
+ /**
+ * setUp - create test file.
+ * @throws IOException
*/
- public AdvancedReaderTest() throws Exception {
+ @Before
+ public void setUp() throws IOException {
file = File.createTempFile("test-AdvancedReader", ".txt");
file.deleteOnExit();
@@ -69,211 +66,219 @@
/**
* Test method for {@link org.codelutin.jrst.AdvancedReader#eof()}.
+ * @throws IOException
*/
- public void testEof() throws Exception {
+ @Test
+ public void testEof() throws IOException {
AdvancedReader in = new AdvancedReader(new FileReader(file));
- assertFalse(in.eof());
+ Assert.assertFalse(in.eof());
in.readAll();
- assertTrue(in.eof());
+ Assert.assertTrue(in.eof());
in = new AdvancedReader(new StringReader(text));
- assertFalse(in.eof());
+ Assert.assertFalse(in.eof());
in.readAll();
- assertTrue(in.eof());
+ Assert.assertTrue(in.eof());
}
/**
* Test method for
- * {@link org.codelutin.jrst.AdvancedReader#skip_blank_lines()}.
+ * {@link org.codelutin.jrst.AdvancedReader#skipBlankLines()}.
+ * @throws IOException
*/
- public void testSkipBlankLines() throws Exception {
+ public void testSkipBlankLines() throws IOException {
{
AdvancedReader in = new AdvancedReader(new FileReader(file));
in.skipBlankLines();
String line = in.readLine();
- assertEquals("1 toto tata tutu", line);
+ Assert.assertEquals("1 toto tata tutu", line);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
in.skipBlankLines();
String line = in.readLine();
- assertEquals("1 toto tata tutu", line);
+ Assert.assertEquals("1 toto tata tutu", line);
}
}
/**
* Test method for {@link org.codelutin.jrst.AdvancedReader#readAll()}.
+ * @throws IOException
*/
- public void testReadAll() throws Exception {
+ public void testReadAll() throws IOException {
{
AdvancedReader in = new AdvancedReader(new FileReader(file));
String[] lines = in.readAll();
- assertEquals(10, lines.length);
- assertEquals("\t\t", lines[0]);
- assertEquals("1 toto tata tutu", lines[1]);
- assertEquals("9 toto tata tutu", lines[9]);
+ Assert.assertEquals(10, lines.length);
+ Assert.assertEquals("\t\t", lines[0]);
+ Assert.assertEquals("1 toto tata tutu", lines[1]);
+ Assert.assertEquals("9 toto tata tutu", lines[9]);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
String[] lines = in.readAll();
- assertEquals(10, lines.length);
- assertEquals("\t\t", lines[0]);
- assertEquals("1 toto tata tutu", lines[1]);
- assertEquals("9 toto tata tutu", lines[9]);
+ Assert.assertEquals(10, lines.length);
+ Assert.assertEquals("\t\t", lines[0]);
+ Assert.assertEquals("1 toto tata tutu", lines[1]);
+ Assert.assertEquals("9 toto tata tutu", lines[9]);
}
}
/**
* Test method for {@link org.codelutin.jrst.AdvancedReader#readLines(int)}.
+ * @throws IOException
*/
- public void testReadLines() throws Exception {
+ public void testReadLines() throws IOException {
{
AdvancedReader in = new AdvancedReader(new FileReader(file));
String[] lines = in.readLines(3);
- assertEquals(3, lines.length);
- assertEquals("\t\t", lines[0]);
- assertEquals("1 toto tata tutu", lines[1]);
- assertEquals("2 toto tata tutu", lines[2]);
+ Assert.assertEquals(3, lines.length);
+ Assert.assertEquals("\t\t", lines[0]);
+ Assert.assertEquals("1 toto tata tutu", lines[1]);
+ Assert.assertEquals("2 toto tata tutu", lines[2]);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
String[] lines = in.readLines(3);
- assertEquals(3, lines.length);
- assertEquals("\t\t", lines[0]);
- assertEquals("1 toto tata tutu", lines[1]);
- assertEquals("2 toto tata tutu", lines[2]);
+ Assert.assertEquals(3, lines.length);
+ Assert.assertEquals("\t\t", lines[0]);
+ Assert.assertEquals("1 toto tata tutu", lines[1]);
+ Assert.assertEquals("2 toto tata tutu", lines[2]);
}
}
/**
* Test method for
* {@link org.codelutin.jrst.AdvancedReader#readUntil(java.lang.String)}.
+ * @throws IOException
*/
- public void testReadUntil() throws Exception {
+ public void testReadUntil() throws IOException {
{
AdvancedReader in = new AdvancedReader(new FileReader(file));
String[] lines = in.readUntil("^3.*$");
- assertEquals(3, lines.length);
- assertEquals("\t\t", lines[0]);
- assertEquals("1 toto tata tutu", lines[1]);
- assertEquals("2 toto tata tutu", lines[2]);
+ Assert.assertEquals(3, lines.length);
+ Assert.assertEquals("\t\t", lines[0]);
+ Assert.assertEquals("1 toto tata tutu", lines[1]);
+ Assert.assertEquals("2 toto tata tutu", lines[2]);
String line = in.readLine();
- assertEquals("3 toto tata tutu", line);
+ Assert.assertEquals("3 toto tata tutu", line);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
String[] lines = in.readUntil("^3.*$");
- assertEquals(3, lines.length);
- assertEquals("\t\t", lines[0]);
- assertEquals("1 toto tata tutu", lines[1]);
- assertEquals("2 toto tata tutu", lines[2]);
+ Assert.assertEquals(3, lines.length);
+ Assert.assertEquals("\t\t", lines[0]);
+ Assert.assertEquals("1 toto tata tutu", lines[1]);
+ Assert.assertEquals("2 toto tata tutu", lines[2]);
String line = in.readLine();
- assertEquals("3 toto tata tutu", line);
+ Assert.assertEquals("3 toto tata tutu", line);
}
}
/**
* Test method for
* {@link org.codelutin.jrst.AdvancedReader#readUntil(java.lang.String)}.
+ * @throws IOException
*/
- public void testReadWhile() throws Exception {
+ public void testReadWhile() throws IOException {
{
AdvancedReader in = new AdvancedReader(new FileReader(file));
in.skipBlankLines();
String[] lines = in.readWhile("^[123].*$");
- assertEquals(3, lines.length);
- assertEquals("1 toto tata tutu", lines[0]);
- assertEquals("2 toto tata tutu", lines[1]);
- assertEquals("3 toto tata tutu", lines[2]);
+ Assert.assertEquals(3, lines.length);
+ Assert.assertEquals("1 toto tata tutu", lines[0]);
+ Assert.assertEquals("2 toto tata tutu", lines[1]);
+ Assert.assertEquals("3 toto tata tutu", lines[2]);
String line = in.readLine();
- assertEquals("4 toto tata tutu", line);
+ Assert.assertEquals("4 toto tata tutu", line);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
in.skipBlankLines();
String[] lines = in.readWhile("^[123].*$");
- assertEquals(3, lines.length);
- assertEquals("1 toto tata tutu", lines[0]);
- assertEquals("2 toto tata tutu", lines[1]);
- assertEquals("3 toto tata tutu", lines[2]);
+ Assert.assertEquals(3, lines.length);
+ Assert.assertEquals("1 toto tata tutu", lines[0]);
+ Assert.assertEquals("2 toto tata tutu", lines[1]);
+ Assert.assertEquals("3 toto tata tutu", lines[2]);
String line = in.readLine();
- assertEquals("4 toto tata tutu", line);
+ Assert.assertEquals("4 toto tata tutu", line);
}
}
/**
* Test method for {@link org.codelutin.jrst.AdvancedReader#readLine()}.
+ * @throws IOException
*/
- public void testReadLine() throws Exception {
+ public void testReadLine() throws IOException {
{
AdvancedReader in = new AdvancedReader(new FileReader(file));
String line = in.readLine();
- assertEquals("\t\t", line);
+ Assert.assertEquals("\t\t", line);
line = in.readLine();
- assertEquals("1 toto tata tutu", line);
+ Assert.assertEquals("1 toto tata tutu", line);
line = in.readLine();
- assertEquals("2 toto tata tutu", line);
+ Assert.assertEquals("2 toto tata tutu", line);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
String line = in.readLine();
- assertEquals("\t\t", line);
+ Assert.assertEquals("\t\t", line);
line = in.readLine();
- assertEquals("1 toto tata tutu", line);
+ Assert.assertEquals("1 toto tata tutu", line);
line = in.readLine();
- assertEquals("2 toto tata tutu", line);
+ Assert.assertEquals("2 toto tata tutu", line);
}
}
- public void testMark() throws Exception {
+ public void testMark() throws IOException {
AdvancedReader in = new AdvancedReader(new StringReader(text));
String line = in.readLine();
in.mark();
line = in.readLine();
- assertEquals("1 toto tata tutu", line);
+ Assert.assertEquals("1 toto tata tutu", line);
in.reset();
line = in.readLine();
- assertEquals("1 toto tata tutu", line);
+ Assert.assertEquals("1 toto tata tutu", line);
}
- public void testUnread() throws Exception {
+ public void testUnread() throws IOException {
AdvancedReader in = new AdvancedReader(new StringReader(text));
- assertEquals(0, in.getCharNumber());
- assertEquals(0, in.getLineNumber());
+ Assert.assertEquals(0, in.getCharNumber());
+ Assert.assertEquals(0, in.getLineNumber());
String line = in.readLine();
- assertEquals(3, in.getCharNumber());
- assertEquals(1, in.getLineNumber());
+ Assert.assertEquals(3, in.getCharNumber());
+ Assert.assertEquals(1, in.getLineNumber());
line = in.readLine();
- assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber());
- assertEquals(2, in.getLineNumber());
- assertEquals("1 toto tata tutu", line);
+ Assert.assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber());
+ Assert.assertEquals(2, in.getLineNumber());
+ Assert.assertEquals("1 toto tata tutu", line);
in.unread(line.length() + 1);
- assertEquals(3, in.getCharNumber());
- assertEquals(1, in.getLineNumber());
+ Assert.assertEquals(3, in.getCharNumber());
+ Assert.assertEquals(1, in.getLineNumber());
line = in.readLine();
- assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber());
- assertEquals(2, in.getLineNumber());
- assertEquals("1 toto tata tutu", line);
+ Assert.assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber());
+ Assert.assertEquals(2, in.getLineNumber());
+ Assert.assertEquals("1 toto tata tutu", line);
}
- public void testSkip() throws Exception {
+ public void testSkip() throws IOException {
AdvancedReader in = new AdvancedReader(new StringReader(text));
in.skip(3);
String line = in.readLine();
- assertEquals("1 toto tata tutu", line);
+ Assert.assertEquals("1 toto tata tutu", line);
in.skip(text.length());
line = in.readLine();
- assertNull(line);
+ Assert.assertNull(line);
}
}
Modified: jrst/trunk/src/test/java/org/codelutin/jrst/Compare.java
===================================================================
--- jrst/trunk/src/test/java/org/codelutin/jrst/Compare.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/test/java/org/codelutin/jrst/Compare.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,6 +1,5 @@
-/**
- * *##% JRst
- * Copyright (C) 2004 - 2008 CodeLutin
+/* *##% JRst
+ * Copyright (C) 2004 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -16,10 +15,7 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*
*/
-/**
- * Class de test pour comparer le XML de DocUtils avec celui du JRST
- *
- */
+
package org.codelutin.jrst;
import java.io.File;
@@ -44,36 +40,41 @@
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
+import org.junit.Ignore;
+
import sdoc.*;
+/**
+ * Class de test pour comparer le XML de DocUtils avec celui du JRST
+ */
+@Ignore
public class Compare {
+
static boolean[] bColorRst;
static boolean[] bColorPython;
- // redefinir
- // manuelement
- static public void main(String[] args) throws Exception {
+ public static void main(String[] args) throws Exception {
File source = null;
if (args.length > 0) {
source = new File(args[0]);
- if (source != null)
- parser(source);
- } else
+ parser(source);
+ } else {
System.err.println("Argument source manquant");
+ }
}
private static void parser(File source) throws Exception {
- URL url = source.toURL();
+ URL url = source.toURI().toURL();
Reader in = new InputStreamReader(url.openStream());
JRSTReader jrst = new JRSTReader();
Document docRst = jrst.read(in); // JRST
- String cmd = "rst2xml " + source.getPath();
+ String cmd = "rst2xml.py " + source.getPath();
Process p = Runtime.getRuntime().exec(cmd); // Python
ThreadRedirection t = new ThreadRedirection(p);
t.start();
p.waitFor(); // On attend que le processus ce termine
- String strPython = t.getSortit().replaceAll("null", "");
+ //String strPython = t.getSortit().replaceAll("null", "");
t.stop();
p.destroy();
SAXReader sr = new SAXReader();
@@ -152,8 +153,7 @@
return nbLine;
}
- private static void compare(String docRst, String docPython, String diff)
- throws IOException {
+ private static void compare(String docRst, String docPython, String diff) {
JTextArea jrst = new JTextArea();
JTextArea python = new JTextArea();
jrst.setEditable(false);
Modified: jrst/trunk/src/test/java/org/codelutin/jrst/GutterColor.java
===================================================================
--- jrst/trunk/src/test/java/org/codelutin/jrst/GutterColor.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/test/java/org/codelutin/jrst/GutterColor.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,6 +1,5 @@
-/**
- * *##% JRst
- * Copyright (C) 2004 - 2008 CodeLutin
+/* *##% JRst
+ * Copyright (C) 2004 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -16,34 +15,9 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*
*/
-/**
- * numerotation des lignes
- *
- */
+
package org.codelutin.jrst;
-/*
- *
- * Created on 1 aout 2005, 17:45
- *
- * Copyright (C) 2005 Yves Zoundi
- * MOdified by Jason Davis
- *
- * This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
@@ -59,11 +33,14 @@
import javax.swing.JScrollPane;
import javax.swing.text.JTextComponent;
+import org.junit.Ignore;
+
/**
* A class which adds line numbering to a editor
*
* @author Yves Zoundi
*/
+@Ignore
public final class GutterColor extends JLabel {
/** serialVersionUID */
private static final long serialVersionUID = -4419253280014127529L;
@@ -76,6 +53,8 @@
*
* @param edit
* the editor which has to display line numbers
+ * @param pane
+ * @param bColors
*/
public GutterColor(JTextComponent edit, JScrollPane pane, boolean[] bColors) {
this.edit = edit;
Modified: jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java
===================================================================
--- jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,5 +1,5 @@
/* *##% JRst
- * Copyright (C) 2004 - 2008 CodeLutin
+ * Copyright (C) 2004 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -15,8 +15,15 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-/* *
- * JRSTGenerator.java
+package org.codelutin.jrst;
+
+import java.io.File;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * JRSTGeneratorTest.
*
* Created: 31 oct. 06 11:14:19
*
@@ -26,57 +33,74 @@
* Last update: $Date$
* by : $Author$
*/
+public class JRSTGeneratorTest {
-package org.codelutin.jrst;
-
-import junit.framework.TestCase;
-
-/**
- * @author poussin
- *
- */
-
-public class JRSTGeneratorTest extends TestCase {
-
+ @Test
public void testRstToHtml() throws Exception {
- long time0 = System.currentTimeMillis();
- // test 1 :
- JRST.main(new String[] { "-t", "rst", "-o", "html", "src/test/resources/test.rst", });
- System.err
- .println("===================================================================");
- long time1 = System.currentTimeMillis();
+ File test1 = File.createTempFile("jrst-test", ".html");
+ JRST.main(new String[] { "-t", "rst", "--force", "-o", test1.getAbsolutePath(), "src/test/resources/test.rst", });
+ test1.delete();
+ }
+
+ @Test
+ public void testRstToHtml2() throws Exception {
+ File test1 = File.createTempFile("jrst-test", ".html");
+ JRST.main(new String[] { "-t", "html", "--force", "-o", test1.getAbsolutePath(), "src/test/resources/text.rst" });
+ test1.delete();
+ }
+
+ @Test
+ public void testRstToDocbook() throws Exception {
- // test 2 :
- JRST.main(new String[] { "-t", "html",
- "src/test/resources/text.rst" });
- System.err
- .println("===================================================================");
- long time2 = System.currentTimeMillis();
-
- // test 3 :
- // JRST.main(new String[]{"-t", "docbook",
- // "src/test/resources/text.rst"});
- System.err
- .println("===================================================================");
- long time3 = System.currentTimeMillis();
-
- // test 4 :
- // JRST.main(new String[]{"-t", "xhtml",
- // "src/test/resources/text.rst"});
- System.err
- .println("===================================================================");
- long time4 = System.currentTimeMillis();
-
- // test 5 :
- JRST.main(new String[] { "-t", "xdoc",
- "src/test/resources/text.rst" });
+ File test1 = File.createTempFile("jrst-test", ".dbk");
+ JRST.main(new String[]{"-t", "docbook", "--force","-o", test1.getAbsolutePath(),
+ "src/test/resources/test.rst"});
+ test1.delete();
+ }
+
+ @Test
+ public void testRstToXdoc() throws Exception {
+ File test1 = File.createTempFile("jrst-test", ".xdoc");
+ JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
+ "src/test/resources/test.rst" });
+ test1.delete();
+ }
- long time5 = System.currentTimeMillis();
-
- System.out.println("time generation: " + (time1 - time0) + ":"
- + (time2 - time1) + ":" + (time3 - time2) + ":"
- + (time4 - time3) + ":" + (time5 - time4));
+ /**
+ * This test is not working.
+ *
+ * @throws Exception
+ */
+ @Ignore
+ public void testRstToXdoc2() throws Exception {
+ File test1 = File.createTempFile("jrst-test", ".xdoc");
+ JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
+ "src/test/resources/test2.rst" });
+ test1.delete();
}
-
+
+ @Test
+ public void testRstToXdoc3() throws Exception {
+ File test1 = File.createTempFile("jrst-test", ".xdoc");
+ JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
+ "src/test/resources/test3.rst" });
+ test1.delete();
+ }
+
+ @Test
+ public void testRstToXdoc4() throws Exception {
+ File test1 = File.createTempFile("jrst-test", ".xdoc");
+ JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
+ "src/test/resources/test4.rst" });
+ test1.delete();
+ }
+
+ @Test
+ public void testRstToXdocJrstSite() throws Exception {
+ File test1 = File.createTempFile("jrst-test", ".xdoc");
+ JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
+ "src/test/resources/frEntier.rst" });
+ test1.delete();
+ }
}
Modified: jrst/trunk/src/test/java/org/codelutin/jrst/JRSTReaderTest.java
===================================================================
--- jrst/trunk/src/test/java/org/codelutin/jrst/JRSTReaderTest.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/test/java/org/codelutin/jrst/JRSTReaderTest.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,5 +1,5 @@
/* *##% JRst
- * Copyright (C) 2004 - 2008 CodeLutin
+ * Copyright (C) 2004 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -15,18 +15,6 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-/* *
- * JRSTReaderTest.java
- *
- * Created: 27 oct. 06 12:11:44
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package org.codelutin.jrst;
import junit.framework.TestCase;
@@ -39,10 +27,16 @@
import java.net.URL;
/**
+ * JRSTReaderTest.
+ *
+ * Created: 27 oct. 06 12:11:44
+ *
* @author poussin
- *
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-
public class JRSTReaderTest extends TestCase {
public void testRead() throws Exception {
Modified: jrst/trunk/src/test/java/org/codelutin/jrst/ThreadRedirection.java
===================================================================
--- jrst/trunk/src/test/java/org/codelutin/jrst/ThreadRedirection.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/test/java/org/codelutin/jrst/ThreadRedirection.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,6 +1,5 @@
-/**
- * *##% JRst
- * Copyright (C) 2004 - 2008 CodeLutin
+/* *##% JRst
+ * Copyright (C) 2004 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -16,15 +15,16 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*
*/
-/*
- * Class qui redirige la sortie standard pour la laisser en interne
- */
+
package org.codelutin.jrst;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
+/**
+ * Class qui redirige la sortie standard pour la laisser en interne
+ */
public class ThreadRedirection extends Thread {
String str;
String errors;
@@ -43,9 +43,8 @@
try {
String line;
while ((line = reader.readLine()) != null) {
- if (line != null) {
- if (!line.equals("null"))
- str += "\n" + line;
+ if (!line.equals("null")) {
+ str += "\n" + line;
}
}
@@ -55,11 +54,9 @@
try {
String line;
while ((line = readerErrors.readLine()) != null) {
- if (line != null) {
- if (!line.equals(null))
- errors += "\n" + line;
+ if (!line.equals(null)) {
+ errors += "\n" + line;
}
-
}
} finally {
Modified: jrst/trunk/src/test/java/org/codelutin/jrst/XMLCaseTest.java
===================================================================
--- jrst/trunk/src/test/java/org/codelutin/jrst/XMLCaseTest.java 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/test/java/org/codelutin/jrst/XMLCaseTest.java 2009-01-15 18:31:16 UTC (rev 248)
@@ -1,6 +1,5 @@
-/**
- * *##% JRst
- * Copyright (C) 2004 - 2008 CodeLutin
+/* *##% JRst
+ * Copyright (C) 2004 - 2009 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -16,16 +15,19 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*
*/
-/**
- * Compare les 2 xml avec XMLUnit
- *
- */
+
package org.codelutin.jrst;
import org.custommonkey.xmlunit.DetailedDiff;
import org.custommonkey.xmlunit.XMLTestCase;
+import org.junit.Ignore;
+/**
+ * Compare les 2 xml avec XMLUnit.
+ */
+@Ignore
public class XMLCaseTest extends XMLTestCase {
+
public XMLCaseTest(String name) {
super(name);
}
@@ -35,7 +37,6 @@
DetailedDiff myDiff = new DetailedDiff(compareXML(myControlXML,
myTestXML));
return myDiff;
-
}
}
Modified: jrst/trunk/src/test/resources/test2.rst
===================================================================
--- jrst/trunk/src/test/resources/test2.rst 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/test/resources/test2.rst 2009-01-15 18:31:16 UTC (rev 248)
@@ -308,7 +308,7 @@
.. _Docstring Processing System: http://docstring.sourceforge.net/
.. _master PEP repository: http://www.python.org/peps/
-
+
..
Local Variables:
mode: indented-text
Modified: jrst/trunk/src/test/resources/text.rst
===================================================================
--- jrst/trunk/src/test/resources/text.rst 2009-01-15 18:30:52 UTC (rev 247)
+++ jrst/trunk/src/test/resources/text.rst 2009-01-15 18:31:16 UTC (rev 248)
@@ -6,7 +6,7 @@
subtitle
----------
-.. include:: /home/letellier/PROJET/jrst2/src/test/org/codelutin/jrst/textHeader.rst
+.. include:: src/test/resources/textHeader.rst
.. sectnum::
@@ -365,7 +365,7 @@
-------
.. include:: literal
- /home/letellier/PROJET/jrst2/src/test/org/codelutin/jrst/textLiteral.txt
+ src/test/resources/textLiteral.txt
la derniere ligne.
1
0
15 Jan '09
Author: chatellier
Date: 2009-01-15 18:30:52 +0000 (Thu, 15 Jan 2009)
New Revision: 247
Modified:
jrst/trunk/src/main/resources/xsl/xml2rst.xsl
Log:
Update xml2rst.xsl stylesheet
Modified: jrst/trunk/src/main/resources/xsl/xml2rst.xsl
===================================================================
--- jrst/trunk/src/main/resources/xsl/xml2rst.xsl 2009-01-14 11:03:24 UTC (rev 246)
+++ jrst/trunk/src/main/resources/xsl/xml2rst.xsl 2009-01-15 18:30:52 UTC (rev 247)
@@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY CR "
">
+<!-- Used to create a blank line -->
+<!ENTITY tCR "<xsl:text>&CR;</xsl:text>">
+<!-- Used when the line before must be ended -->
+<!ENTITY tEOL "<xsl:text>&CR;</xsl:text>">
+<!ENTITY tSP "<xsl:text> </xsl:text>">
+]>
-
<!--
Copyright (C) 2005, 2006 Stefan Merten, David Priest
@@ -36,8 +43,8 @@
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:u="http://www.w3.org/1999/XSL/Transform/u"
- xmlns:data="http://a"
+ xmlns:u="u"
+ xmlns:data="a"
exclude-result-prefixes="data">
<xsl:output
@@ -155,6 +162,7 @@
"docinfo" may be transformed from an initial field_list, and "decoration" is
usually constructed programmatically.
-->
+
<!-- == structural_element -->
<xsl:template
match="document">
@@ -166,6 +174,7 @@
</xsl:if>
<xsl:call-template
name="u:outputClass">
+
<xsl:with-param
name="blankAfter"
select="true()"/>
@@ -183,6 +192,7 @@
<!-- == structural_element -->
<xsl:template
match="section">
+
<xsl:call-template
name="u:outputClass"/>
<xsl:call-template
@@ -211,6 +221,7 @@
<xsl:text>.. sidebar:: </xsl:text>
<xsl:value-of
select="title"/>
+
&tEOL;
<xsl:if
test="subtitle">
@@ -229,6 +240,7 @@
</xsl:if>
<xsl:call-template
name="u:params"/>
+
<!-- Always blank line after parameter block -->
&tCR;
<xsl:apply-templates
@@ -245,6 +257,7 @@
<!-- == structural_element == directive -->
<xsl:template
match="topic">
+
<xsl:call-template
name="u:BandI"/>
<xsl:text>.. topic:: </xsl:text>
@@ -258,6 +271,7 @@
</xsl:template>
<!-- == structural_element == directive -->
+
<xsl:template
match="topic[starts-with(@class, 'contents')]">
<xsl:call-template
@@ -273,6 +287,7 @@
<xsl:with-param
name="params"
select="@*[name() != 'id' and name() != 'name' and name() != 'class']"/>
+
</xsl:call-template>
<xsl:variable
name="realClasses"
@@ -293,6 +308,7 @@
select="ancestor-or-self::*"/>
</xsl:call-template>
</xsl:if>
+
<!-- Autogenerated content is discarded -->
&tCR;
</xsl:template>
@@ -305,6 +321,7 @@
<xsl:text>:</xsl:text>
<xsl:apply-templates
select="title"/>
+
<xsl:text>: </xsl:text>
&tEOL;
<xsl:apply-templates
@@ -319,6 +336,7 @@
id, name, dupname, source, and class.
-->
<!-- == compound_body_element == directive -->
+
<xsl:template
match="admonition">
<xsl:call-template
@@ -333,6 +351,7 @@
name="u:indent"/>
<xsl:apply-templates
select="*[not(self::title)]"/>
+
</xsl:template>
<!-- ******************************************************************** -->
@@ -350,6 +369,7 @@
<xsl:call-template
name="u:BandI"/>
<xsl:text>.. </xsl:text>
+
<xsl:value-of
select="name()"/>
<xsl:text>:: </xsl:text>
@@ -382,6 +402,7 @@
<!-- == decorative_element -->
<xsl:template
match="//document/decoration/header">
+
<xsl:apply-templates/>
</xsl:template>
@@ -431,6 +452,7 @@
<xsl:value-of
select="name()"/>
<xsl:text>: </xsl:text>
+
</xsl:with-param>
</xsl:call-template>
</xsl:template>
@@ -447,6 +469,7 @@
<!-- no semicolon after final author -->
<xsl:if
test="generate-id(current()) != generate-id(../*[last()])">
+
<xsl:text>; </xsl:text>
</xsl:if>
</xsl:template>
@@ -461,6 +484,7 @@
match="docinfo/field">
<!-- contents handled by ordinary field lists -->
<xsl:apply-templates/>
+
<!-- Supply an EOL because following elements do not recognize this -->
&tEOL;
</xsl:template>
@@ -478,6 +502,7 @@
name="u:outputFolding">
<xsl:with-param
name="prefix">
+
<xsl:text>:</xsl:text>
<xsl:value-of
select="name()"/>
@@ -501,6 +526,7 @@
&tCR; <!-- req: blank line before -->
<xsl:text>-----</xsl:text>
&tEOL;
+
<!-- Add a required blank line after unless class follows immediately -->
<xsl:if
test="not(following-sibling::*[1]/@class)">
@@ -522,6 +548,7 @@
auto is used to indicate (with value "1") that the title has been
numbered automatically.
-->
+
<!-- == structural_subelement -->
<xsl:template
match="//document/title">
@@ -539,6 +566,7 @@
<xsl:variable
name="length"
select="string-length($text)"/>
+
<xsl:call-template
name="u:overline">
<xsl:with-param
@@ -559,6 +587,7 @@
<xsl:with-param
name="depth"
select="1"/>
+
</xsl:call-template>
</xsl:template>
@@ -581,6 +610,7 @@
name="u:outputClass"/>
<xsl:variable
name="textWS">
+
<!-- catch the title text as it is rendered -->
<xsl:apply-templates/>
</xsl:variable>
@@ -601,6 +631,7 @@
<xsl:with-param
name="depth"
select="$depth + 2"/>
+
</xsl:call-template>
<xsl:value-of
select="$text"/>
@@ -617,6 +648,7 @@
<!-- Add a blank line after unless structure follows immediately -->
<xsl:if
test="not(contains(concat($structural_elements, $compound_body_elements), concat('*', name(following-sibling::*[1]), '*')) or following-sibling::*[1]/@class)">
+
&tCR;
</xsl:if>
</xsl:template>
@@ -636,6 +668,7 @@
match="title">
<xsl:call-template
name="u:outputClass">
+
<xsl:with-param
name="alreadyBlanked"
select="true()"/>
@@ -655,6 +688,7 @@
Attributes: The subtitle element contains only the common attributes: id,
name, dupname, source, and class.
-->
+
<!-- == structural_subelement -->
<xsl:template
match="//document/subtitle">
@@ -688,6 +722,7 @@
&tEOL;
<xsl:call-template
name="u:underline">
+
<xsl:with-param
name="length"
select="$length"/>
@@ -707,6 +742,7 @@
<!-- == structural_subelement -->
<xsl:template
match="sidebar/subtitle">
+
<xsl:call-template
name="u:outputClass"/>
<xsl:call-template
@@ -735,6 +771,7 @@
name="prefix">
<xsl:text>.. </xsl:text>
</xsl:with-param>
+
</xsl:call-template>
</xsl:template>
@@ -752,6 +789,7 @@
name="u:outputClass"/>
<xsl:call-template
name="u:BandI"/>
+
<xsl:apply-templates/>
&tEOL;
</xsl:template>
@@ -763,6 +801,7 @@
<xsl:template
match="image">
<xsl:choose>
+
<xsl:when
test="contains($inline_containers, concat('*', name(..), '*')) and @alt">
<!-- An inline image with an `@alt' - must be a substitution
@@ -774,6 +813,7 @@
<xsl:text>|</xsl:text>
</xsl:when>
<xsl:otherwise>
+
<!-- A directive -->
<xsl:if
test="not(parent::figure)">
@@ -785,6 +825,7 @@
</xsl:if>
<xsl:text>image:: </xsl:text>
</xsl:if>
+
<xsl:value-of
select="@uri"/>
&tEOL;
@@ -802,6 +843,7 @@
<xsl:with-param
name="value"
select="../@class"/>
+
<xsl:with-param
name="ancestors"
select="ancestor::*"/>
@@ -817,6 +859,7 @@
</xsl:when>
<xsl:when
test="parent::substitution_definition">
+
<xsl:call-template
name="u:params">
<!-- `@alt' only for the real images -->
@@ -830,6 +873,7 @@
name="u:params"/>
</xsl:otherwise>
</xsl:choose>
+
<xsl:if
test="parent::reference">
<!-- A clickable image -->
@@ -846,6 +890,7 @@
<!-- An internal link -->
<xsl:call-template
name="u:inlineReference">
+
<xsl:with-param
name="text"
select="../@refid"/>
@@ -858,6 +903,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
+
<xsl:with-param
name="ancestors"
select="ancestor-or-self::*"/>
@@ -888,6 +934,7 @@
test="not($isEmbedded)">
<xsl:call-template
name="u:blank"/>
+
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
@@ -904,6 +951,7 @@
match="line">
<xsl:call-template
name="u:outputClass"/>
+
<xsl:variable
name="indent">
<xsl:call-template
@@ -918,6 +966,7 @@
<xsl:variable
name="lineBlockIndent">
<!-- Very special indendation for nested `line_block's -->
+
<xsl:for-each
select="ancestor::line_block[position() > 1]">
<xsl:call-template
@@ -933,6 +982,7 @@
<xsl:with-param
name="prefix">
<xsl:text>| </xsl:text>
+
<xsl:value-of
select="$lineBlockIndent"/>
</xsl:with-param>
@@ -944,6 +994,7 @@
<xsl:otherwise>
<xsl:text>|</xsl:text>
&tEOL;
+
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@@ -960,6 +1011,7 @@
match="literal_block">
<xsl:call-template
name="u:outputClass"/>
+
<!-- TODO: Support for the (fully) minimized style would be nice but
is difficult to accomplish because there is a linefeed
already when we arrive here :-( -->
@@ -973,6 +1025,7 @@
<xsl:call-template
name="u:isQuotedLiteral"/>
</xsl:variable>
+
<!-- Indent correctly depending on quoted literal or not -->
<xsl:choose>
<xsl:when
@@ -987,6 +1040,7 @@
mode="quotedLiteral"/>
</xsl:when>
<xsl:otherwise>
+
<xsl:call-template
name="u:indent">
<xsl:with-param
@@ -1015,6 +1069,7 @@
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
+
</xsl:template>
<!-- Determine whether `$text' is a quoted literal and return the quote
@@ -1032,6 +1087,7 @@
<!-- Given quote is an adornment character and first character is this
quote -->
<xsl:choose>
+
<xsl:when
test="contains($text, '
')">
<!-- Test the remaining lines -->
@@ -1047,6 +1103,7 @@
</xsl:when>
<xsl:otherwise>
<!-- No more lines to test so this is a quoted literal -->
+
<xsl:value-of
select="$quote"/>
</xsl:otherwise>
@@ -1062,6 +1119,7 @@
name, dupname, source, and class.
-->
<!-- == simple_body_element == folding_element -->
+
<xsl:template
match="paragraph">
<xsl:variable
@@ -1080,6 +1138,7 @@
test="$needsBlank">
&tCR;
</xsl:if>
+
<xsl:if
test="$needsIndent">
<xsl:call-template
@@ -1098,6 +1157,7 @@
name="alreadyIndented"
select="$needsIndent"/>
</xsl:call-template>
+
<xsl:call-template
name="u:BandI"/>
</xsl:if>
@@ -1112,6 +1172,7 @@
match="pending">
<xsl:call-template
name="u:notSupported"/>
+
</xsl:template>
<!-- ******************************************************************** -->
@@ -1124,6 +1185,7 @@
<xsl:call-template
name="u:BandI"/>
<xsl:text>.. raw:: </xsl:text>
+
<xsl:value-of
select="@format"/>
&tEOL;
@@ -1140,6 +1202,7 @@
name="ancestors"
select="ancestor-or-self::*"/>
</xsl:call-template>
+
<xsl:apply-templates/>
&tEOL;
</xsl:template>
@@ -1153,6 +1216,7 @@
name="u:BandI"/>
<xsl:call-template
name="u:outputFolding">
+
<xsl:with-param
name="prefix">
<xsl:text>.. rubric:: </xsl:text>
@@ -1190,6 +1254,7 @@
<xsl:variable
name="prefix">
<xsl:text>.. |</xsl:text>
+
<xsl:value-of
select="@name"/>
<xsl:text>| </xsl:text>
@@ -1204,6 +1269,7 @@
name="u:outputFolding">
<xsl:with-param
name="prefix">
+
<xsl:value-of
select="$prefix"/>
<xsl:text>replace:: </xsl:text>
@@ -1214,6 +1280,7 @@
<xsl:value-of
select="$prefix"/>
<xsl:apply-templates/>
+
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@@ -1230,6 +1297,7 @@
match="block_quote">
<xsl:if
test="@class = 'epigraph' or @class = 'highlights' or @class = 'pull-quote'">
+
<xsl:call-template
name="u:BandI"/>
<xsl:text>.. </xsl:text>
@@ -1241,6 +1309,7 @@
name="u:params"/>
</xsl:if>
<xsl:apply-templates/>
+
</xsl:template>
<!-- ******************************************************************** -->
@@ -1254,6 +1323,7 @@
&tCR;
<xsl:call-template
name="u:indent"/>
+
<xsl:call-template
name="u:outputFolding">
<xsl:with-param
@@ -1278,6 +1348,7 @@
<xsl:text>] </xsl:text>
<xsl:apply-templates
select="*[not(self::label)]"/>
+
</xsl:template>
<!-- == simple_body_subelement -->
@@ -1289,6 +1360,7 @@
<!-- ******************************************************************** -->
<!-- == compound_body_element == directive -->
+
<xsl:template
match="figure">
<xsl:call-template
@@ -1300,6 +1372,7 @@
<!-- ******************************************************************** -->
<!-- == simple_body_subelement == folding_element -->
+
<xsl:template
match="caption">
<xsl:call-template
@@ -1314,6 +1387,7 @@
<xsl:template
match="legend">
<xsl:apply-templates/>
+
</xsl:template>
<!-- ******************************************************************** -->
@@ -1327,6 +1401,7 @@
<xsl:call-template
name="u:BandI"/>
<xsl:text>.. [</xsl:text>
+
<xsl:apply-templates
select="label"/>
<xsl:text>] </xsl:text>
@@ -1340,6 +1415,7 @@
<!-- == compound_body_element == directive -->
<xsl:template
match="footnote[@auto='1']">
+
<xsl:call-template
name="u:outputClass"/>
<xsl:call-template
@@ -1353,6 +1429,7 @@
<xsl:text>] </xsl:text>
<xsl:apply-templates
select="*[not(self::label)]"/>
+
</xsl:template>
<!-- autosymboled footnotes have @auto -->
@@ -1366,6 +1443,7 @@
<xsl:text>.. [*] </xsl:text>
<xsl:apply-templates
select="*[not(self::label)]"/>
+
</xsl:template>
<!-- == compound_body_element == directive -->
@@ -1378,6 +1456,7 @@
<xsl:call-template
name="u:BandI"/>
<xsl:text>.. target-notes::</xsl:text>
+
&tEOL;
</xsl:if>
</xsl:template>
@@ -1429,6 +1508,7 @@
Attributes: The definition_list_item element contains only the common
attributes: id, name, dupname, source, and class.
-->
+
<!-- == compound_body_subelement -->
<xsl:template
match="definition_list_item">
@@ -1446,6 +1526,7 @@
Attributes: The term element contains only the common attributes: id,
name, dupname, source, and class.
-->
+
<!-- == simple_body_subelement -->
<xsl:template
match="term">
@@ -1462,6 +1543,7 @@
<!-- == simple_body_subelement -->
<xsl:template
match="classifier">
+
<xsl:text> : </xsl:text>
<xsl:apply-templates/>
</xsl:template>
@@ -1476,6 +1558,7 @@
<!-- == compound_body_subelement -->
<xsl:template
match="definition">
+
<xsl:call-template
name="u:outputClass"/>
<xsl:apply-templates/>
@@ -1509,6 +1592,7 @@
match="enumerated_list">
<xsl:call-template
name="u:outputClass"/>
+
<xsl:apply-templates
mode="enumerated_list"/>
</xsl:template>
@@ -1526,6 +1610,7 @@
<xsl:call-template
name="u:outputClass"/>
<xsl:apply-templates/>
+
</xsl:template>
<!-- ******************************************************************** -->
@@ -1543,6 +1628,7 @@
<xsl:call-template
name="u:BandI"/>
<xsl:apply-templates/>
+
</xsl:template>
<!-- ********************************************************************** -->
@@ -1557,6 +1643,7 @@
match="field_name">
<xsl:text>:</xsl:text>
<xsl:apply-templates/>
+
<xsl:text>: </xsl:text>
<!-- no EOL: field_body starts on same line -->
</xsl:template>
@@ -1571,6 +1658,7 @@
<!-- == compound_body_subelement -->
<xsl:template
match="field_body">
+
<xsl:call-template
name="u:outputClass"/>
<xsl:apply-templates/>
@@ -1588,6 +1676,7 @@
match="option_list">
<xsl:call-template
name="u:outputClass"/>
+
<xsl:call-template
name="u:blank"/>
<xsl:apply-templates/>
@@ -1605,6 +1694,7 @@
match="option_list_item">
<xsl:call-template
name="u:outputClass"/>
+
<xsl:call-template
name="u:indent"/>
<xsl:apply-templates/>
@@ -1621,6 +1711,7 @@
<xsl:template
match="option_group">
<xsl:apply-templates/>
+
&tEOL;
</xsl:template>
@@ -1637,6 +1728,7 @@
<xsl:call-template
name="u:outputClass"/>
<xsl:apply-templates/>
+
<xsl:if
test="generate-id(current()) != generate-id(../*[last()])">
<!-- No comma after final option -->
@@ -1670,6 +1762,7 @@
or the text between option arguments (typically either "," or " ").
-->
<!-- == simple_body_subelement -->
+
<xsl:template
match="option_argument">
<xsl:value-of
@@ -1687,6 +1780,7 @@
<!-- == compound_body_subelement -->
<xsl:template
match="description">
+
<xsl:call-template
name="u:outputClass"/>
<xsl:apply-templates/>
@@ -1709,6 +1803,7 @@
<xsl:template
match="list_item"
mode="bullet_list">
+
<xsl:call-template
name="u:outputClass"/>
<xsl:call-template
@@ -1740,6 +1835,7 @@
attribute may be omitted.
-->
+
<!-- == compound_body_subelement -->
<xsl:template
match="list_item"
@@ -1755,6 +1851,7 @@
<!-- Outputs a complete enumerator when called in an
enumerated_list/list_item -->
+
<xsl:template
name="u:outputEnumerator">
<!-- Use parent's numeration attribute -->
@@ -1770,6 +1867,7 @@
<xsl:value-of
select="../@start"/>
</xsl:when>
+
<xsl:otherwise>
<xsl:value-of
select="1"/>
@@ -1783,6 +1881,7 @@
name="wanted"
select="generate-id()"/>
<!-- Generate the right current node list -->
+
<xsl:for-each
select="../list_item">
<xsl:if
@@ -1797,6 +1896,7 @@
name="cur">
<xsl:call-template
name="u:position2Enumerator">
+
<xsl:with-param
name="enumType"
select="$enumType"/>
@@ -1816,6 +1916,7 @@
<xsl:with-param
name="enumType"
select="$enumType"/>
+
<xsl:with-param
name="position"
select="count(../list_item)"/>
@@ -1832,6 +1933,7 @@
<xsl:value-of
select="../@suffix"/>
<!-- Output at least one trailing space -->
+
&tSP;
<!-- Output more whitespace to align with the maximum enumerator -->
<xsl:if
@@ -1860,6 +1962,7 @@
name="ordinal"
select="$start - 1 + $position"/>
<xsl:choose>
+
<xsl:when
test="$enumType = 'arabic'">
<xsl:value-of
@@ -1875,6 +1978,7 @@
<xsl:value-of
select="substring('ABCDEFGHIJKLMNOPQRSTZUVWXYZ', $ordinal, 1)"/>
</xsl:when>
+
<!-- TODO: Support for counting roman numbers -->
<xsl:when
test="$enumType = 'lowerroman'">
@@ -1885,6 +1989,7 @@
<xsl:text>I</xsl:text>
</xsl:when>
</xsl:choose>
+
</xsl:template>
<!-- ******************************************************************** -->
@@ -1902,6 +2007,7 @@
name="u:outputClass"/>
<xsl:call-template
name="u:blank"/>
+
<xsl:apply-templates
select="tgroup"/>
<xsl:if
@@ -1954,6 +2060,7 @@
<!-- == compound_body_subelement -->
<xsl:template
match="thead">
+
<xsl:apply-templates/>
</xsl:template>
@@ -1987,6 +2094,7 @@
name="u:rowSeparatorLine"/>
</xsl:if>
<!-- Determine heights in physical lines of all entries -->
+
<xsl:variable
name="heights">
<xsl:for-each
@@ -2001,6 +2109,7 @@
<xsl:value-of
select="string-length($text) - string-length(translate($text, '
', '')) - 1"/>
&tSP; <!-- A space as a list separator -->
+
</xsl:for-each>
</xsl:variable>
<!-- Determine maximum height so every entry must be this high -->
@@ -2014,6 +2123,7 @@
</xsl:call-template>
</xsl:variable>
<!-- Output all the physical lines of this row -->
+
<xsl:call-template
name="u:rowLines">
<xsl:with-param
@@ -2031,6 +2141,7 @@
<xsl:with-param
name="char">
<!-- Determine correct character for the separator line -->
+
<xsl:choose>
<xsl:when
test="parent::thead">
@@ -2043,6 +2154,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
+
</xsl:call-template>
</xsl:if>
</xsl:template>
@@ -2057,6 +2169,7 @@
name="maxLine"/>
<xsl:if
test="$currentLine <= $maxLine">
+
<!-- If there are still physical lines to output do it -->
<xsl:call-template
name="u:indent"/>
@@ -2068,6 +2181,7 @@
select="$currentLine"/>
</xsl:apply-templates>
<!-- End of this physical line -->
+
&tEOL;
<!-- Continue with the next physical line -->
<xsl:call-template
@@ -2098,6 +2212,7 @@
<xsl:with-param
name="length"
select="@colwidth"/>
+
<xsl:with-param
name="chars"
select="$char"/>
@@ -2131,6 +2246,7 @@
<!-- Determine width in characters needed for this entry -->
<xsl:variable
name="width">
+
<xsl:call-template
name="u:computeEntryWidth">
<xsl:with-param
@@ -2149,6 +2265,7 @@
name="u:outputEntry">
<xsl:with-param
name="string">
+
<!-- Capture physical lines of the entry in a variable -->
<xsl:apply-templates/>
</xsl:with-param>
@@ -2165,6 +2282,7 @@
<xsl:with-param
name="outputLine"
select="$currentLine"/>
+
</xsl:call-template>
<!-- Final bar after the entry -->
<xsl:text>|</xsl:text>
@@ -2176,6 +2294,7 @@
<!-- The colspec elements of all columns -->
<xsl:param
name="colspecs"/>
+
<!-- Column of this entry -->
<xsl:param
name="column"/>
@@ -2192,6 +2311,7 @@
<!-- If entry spans multiple columns compute their width -->
<xsl:call-template
name="u:computeEntryWidth">
+
<xsl:with-param
name="colspecs"
select="$colspecs"/>
@@ -2210,6 +2330,7 @@
<xsl:otherwise>
<!-- Does not span more columns so return sum and width of this
column -->
+
<xsl:value-of
select="$sum + $colspecs[$column]/@colwidth"/>
</xsl:otherwise>
@@ -2224,6 +2345,7 @@
longer than this width -->
<xsl:param
name="width"/>
+
<!-- The string containing the remaining physical lines; may be an empty
string -->
<xsl:param
@@ -2244,6 +2366,7 @@
select="0"/>
<!-- Output is wanted if all or the first physical line are to be
output -->
+
<xsl:variable
name="doOutput"
select="$outputLine = 0 or $outputLine = 1"/>
@@ -2259,6 +2382,7 @@
<xsl:otherwise>
<xsl:value-of
select="$string"/>
+
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
@@ -2271,6 +2395,7 @@
<xsl:value-of
select="substring($stringLFHalfTrimmed, 1, string-length($stringLFHalfTrimmed) - 1)"/>
</xsl:when>
+
<xsl:otherwise>
<xsl:value-of
select="$stringLFHalfTrimmed"/>
@@ -2284,6 +2409,7 @@
test="contains($stringLFTrimmed, '
')">
<xsl:value-of
select="substring-after($stringLFTrimmed, '
')"/>
+
</xsl:if>
</xsl:variable>
<xsl:if
@@ -2298,6 +2424,7 @@
<xsl:value-of
select="substring-before($stringLFTrimmed, '
')"/>
</xsl:when>
+
<xsl:otherwise>
<xsl:value-of
select="$stringLFTrimmed"/>
@@ -2311,6 +2438,7 @@
<xsl:if
test="string-length($firstLine)">
<!-- Trim only non-empty lines -->
+
<xsl:value-of
select="substring-after($firstLine, $expectedIndent)"/>
</xsl:if>
@@ -2325,6 +2453,7 @@
<!-- Fill up the width of the entry with spaces -->
<xsl:if
test="$width - string-length($padded) < 0">
+
<xsl:message>
<xsl:text>WARNING: Table column too narrow (minimum: </xsl:text>
<xsl:value-of
@@ -2335,6 +2464,7 @@
</xsl:if>
<xsl:call-template
name="u:repeat">
+
<xsl:with-param
name="length"
select="$width - string-length($padded)"/>
@@ -2349,6 +2479,7 @@
<!-- Output linefeed only if we output all the lines -->
&tEOL;
</xsl:if>
+
<!-- Output the remaining lines -->
<xsl:call-template
name="u:outputEntry">
@@ -2369,6 +2500,7 @@
<xsl:choose>
<xsl:when
test="$outputLine = 0">
+
<xsl:value-of
select="0"/>
</xsl:when>
@@ -2380,6 +2512,7 @@
</xsl:with-param>
</xsl:call-template>
</xsl:if>
+
</xsl:template>
<!-- ******************************************************************** -->
@@ -2391,6 +2524,7 @@
<xsl:call-template
name="u:bkslshEscPre"/>
<xsl:text>[</xsl:text>
+
<xsl:apply-templates/>
<xsl:text>]_</xsl:text>
<xsl:call-template
@@ -2402,6 +2536,7 @@
<!-- == inline_element -->
<xsl:template
match="emphasis">
+
<xsl:call-template
name="u:bkslshEscPre"/>
<xsl:text>*</xsl:text>
@@ -2423,6 +2558,7 @@
<xsl:value-of
select="text()"/>
<xsl:text>]_</xsl:text>
+
<xsl:call-template
name="u:bkslshEscSuf"/>
<!-- child paragraph provides blank line -->
@@ -2436,6 +2572,7 @@
<xsl:variable
name="ref"
select="@refid"/>
+
<xsl:if
test="not(starts-with(//footnote[@id=$ref]/@name, 'target_note: '))">
<!-- Not a generated footnote reference for a `.. target-notes::';
@@ -2450,6 +2587,7 @@
select="//footnote[@id=$ref]/@name"/>
</xsl:if>
<xsl:text>]_</xsl:text>
+
<xsl:call-template
name="u:bkslshEscSuf"/>
</xsl:if>
@@ -2462,6 +2600,7 @@
<xsl:call-template
name="u:bkslshEscPre"/>
<xsl:text>[*]_</xsl:text>
+
<xsl:call-template
name="u:bkslshEscSuf"/>
</xsl:template>
@@ -2477,6 +2616,7 @@
<xsl:call-template
name="u:bkslshEscPre"/>
<xsl:text>``</xsl:text>
+
<xsl:apply-templates/>
<xsl:text>``</xsl:text>
<xsl:call-template
@@ -2502,6 +2642,7 @@
-->
<!-- Standalone hyperlink -->
+
<!-- == inline_element -->
<xsl:template
match="reference[not(@name or @anonymous)]">
@@ -2514,6 +2655,7 @@
<xsl:value-of
select="substring-after(., 'PEP ')"/>
<xsl:text>`</xsl:text>
+
</xsl:when>
<xsl:when
test="starts-with(., 'RFC ')">
@@ -2524,6 +2666,7 @@
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
+
</xsl:otherwise>
</xsl:choose>
<xsl:call-template
@@ -2535,6 +2678,7 @@
<xsl:template
match="reference[@name and @refuri]">
<!-- Determine normalized name by downcasing it -->
+
<xsl:variable
name="normalized"
select="translate(normalize-space(@name), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
@@ -2553,6 +2697,7 @@
</xsl:template>
<!-- Internal references -->
+
<!-- == inline_element -->
<xsl:template
match="reference[@name and @refid]">
@@ -2566,6 +2711,7 @@
<!-- Image references -->
<!-- == inline_element -->
+
<xsl:template
match="reference[image]">
<!-- All done by the `image' tag -->
@@ -2580,6 +2726,7 @@
<!-- == inline_element -->
<xsl:template
match="strong">
+
<xsl:call-template
name="u:bkslshEscPre"/>
<xsl:text>**</xsl:text>
@@ -2601,6 +2748,7 @@
<xsl:text>`</xsl:text>
<xsl:call-template
name="u:bkslshEscSuf"/>
+
</xsl:template>
<!-- ******************************************************************** -->
@@ -2612,6 +2760,7 @@
name="u:bkslshEscPre"/>
<xsl:text>:sup:`</xsl:text>
<xsl:apply-templates/>
+
<xsl:text>`</xsl:text>
<xsl:call-template
name="u:bkslshEscSuf"/>
@@ -2624,6 +2773,7 @@
<!-- == simple_body_element == inline_element == directive -->
<xsl:template
match="target">
+
<xsl:choose>
<xsl:when
test="name(preceding-sibling::*[1]) = 'reference'">
@@ -2638,6 +2788,7 @@
name="isTarget"
select="true()"/>
</xsl:call-template>
+
</xsl:when>
<xsl:when
test="@name">
@@ -2650,6 +2801,7 @@
<xsl:value-of
select="@name"/>
<xsl:text>:</xsl:text>
+
<xsl:if
test="@refuri">
<xsl:text> </xsl:text>
@@ -2661,6 +2813,7 @@
<xsl:when
test="@anonymous">
<!-- An anonymous target directive -->
+
<xsl:call-template
name="u:outputClass"/>
<xsl:call-template
@@ -2673,6 +2826,7 @@
select="@refid"/>
<xsl:text>_</xsl:text>
</xsl:when>
+
<xsl:when
test="@refuri">
<xsl:value-of
@@ -2685,6 +2839,7 @@
<!-- Should not happen -->
<xsl:call-template
name="u:notSupported"/>
+
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@@ -2699,6 +2854,7 @@
match="title_reference">
<xsl:call-template
name="u:bkslshEscPre"/>
+
<xsl:text>`</xsl:text>
<xsl:apply-templates/>
<xsl:text>`</xsl:text>
@@ -2711,6 +2867,7 @@
<!--
Content Model: %text.model;
-->
+
<!-- == inline_element -->
<xsl:template
match="inline">
@@ -2723,6 +2880,7 @@
select="@class"/>
<xsl:text>:`</xsl:text>
<xsl:apply-templates/>
+
<xsl:text>`</xsl:text>
<xsl:call-template
name="u:bkslshEscSuf"/>
@@ -2767,6 +2925,7 @@
match="text()">
<xsl:call-template
name="u:indentLF"/>
+
</xsl:template>
<!-- ******************************************************************** -->
@@ -2796,6 +2955,7 @@
<xsl:template
mode="blankSkipInline"
match="*">
+
<xsl:choose>
<!-- Skip all inline elements and body subelements and check their
parents -->
@@ -2810,6 +2970,7 @@
<xsl:if
test="contains($blank_after, concat('*', name(.), '*'))">
&tCR;
+
</xsl:if>
</xsl:otherwise>
</xsl:choose>
@@ -2821,9 +2982,10 @@
Indent a block if it's a child of...
-->
<data:lookup>
- <node
- name="address"
+ <node
+ name="address"
indent="10"/>
+
<node
name="author"
indent="9"/>
@@ -2851,6 +3013,7 @@
<node
name="version"
indent="10"/>
+
<!-- This is only for `bullet_list/list_item';
`enumerated_list/list_item' is handled special -->
<node
@@ -2876,6 +3039,7 @@
<node
name="attribution"
indent="3"/>
+
</data:lookup>
<!-- Do indent according to ancestor -->
@@ -2892,6 +3056,7 @@
name="this"
select="name()"/>
<xsl:choose>
+
<xsl:when
test="contains($directives, concat('*', $this, '*'))">
<xsl:call-template
@@ -2909,6 +3074,7 @@
name="enumerator">
<xsl:call-template
name="u:outputEnumerator"/>
+
</xsl:variable>
<xsl:call-template
name="u:repeat">
@@ -2922,8 +3088,9 @@
name="u:repeat">
<xsl:with-param
name="length"
- select="document('')//data:lookup/node[@name=$this]/@indent"/>
+ select="//data:lookup/node[@name=$this]/@indent"/>
</xsl:call-template>
+
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
@@ -2940,6 +3107,7 @@
<xsl:param
name="length"
select="0"/>
+
<xsl:param
name="chars"
select="' '"/>
@@ -2956,6 +3124,7 @@
<xsl:value-of
select="substring($string, 1, $length)"/>
</xsl:when>
+
<xsl:otherwise>
<xsl:call-template
name="u:repeat">
@@ -2986,6 +3155,7 @@
<!-- If not given compute it -->
<xsl:call-template
name="u:indent"/>
+
</xsl:param>
<xsl:choose>
<xsl:when
@@ -2998,6 +3168,7 @@
<xsl:value-of
select="$indent"/>
<!-- Output remaining physical lines -->
+
<xsl:call-template
name="u:indentLF">
<xsl:with-param
@@ -3013,6 +3184,7 @@
<xsl:value-of
select="$string"/>
</xsl:otherwise>
+
</xsl:choose>
</xsl:template>
@@ -3026,6 +3198,7 @@
name="prefix"
select="''"/>
<!-- The indentation for this body -->
+
<xsl:param
name="indent">
<xsl:call-template
@@ -3040,6 +3213,7 @@
<!-- TODO: Whitespace count of inline literals must be preserved -->
<xsl:apply-templates/>
</xsl:variable>
+
<!-- Always output prefix with all trailing and leading spaces -->
<xsl:value-of
select="$prefix"/>
@@ -3054,6 +3228,7 @@
test="$string = ''">
<!-- Empty strings need no output -->
</xsl:when>
+
<xsl:when
test="$normalized = ''">
<!-- Only white-space in string; output a single space here -->
@@ -3065,6 +3240,7 @@
test="normalize-space(substring($string, 1, 1)) = ''">
&tSP;
</xsl:if>
+
<xsl:call-template
name="u:indentFold">
<xsl:with-param
@@ -3082,6 +3258,7 @@
test="normalize-space(substring($string, string-length($string), 1)) = ''">
&tSP;
</xsl:if>
+
</xsl:otherwise>
</xsl:choose>
</xsl:when>
@@ -3105,6 +3282,7 @@
<xsl:param
name="indent"/>
<!-- Current output column -->
+
<!-- TODO: This is not a correct assumption for field definitions where
the field name effectively determines the column of the first line -->
<xsl:param
@@ -3122,6 +3300,7 @@
test="contains($string, ' ')">
<xsl:value-of
select="substring-before($string, ' ')"/>
+
</xsl:when>
<xsl:otherwise>
<xsl:value-of
@@ -3135,6 +3314,7 @@
<xsl:choose>
<xsl:when
test="$string = ''"/>
+
<xsl:when
test="$isNewLine">
<!-- Output at least first word -->
@@ -3155,6 +3335,7 @@
name="isNewLine"
select="false()"/>
</xsl:call-template>
+
</xsl:when>
<xsl:when
test="$cursorColumn + 1 + string-length($firstWord) > $fold">
@@ -3173,6 +3354,7 @@
<xsl:with-param
name="cursorColumn"
select="string-length($indent)"/>
+
<xsl:with-param
name="isNewLine"
select="true()"/>
@@ -3188,6 +3370,7 @@
<xsl:with-param
name="string"
select="$rest"/>
+
<xsl:with-param
name="indent"
select="$indent"/>
@@ -3220,6 +3403,7 @@
<!-- Skip URIs based on parent -->
<xsl:if
test="name() != 'uri' and name() != 'xml:space'">
+
<xsl:call-template
name="u:param">
<xsl:with-param
@@ -3233,6 +3417,7 @@
<!-- Output one attribute of the current element as a field list -->
<xsl:template
name="u:param">
+
<xsl:param
name="name"
select="name()"/>
@@ -3251,6 +3436,7 @@
select="$ancestors"/>
</xsl:call-template>
<xsl:text>:</xsl:text>
+
<xsl:value-of
select="$name"/>
<xsl:text>: </xsl:text>
@@ -3262,6 +3448,7 @@
<!-- ******************************************************************** -->
<!-- Output `\' or `\ ' before some inline element if necessary -->
+
<xsl:template
name="u:bkslshEscPre">
<!-- Get the sibling node directly before the current element -->
@@ -3276,6 +3463,7 @@
<xsl:when
test="name($before)">
<!-- So separate it by a quoted space -->
+
<xsl:text>\ </xsl:text>
</xsl:when>
<!-- Node directly before this is text - check it -->
@@ -3285,6 +3473,7 @@
<xsl:text>\ </xsl:text>
</xsl:when>
</xsl:choose>
+
</xsl:template>
<!-- Output `\' or `\ ' after some inline element if necessary -->
@@ -3298,6 +3487,7 @@
<!-- No sibling after this node -->
<xsl:when
test="not($after)"/>
+
<!-- Element directly after this - must be another inline element
handling itself -->
<xsl:when
@@ -3310,6 +3500,7 @@
<xsl:text>\</xsl:text>
</xsl:when>
</xsl:choose>
+
</xsl:template>
<!-- ******************************************************************** -->
@@ -3322,6 +3513,7 @@
<xsl:value-of
select="name(.)"/>
<xsl:text>' ########</xsl:text>
+
&tEOL;
</xsl:template>
@@ -3336,6 +3528,7 @@
greater than 2 are normal section titles -->
<xsl:param
name="depth"/>
+
<!-- Test whether a overline is wanted at all -->
<xsl:if
test="substring($adornment, 2 * ($depth - 1) + 1, 1) = 'o'">
@@ -3369,6 +3562,7 @@
<xsl:with-param
name="chars"
select="substring($adornment, 2 * ($depth - 1) + 2, 1)"/>
+
</xsl:call-template>
&tEOL;
</xsl:template>
@@ -3384,6 +3578,7 @@
<xsl:param
name="embedded"
select="false()"/>
+
<!-- Is this a target instead of a reference? -->
<xsl:param
name="isTarget"
@@ -3399,6 +3594,7 @@
<xsl:if
test="* or translate($text, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', '') or $embedded">
<xsl:text>`</xsl:text>
+
</xsl:if>
</xsl:variable>
<xsl:if
@@ -3411,6 +3607,7 @@
select="$text"/>
<xsl:if
test="$embedded">
+
<xsl:text> <</xsl:text>
<xsl:value-of
select="@refuri"/>
@@ -3423,6 +3620,7 @@
<xsl:text>_</xsl:text>
<xsl:if
test="$anonymous">
+
<xsl:text>_</xsl:text>
</xsl:if>
</xsl:if>
@@ -3433,6 +3631,7 @@
<!-- ******************************************************************** -->
<!-- Determine the maximum number from a whitespace separated number list -->
+
<xsl:template
name="u:maxNumber">
<xsl:param
@@ -3452,6 +3651,7 @@
name="head"
select="substring-before($cleanNumbers, ' ')"/>
<xsl:choose>
+
<xsl:when
test="$head > $currentMax">
<xsl:call-template
@@ -3470,6 +3670,7 @@
<xsl:with-param
name="numbers"
select="substring-after($cleanNumbers, ' ')"/>
+
<xsl:with-param
name="currentMax"
select="$currentMax"/>
@@ -3483,6 +3684,7 @@
test="$cleanNumbers > $currentMax">
<xsl:value-of
select="$cleanNumbers"/>
+
</xsl:when>
<xsl:otherwise>
<xsl:value-of
@@ -3507,6 +3709,7 @@
name="alreadyIndented"
select="false()"/>
<!-- Add a blank line after class directive? -->
+
<xsl:param
name="blankAfter"
select="false()"/>
@@ -3523,6 +3726,7 @@
<xsl:call-template
name="u:indent"/>
</xsl:if>
+
<xsl:text>.. class:: </xsl:text>
<xsl:value-of
select="@class"/>
@@ -3544,6 +3748,7 @@
<xsl:text>`</xsl:text>
<xsl:value-of
select="name(.)"/>
+
<xsl:text>' encountered</xsl:text>
<xsl:if
test="parent::*">
@@ -3553,6 +3758,7 @@
<xsl:text>'</xsl:text>
</xsl:if>
<xsl:text>, but no template matches.</xsl:text>
+
</xsl:message>
</xsl:template>
1
0
14 Jan '09
Author: chatellier
Date: 2009-01-14 11:03:24 +0000 (Wed, 14 Jan 2009)
New Revision: 246
Modified:
maven-jrst-plugin/trunk/src/site/site_en.xml
maven-jrst-plugin/trunk/src/site/site_fr.xml
Log:
Update skin version
Modified: maven-jrst-plugin/trunk/src/site/site_en.xml
===================================================================
--- maven-jrst-plugin/trunk/src/site/site_en.xml 2009-01-14 10:40:26 UTC (rev 245)
+++ maven-jrst-plugin/trunk/src/site/site_en.xml 2009-01-14 11:03:24 UTC (rev 246)
@@ -4,11 +4,12 @@
<skin>
<groupId>org.codelutin</groupId>
<artifactId>maven-lutin-skin</artifactId>
- <version>0.2.1</version>
+ <version>0.2.2</version>
</skin>
<bannerLeft>
<name>${project.name}</name>
+ <href>/</href>
</bannerLeft>
<bannerRight>
Modified: maven-jrst-plugin/trunk/src/site/site_fr.xml
===================================================================
--- maven-jrst-plugin/trunk/src/site/site_fr.xml 2009-01-14 10:40:26 UTC (rev 245)
+++ maven-jrst-plugin/trunk/src/site/site_fr.xml 2009-01-14 11:03:24 UTC (rev 246)
@@ -6,11 +6,12 @@
<skin>
<groupId>org.codelutin</groupId>
<artifactId>maven-lutin-skin</artifactId>
- <version>0.2.1</version>
+ <version>0.2.2</version>
</skin>
<bannerLeft>
<name>${project.name}</name>
+ <href>/</href>
</bannerLeft>
<bannerRight>
1
0
r245 - in maven-jrst-plugin/trunk: . src/main/java/org/codelutin/jrst/plugin src/site src/site/en src/site/en/rst src/site/fr/rst
by chatellier@users.labs.libre-entreprise.org 14 Jan '09
by chatellier@users.labs.libre-entreprise.org 14 Jan '09
14 Jan '09
Author: chatellier
Date: 2009-01-14 10:40:26 +0000 (Wed, 14 Jan 2009)
New Revision: 245
Added:
maven-jrst-plugin/trunk/README.txt
maven-jrst-plugin/trunk/changelog.txt
maven-jrst-plugin/trunk/src/site/en/
maven-jrst-plugin/trunk/src/site/en/rst/
maven-jrst-plugin/trunk/src/site/en/rst/index.rst
maven-jrst-plugin/trunk/src/site/site_en.xml
maven-jrst-plugin/trunk/src/site/site_fr.xml
Removed:
maven-jrst-plugin/trunk/changelog
maven-jrst-plugin/trunk/src/site/fr/rst/Todo.rst
maven-jrst-plugin/trunk/src/site/site.xml
Modified:
maven-jrst-plugin/trunk/pom.xml
maven-jrst-plugin/trunk/src/main/java/org/codelutin/jrst/plugin/JRstPlugin.java
maven-jrst-plugin/trunk/src/site/fr/rst/index.rst
Log:
Update lutinproject and site.
Add en site.
Added: maven-jrst-plugin/trunk/README.txt
===================================================================
--- maven-jrst-plugin/trunk/README.txt (rev 0)
+++ maven-jrst-plugin/trunk/README.txt 2009-01-14 10:40:26 UTC (rev 245)
@@ -0,0 +1,3 @@
+Maven JSRT Plugin
+=================
+
Deleted: maven-jrst-plugin/trunk/changelog
===================================================================
--- maven-jrst-plugin/trunk/changelog 2009-01-14 10:39:34 UTC (rev 244)
+++ maven-jrst-plugin/trunk/changelog 2009-01-14 10:40:26 UTC (rev 245)
@@ -1,8 +0,0 @@
-ver-0-8-3 thimel 200810XX
- * 20081008 [chemit] refactor plugin to generate ony when required
- * 20081008 [chemit] Using lutinpluginproject 3.0 in a better way :)
- * 20081008 [chemit] add log4j.properties
- * 20081008 [chemit] use a DirectoryScanner instead of FileAction since we do not want to parse scm admin files...
-
-ver-0-8-2 thimel 20080922
- * 20080922 [thimel] Using lutinpluginproject 3.0
Copied: maven-jrst-plugin/trunk/changelog.txt (from rev 243, maven-jrst-plugin/trunk/changelog)
===================================================================
--- maven-jrst-plugin/trunk/changelog.txt (rev 0)
+++ maven-jrst-plugin/trunk/changelog.txt 2009-01-14 10:40:26 UTC (rev 245)
@@ -0,0 +1,8 @@
+ver-0-8-3 thimel 200810XX
+ * 20081008 [chemit] refactor plugin to generate ony when required
+ * 20081008 [chemit] Using lutinpluginproject 3.0 in a better way :)
+ * 20081008 [chemit] add log4j.properties
+ * 20081008 [chemit] use a DirectoryScanner instead of FileAction since we do not want to parse scm admin files...
+
+ver-0-8-2 thimel 20080922
+ * 20080922 [thimel] Using lutinpluginproject 3.0
Property changes on: maven-jrst-plugin/trunk/changelog.txt
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: maven-jrst-plugin/trunk/pom.xml
===================================================================
--- maven-jrst-plugin/trunk/pom.xml 2009-01-14 10:39:34 UTC (rev 244)
+++ maven-jrst-plugin/trunk/pom.xml 2009-01-14 10:40:26 UTC (rev 245)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>lutinpluginproject</artifactId>
- <version>3.0</version>
+ <version>3.3</version>
</parent>
<!--groupId>org.codelutin</groupId-->
@@ -19,7 +19,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>jrst</artifactId>
- <version>0.8.3</version>
+ <version>0.8.4-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -33,7 +33,7 @@
<!-- ************************************************************* -->
<!-- *** Project Information ************************************* -->
<!-- ************************************************************* -->
- <name>Plugin maven JRst</name>
+ <name>Maven JRST Plugin</name>
<version>0.8.4-SNAPSHOT</version>
<description>
Plugin pour maven2 pour la génération de xdoc à partir de fichiers RST.
@@ -52,29 +52,10 @@
<!-- nom du projet sur le labs -->
<labs.project>jrst</labs.project>
+ <!-- Site en et fr -->
+ <maven.site.locales>fr,en</maven.site.locales>
</properties>
- <build>
- <plugins>
-
- <!-- plugin license switcher -->
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-license-switcher-plugin</artifactId>
- <version>0.2</version>
- <executions>
- <execution>
- <goals>
- <goal>license</goal>
- <goal>third-party</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-
<!-- ************************************************************* -->
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
@@ -84,31 +65,5 @@
<url>${maven.scm.url}</url>
</scm>
- <!-- Maven Environment : profiles -->
- <profiles>
- <profile>
- <id>license</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-license-switcher-plugin</artifactId>
- <version>0.2</version>
- <executions>
- <execution>
- <goals>
- <goal>switch</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
</project>
Modified: maven-jrst-plugin/trunk/src/main/java/org/codelutin/jrst/plugin/JRstPlugin.java
===================================================================
--- maven-jrst-plugin/trunk/src/main/java/org/codelutin/jrst/plugin/JRstPlugin.java 2009-01-14 10:39:34 UTC (rev 244)
+++ maven-jrst-plugin/trunk/src/main/java/org/codelutin/jrst/plugin/JRstPlugin.java 2009-01-14 10:40:26 UTC (rev 245)
@@ -40,22 +40,21 @@
import java.io.IOException;
/**
- * Génére du xdoc à partir de fichiers Rst.
+ * Transform rst site documentation into xdoc, to
+ * be used by maven
* <p/>
- * Les fichiers rst sont dans les repertoires:
- * <li> src/site/fr/rst/
- * <li> src/site/en/rst/
- * <li> src/site/es/rst/
- * <li> ...
- * <p/>
- * et ils iront au final dans:
- * <li> target/generated-rst/fr/xdoc/
- * <li> target/generated-rst/en/xdoc/
- * <li> target/generated-rst/es/xdoc/
- * <li> ...
- * <p/>
- * tous les autres fichiers iront dans target/generated-site en
- * respectant la meme hierarchie de repertoire.
+ * RST file have to be located in:
+ * <li>src/site/en/rst/</li>
+ * <li>src/site/fr/rst/</li>
+ * <li>src/site/es/rst/</li>
+ * <li>...</li>
+ * and they will be generated in :
+ * <li>target/generated-site/xdoc/ (if <tt>en</tt> is default language)</li>
+ * <li>target/generated-site/fr/xdoc/</li>
+ * <li>target/generated-site/es/xdoc/</li>
+ * <li>...</li>
+ * All other files will be put on <tt>target/generated-site</tt> in
+ * same directory structure.
*
* @goal jrst
* @phase pre-site
Added: maven-jrst-plugin/trunk/src/site/en/rst/index.rst
===================================================================
--- maven-jrst-plugin/trunk/src/site/en/rst/index.rst (rev 0)
+++ maven-jrst-plugin/trunk/src/site/en/rst/index.rst 2009-01-14 10:40:26 UTC (rev 245)
@@ -0,0 +1,102 @@
+Home
+====
+
+.. contents::
+
+Presentation
+------------
+
+Maven plugin to use JRST library.
+
+
+Operation
+---------
+
+Maven can't manage RST documentation file format. So, that's
+why maven-jrst-plugin has been made.
+
+It use the same directory structure for site sources, transform
+it into xdoc, and maven-site-plugin is used to build finale site.
+
+But, pom has to be configured:
+ - to pre generate xdoc file from rst
+ - change maven default site directory
+
+
+POM configuration
+-----------------
+
+pre-site : maven-jrst-plugin
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-jrst-plugin</artifactId>
+ <version>${jrst.version}</version>
+ <configuration>
+ <directoryIn>${basedir}/src/site</directoryIn>
+ <directoryOut>${project.build.directory}/generated-site</directoryOut>
+ <defaultLocale>en</defaultLocale>
+ <inputEncoding>UTF-8</inputEncoding>
+ <outputEncoding>UTF-8</outputEncoding>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>jrst</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+
+pre-site : maven-antrun-plugin
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This plugin is used to copy non rst files (such as images...)
+into the generation site directory.
+
+::
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${basedir}/src/site"/>
+ <copy todir="${project.build.directory}/generated-site" verbose="${maven.verbose}" overwrite="false">
+ <fileset dir="${basedir}/src/site">
+ <exclude name="**/rst/**"/>
+ </fileset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+
+site : maven-site-plugin
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.0-beta-7</version>
+ <configuration>
+ <siteDirectory>${project.build.directory}/generated-site</siteDirectory>
+ <inputEncoding>UTF-8</inputEncoding>
+ <outputEncoding>UTF-8</outputEncoding>
+ <generateReports>true</generateReports>
+ <locales>en,fr</locales>
+ </configuration>
+ </plugin>
\ No newline at end of file
Deleted: maven-jrst-plugin/trunk/src/site/fr/rst/Todo.rst
===================================================================
--- maven-jrst-plugin/trunk/src/site/fr/rst/Todo.rst 2009-01-14 10:39:34 UTC (rev 244)
+++ maven-jrst-plugin/trunk/src/site/fr/rst/Todo.rst 2009-01-14 10:40:26 UTC (rev 245)
@@ -1,2 +0,0 @@
-TODO
-====
\ No newline at end of file
Modified: maven-jrst-plugin/trunk/src/site/fr/rst/index.rst
===================================================================
--- maven-jrst-plugin/trunk/src/site/fr/rst/index.rst 2009-01-14 10:39:34 UTC (rev 244)
+++ maven-jrst-plugin/trunk/src/site/fr/rst/index.rst 2009-01-14 10:40:26 UTC (rev 245)
@@ -1,13 +1,102 @@
-maven-jrst-plugin
-=================
+Accueil
+=======
.. contents::
-
Présentation
------------
-Le plugin maven pour utiliser la librairie jrst TODO
+Le plugin maven pour utiliser la librairie jrst.
-**Veuillez consulter la JavaDoc pour de plus ample détails sur les différentes
-librairies.**
+Fonctionnement
+--------------
+
+Maven ne gere pas le RST par defaut, voilà pourquoi le plugin
+maven-jrst-plugin a été développé.
+
+Il utilise donc une structure similaire des sources des sites
+maven, mais les transforme en xdoc, et passe ensuite le relai
+à maven.
+
+Le pom, doit doit être configuré pour :
+ - demander la génération des fichiers xdoc
+ - changer le répertoire par défaut des sources du site
+
+
+Configuration du pom
+--------------------
+
+pre-site : maven-jrst-plugin
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-jrst-plugin</artifactId>
+ <version>${jrst.version}</version>
+ <configuration>
+ <directoryIn>${basedir}/src/site</directoryIn>
+ <directoryOut>${project.build.directory}/generated-site</directoryOut>
+ <defaultLocale>fr</defaultLocale>
+ <inputEncoding>UTF-8</inputEncoding>
+ <outputEncoding>UTF-8</outputEncoding>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>jrst</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+
+pre-site : maven-antrun-plugin
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ce plugin est utilisé pour copier les fichier "non-rst"
+dans le répertoire de generation de site.
+
+::
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${basedir}/src/site"/>
+ <copy todir="${project.build.directory}/generated-site" verbose="${maven.verbose}" overwrite="false">
+ <fileset dir="${basedir}/src/site">
+ <exclude name="**/rst/**"/>
+ </fileset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+
+site : maven-site-plugin
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.0-beta-7</version>
+ <configuration>
+ <siteDirectory>${project.build.directory}/generated-site</siteDirectory>
+ <inputEncoding>UTF-8</inputEncoding>
+ <outputEncoding>UTF-8</outputEncoding>
+ <generateReports>true</generateReports>
+ <locales>fr,en</locales>
+ </configuration>
+ </plugin>
\ No newline at end of file
Deleted: maven-jrst-plugin/trunk/src/site/site.xml
===================================================================
--- maven-jrst-plugin/trunk/src/site/site.xml 2009-01-14 10:39:34 UTC (rev 244)
+++ maven-jrst-plugin/trunk/src/site/site.xml 2009-01-14 10:40:26 UTC (rev 245)
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="${project.name}">
-
- <publishDate format="dd/MM/yyyy"/>
-
- <skin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-lutin-skin</artifactId>
- <version>0.2.1</version>
- </skin>
-
- <bannerLeft>
- <name>${project.name}</name>
- </bannerLeft>
-
- <bannerRight>
- <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
- <href>${project.organization.url}</href>
- </bannerRight>
-
- <poweredBy>
- <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
- <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
- <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText"
- img="images/restructuredtext-logo.png"/>
- </poweredBy>
-
- <body>
- <links>
- <item name="Labs" href="http://labs.libre-entreprise.org/"/>
- <item name="${project.organization.name}" href="${project.organization.url}"/>
- </links>
-
- <menu ref="parent"/>
- <menu name="Utilisateur">
- <item name="Accueil" href="index.html"/>
- <item name="Détail des goals" href="plugin-info.html">
- <item name="jrst:jrst" href="jrst-mojo.html"/>
- <item name="jrst:help" href="help-mojo.html"/>
- </item>
- </menu>
-
- <menu name="Téléchargement">
- <item href="${labs.builder.url}/org/codelutin/${project.artifactId}/${project.version}"
- name="Télécharger la dernière version"/>
- <item href="${labs.builder.url}/org/codelutin/${project.artifactId}"
- name="Voir toutes les versions"/>
- </menu>
-
- <menu name="Développeur">
- <item name="A faire" href="Todo.html"/>
- </menu>
-
- <menu ref="reports"/>
-
- </body>
-</project>
Added: maven-jrst-plugin/trunk/src/site/site_en.xml
===================================================================
--- maven-jrst-plugin/trunk/src/site/site_en.xml (rev 0)
+++ maven-jrst-plugin/trunk/src/site/site_en.xml 2009-01-14 10:40:26 UTC (rev 245)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <skin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-lutin-skin</artifactId>
+ <version>0.2.1</version>
+ </skin>
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ </bannerLeft>
+
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>${project.organization.url}</href>
+ </bannerRight>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
+ <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
+ <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText"
+ img="images/restructuredtext-logo.png"/>
+ </poweredBy>
+
+ <body>
+ <links>
+ <item name="Labs" href="http://labs.libre-entreprise.org/"/>
+ <item name="${project.organization.name}" href="${project.organization.url}"/>
+ <item name="[fr" href="../index.html"/>
+ <item name="en]" href="index.html"/>
+ </links>
+
+ <!--menu ref="parent"/ -->
+
+ <menu name="Users">
+ <item name="Home" href="index.html"/>
+ <item name="Goals" href="plugin-info.html">
+ <item name="jrst:jrst" href="jrst-mojo.html"/>
+ <item name="jrst:help" href="help-mojo.html"/>
+ </item>
+ </menu>
+
+ <menu name="Download">
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}/${project.version}"
+ name="Last version"/>
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}"
+ name="All versions"/>
+ </menu>
+
+ <!--menu name="Developper">
+ <item name="TODO" href="Todo.html"/>
+ </menu-->
+
+ <menu ref="reports"/>
+
+ </body>
+</project>
Copied: maven-jrst-plugin/trunk/src/site/site_fr.xml (from rev 243, maven-jrst-plugin/trunk/src/site/site.xml)
===================================================================
--- maven-jrst-plugin/trunk/src/site/site_fr.xml (rev 0)
+++ maven-jrst-plugin/trunk/src/site/site_fr.xml 2009-01-14 10:40:26 UTC (rev 245)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <publishDate format="dd/MM/yyyy"/>
+
+ <skin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-lutin-skin</artifactId>
+ <version>0.2.1</version>
+ </skin>
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ </bannerLeft>
+
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>${project.organization.url}</href>
+ </bannerRight>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
+ <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
+ <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText"
+ img="images/restructuredtext-logo.png"/>
+ </poweredBy>
+
+ <body>
+ <links>
+ <item name="Labs" href="http://labs.libre-entreprise.org/"/>
+ <item name="${project.organization.name}" href="${project.organization.url}"/>
+ <item name="[fr" href="index.html"/>
+ <item name="en]" href="en/index.html"/>
+ </links>
+
+ <!--menu ref="parent"/ -->
+
+ <menu name="Utilisateur">
+ <item name="Accueil" href="index.html"/>
+ <item name="Détail des goals" href="plugin-info.html">
+ <item name="jrst:jrst" href="jrst-mojo.html"/>
+ <item name="jrst:help" href="help-mojo.html"/>
+ </item>
+ </menu>
+
+ <menu name="Téléchargement">
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}/${project.version}"
+ name="Dernière version"/>
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}"
+ name="Toutes les versions"/>
+ </menu>
+
+ <!--menu name="Développeur">
+ <item name="A faire" href="Todo.html"/>
+ </menu-->
+
+ <menu ref="reports"/>
+
+ </body>
+</project>
Property changes on: maven-jrst-plugin/trunk/src/site/site_fr.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
1
0
Author: chatellier
Date: 2009-01-14 10:39:34 +0000 (Wed, 14 Jan 2009)
New Revision: 244
Added:
jrst/trunk/README.txt
jrst/trunk/changelog.txt
Removed:
jrst/trunk/changelog
Modified:
jrst/trunk/pom.xml
Log:
Update lutinproject and dependencies
Added: jrst/trunk/README.txt
===================================================================
--- jrst/trunk/README.txt (rev 0)
+++ jrst/trunk/README.txt 2009-01-14 10:39:34 UTC (rev 244)
@@ -0,0 +1,3 @@
+jRST
+====
+
Deleted: jrst/trunk/changelog
===================================================================
--- jrst/trunk/changelog 2008-10-23 14:15:30 UTC (rev 243)
+++ jrst/trunk/changelog 2009-01-14 10:39:34 UTC (rev 244)
@@ -1,15 +0,0 @@
-ver-0.8 xxx xxx
-
- * Add title property in xdoc xslt
- * Switch license to lgpl
- * maven 2 layout
-
-ver-0.7 poussin 20061110
-
- * complete rewrite where dom4j tree is use as memory model
- * parser is in 3 classes, reader, lexer, composer
- * generation is based on XSL (support, xhtml, xdoc, docbook, other xsl)
-
-ver-0.6 poussin 20060327
-
- * first version with only regexp and own memory model
\ No newline at end of file
Copied: jrst/trunk/changelog.txt (from rev 243, jrst/trunk/changelog)
===================================================================
--- jrst/trunk/changelog.txt (rev 0)
+++ jrst/trunk/changelog.txt 2009-01-14 10:39:34 UTC (rev 244)
@@ -0,0 +1,15 @@
+ver-0.8 xxx xxx
+
+ * Add title property in xdoc xslt
+ * Switch license to lgpl
+ * maven 2 layout
+
+ver-0.7 poussin 20061110
+
+ * complete rewrite where dom4j tree is use as memory model
+ * parser is in 3 classes, reader, lexer, composer
+ * generation is based on XSL (support, xhtml, xdoc, docbook, other xsl)
+
+ver-0.6 poussin 20060327
+
+ * first version with only regexp and own memory model
\ No newline at end of file
Property changes on: jrst/trunk/changelog.txt
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Modified: jrst/trunk/pom.xml
===================================================================
--- jrst/trunk/pom.xml 2008-10-23 14:15:30 UTC (rev 243)
+++ jrst/trunk/pom.xml 2009-01-14 10:39:34 UTC (rev 244)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>lutinproject</artifactId>
- <version>3.0</version>
+ <version>3.3</version>
</parent>
<!--A unique name for this project-->
@@ -31,10 +31,10 @@
<!-- nom du projet sur le labs -->
<labs.project>jrst</labs.project>
+
+ <!-- Test -->
+ <maven.test.skip>true</maven.test.skip>
- <!-- Test -->
- <maven.test.skip>true</maven.test.skip>
-
<!-- Site en et fr -->
<maven.site.locales>fr,en</maven.site.locales>
</properties>
@@ -51,6 +51,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
<configuration>
<archive>
<manifest>
@@ -64,11 +65,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
- <version>2.0</version>
+ <version>2.1</version>
<executions>
<execution>
- <id>copy-dependencies</id>
- <phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
@@ -81,6 +80,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.5</version>
<configuration>
<link>http://java.sun.com/javase/6/docs/api/index.html</link>
<link>http://topia.labs.libre-entreprise.org/apidocs/</link>
@@ -101,7 +101,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinutil</artifactId>
- <version>0.31</version>
+ <version>1.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -148,8 +148,10 @@
</dependency>
<dependency>
<groupId>net.sf.docbook</groupId>
- <artifactId>docbook</artifactId>
+ <artifactId>docbook-xsl</artifactId>
<version>1.74.0</version>
+ <type>zip</type>
+ <classifier>resources</classifier>
<scope>runtime</scope>
</dependency>
</dependencies>
1
0