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
- 916 discussions
r257 - in jrst/trunk/src/site: . en/rst/devel fr/rst/devel
by chatellier@users.labs.libre-entreprise.org 05 Feb '09
by chatellier@users.labs.libre-entreprise.org 05 Feb '09
05 Feb '09
Author: chatellier
Date: 2009-02-05 18:03:16 +0000 (Thu, 05 Feb 2009)
New Revision: 257
Modified:
jrst/trunk/src/site/en/rst/devel/externalDoc.rst
jrst/trunk/src/site/en/rst/devel/library.rst
jrst/trunk/src/site/fr/rst/devel/docExterne.rst
jrst/trunk/src/site/fr/rst/devel/librairies.rst
jrst/trunk/src/site/site_fr.xml
Log:
Update jrst site
Modified: jrst/trunk/src/site/en/rst/devel/externalDoc.rst
===================================================================
--- jrst/trunk/src/site/en/rst/devel/externalDoc.rst 2009-02-05 18:03:06 UTC (rev 256)
+++ jrst/trunk/src/site/en/rst/devel/externalDoc.rst 2009-02-05 18:03:16 UTC (rev 257)
@@ -8,4 +8,4 @@
XSL used to convert the XML into RST : http://www.merten-home.de/FreeSoftware/xml2rst/
-To generate javadoc in RST form : http://java.sun.com/j2se/1.3/docs/tooldocs/javadoc/overview.html
\ No newline at end of file
+To generate javadoc in RST form : http://java.sun.com/javase/6/docs/technotes/guides/javadoc/doclet/overview.…
\ No newline at end of file
Modified: jrst/trunk/src/site/en/rst/devel/library.rst
===================================================================
--- jrst/trunk/src/site/en/rst/devel/library.rst 2009-02-05 18:03:06 UTC (rev 256)
+++ jrst/trunk/src/site/en/rst/devel/library.rst 2009-02-05 18:03:16 UTC (rev 257)
@@ -26,6 +26,6 @@
Xmlunit_ used to compare two XML files to show their differences.
.. _dom4j: http://www.dom4j.org
-.. _javax.xml.transform: http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/package-summary…
+.. _javax.xml.transform: http://java.sun.com/javase/6/docs/api/javax/xml/transform/package-summary.h…
.. _SDoc: http://sdoc.sourceforge.net/wiki/pmwiki.php
.. _Xmlunit: http://xmlunit.sourceforge.net/
Modified: jrst/trunk/src/site/fr/rst/devel/docExterne.rst
===================================================================
--- jrst/trunk/src/site/fr/rst/devel/docExterne.rst 2009-02-05 18:03:06 UTC (rev 256)
+++ jrst/trunk/src/site/fr/rst/devel/docExterne.rst 2009-02-05 18:03:16 UTC (rev 257)
@@ -8,4 +8,4 @@
Un XSL permettant de convertir le XML en RST : http://www.merten-home.de/FreeSoftware/xml2rst/
-Pour la génération de la javaDoc en RST : http://java.sun.com/j2se/1.3/docs/tooldocs/javadoc/overview.html
\ No newline at end of file
+Pour la génération de la javaDoc en RST : http://java.sun.com/javase/6/docs/technotes/guides/javadoc/doclet/overview.…
\ No newline at end of file
Modified: jrst/trunk/src/site/fr/rst/devel/librairies.rst
===================================================================
--- jrst/trunk/src/site/fr/rst/devel/librairies.rst 2009-02-05 18:03:06 UTC (rev 256)
+++ jrst/trunk/src/site/fr/rst/devel/librairies.rst 2009-02-05 18:03:16 UTC (rev 257)
@@ -25,6 +25,6 @@
Xmlunit_ permet de comparer deux fichiers XML pour mettre en évidences les différences.
.. _dom4j: http://www.dom4j.org
-.. _javax.xml.transform: http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/package-summary…
+.. _javax.xml.transform: http://java.sun.com/javase/6/docs/api/javax/xml/transform/package-summary.h…
.. _SDoc: http://sdoc.sourceforge.net/wiki/pmwiki.php
.. _Xmlunit: http://xmlunit.sourceforge.net/
\ No newline at end of file
Modified: jrst/trunk/src/site/site_fr.xml
===================================================================
--- jrst/trunk/src/site/site_fr.xml 2009-02-05 18:03:06 UTC (rev 256)
+++ jrst/trunk/src/site/site_fr.xml 2009-02-05 18:03:16 UTC (rev 257)
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="JRst">
-
+
+ <publishDate format="dd/MM/yyyy"/>
+
<skin>
<groupId>org.codelutin</groupId>
<artifactId>maven-lutin-skin</artifactId>
1
0
r256 - in jrst/trunk: . src/test/java/org/codelutin/jrst
by chatellier@users.labs.libre-entreprise.org 05 Feb '09
by chatellier@users.labs.libre-entreprise.org 05 Feb '09
05 Feb '09
Author: chatellier
Date: 2009-02-05 18:03:06 +0000 (Thu, 05 Feb 2009)
New Revision: 256
Modified:
jrst/trunk/changelog.txt
jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java
Log:
Fix javadoc and copyright dates
Modified: jrst/trunk/changelog.txt
===================================================================
--- jrst/trunk/changelog.txt 2009-02-05 18:02:48 UTC (rev 255)
+++ jrst/trunk/changelog.txt 2009-02-05 18:03:06 UTC (rev 256)
@@ -1,5 +1,6 @@
ver-0.8.4 xxx 2009XXXX
+ * Fix javadoc
* Fix anchor in content
* Update xml2rst.xsl stylesheet
* Re add i18n plugin on build
Modified: jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java
===================================================================
--- jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java 2009-02-05 18:02:48 UTC (rev 255)
+++ jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java 2009-02-05 18:03:06 UTC (rev 256)
@@ -38,14 +38,14 @@
@Test
public void testRstToHtml() throws Exception {
- File test1 = File.createTempFile("jrst-test", ".html");
+ File test1 = File.createTempFile("jrst-RstToHtml", ".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");
+ File test1 = File.createTempFile("jrst-RstToHtml2", ".html");
JRST.main(new String[] { "-t", "html", "--force", "-o", test1.getAbsolutePath(), "src/test/resources/text.rst" });
test1.delete();
}
@@ -53,7 +53,7 @@
@Test
public void testRstToDocbook() throws Exception {
- File test1 = File.createTempFile("jrst-test", ".dbk");
+ File test1 = File.createTempFile("jrst-RstToDocbook", ".dbk");
JRST.main(new String[]{"-t", "docbook", "--force","-o", test1.getAbsolutePath(),
"src/test/resources/test.rst"});
test1.delete();
@@ -61,10 +61,10 @@
@Test
public void testRstToXdoc() throws Exception {
- File test1 = File.createTempFile("jrst-test", ".xdoc");
+ File test1 = File.createTempFile("jrst-RstToXdoc", ".xdoc");
JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
"src/test/resources/test.rst" });
- test1.delete();
+ //test1.delete();
}
/**
@@ -74,7 +74,7 @@
*/
@Ignore
public void testRstToXdoc2() throws Exception {
- File test1 = File.createTempFile("jrst-test", ".xdoc");
+ File test1 = File.createTempFile("jrst-RstToXdoc2", ".xdoc");
JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
"src/test/resources/test2.rst" });
test1.delete();
@@ -82,7 +82,7 @@
@Test
public void testRstToXdoc3() throws Exception {
- File test1 = File.createTempFile("jrst-test", ".xdoc");
+ File test1 = File.createTempFile("jrst-RstToXdoc3", ".xdoc");
JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
"src/test/resources/test3.rst" });
test1.delete();
@@ -90,7 +90,7 @@
@Test
public void testRstToXdoc4() throws Exception {
- File test1 = File.createTempFile("jrst-test", ".xdoc");
+ File test1 = File.createTempFile("jrst-RstToXdoc4", ".xdoc");
JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
"src/test/resources/test4.rst" });
test1.delete();
@@ -98,7 +98,7 @@
@Test
public void testRstToXdocJrstSite() throws Exception {
- File test1 = File.createTempFile("jrst-test", ".xdoc");
+ File test1 = File.createTempFile("jrst-RstToXdocJrstSite", ".xdoc");
JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
"src/test/resources/frEntier.rst" });
test1.delete();
1
0
r255 - in jrst/trunk/src/main/java/org/codelutin/jrst: . directive
by chatellier@users.labs.libre-entreprise.org 05 Feb '09
by chatellier@users.labs.libre-entreprise.org 05 Feb '09
05 Feb '09
Author: chatellier
Date: 2009-02-05 18:02:48 +0000 (Thu, 05 Feb 2009)
New Revision: 255
Modified:
jrst/trunk/src/main/java/org/codelutin/jrst/AdvancedReader.java
jrst/trunk/src/main/java/org/codelutin/jrst/DocumentHandler.java
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/JRSTDirective.java
jrst/trunk/src/main/java/org/codelutin/jrst/JRSTGenerator.java
jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java
jrst/trunk/src/main/java/org/codelutin/jrst/JRSTLexer.java
jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java
jrst/trunk/src/main/java/org/codelutin/jrst/ReStructuredText.java
jrst/trunk/src/main/java/org/codelutin/jrst/directive/ContentDirective.java
jrst/trunk/src/main/java/org/codelutin/jrst/directive/DateDirective.java
jrst/trunk/src/main/java/org/codelutin/jrst/directive/ImageDirective.java
jrst/trunk/src/main/java/org/codelutin/jrst/directive/SectnumDirective.java
Log:
Fix javadoc and copyright dates
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/AdvancedReader.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/AdvancedReader.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/AdvancedReader.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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>. ##%*/
-/* *
- * AdvancedReader.java
- *
- * Created: 27 oct. 06 00:24:57
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package org.codelutin.jrst;
import org.apache.commons.collections.primitives.ArrayCharList;
@@ -69,8 +57,13 @@
* + markChar
* </pre>
*
+ * Created: 27 oct. 06 00:24:57
+ *
* @author poussin
- *
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
public class AdvancedReader {
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/DocumentHandler.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/DocumentHandler.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/DocumentHandler.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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,7 +15,13 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-/* *
+package org.codelutin.jrst;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.Text;
+
+/**
* DocumentHandler.java
*
* Created: 30 oct. 06 10:22:52
@@ -26,18 +32,6 @@
* Last update: $Date$
* by : $Author$
*/
-
-package org.codelutin.jrst;
-
-import org.dom4j.Document;
-import org.dom4j.Element;
-import org.dom4j.Text;
-
-/**
- * @author poussin
- *
- */
-
public interface DocumentHandler {
public void startDocument(Document doc);
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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,17 +15,6 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-/* *
- * JRST.java
- *
- * Created: 3 nov. 06 20:56:00
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
package org.codelutin.jrst;
import static org.codelutin.i18n.I18n._;
@@ -51,7 +40,6 @@
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;
@@ -79,7 +67,13 @@
* FIXME: 'JRST --help' doesn't work, but 'JRST --help toto' work :( FIXME:
* 'JRST -c' doesn't work, but 'JRST -c toto'
*
+ * Created: 3 nov. 06 20:56:00
+ *
* @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
@CommandLineInterface(application = "JRST")
public class JRST {
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTDirective.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/JRSTDirective.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/JRSTDirective.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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,9 +15,14 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-/* *
- * JRSTDirective.java
- *
+package org.codelutin.jrst;
+
+import org.dom4j.Element;
+import org.dom4j.Node;
+
+/**
+ * JRSTDirective.
+ *
* Created: 4 nov. 06 12:49:39
*
* @author poussin
@@ -26,17 +31,6 @@
* Last update: $Date$
* by : $Author$
*/
-
-package org.codelutin.jrst;
-
-import org.dom4j.Element;
-import org.dom4j.Node;
-
-/**
- * @author poussin
- *
- */
-
public interface JRSTDirective {
/**
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTGenerator.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/JRSTGenerator.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/JRSTGenerator.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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>. ##%*/
-/* *
- * JRSTGenerator.java
- *
- * Created: 30 oct. 06 00:14:18
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package org.codelutin.jrst;
import org.apache.commons.logging.Log;
@@ -59,17 +47,23 @@
import java.util.LinkedList;
/**
- * Cette classe contient plusieurs methode pour generer, soit en utilisant une
+ * Cette classe contient plusieurs methodes pour générer, soit en utilisant une
* feuille de style {@link #generate(Document, URL, Writer)}, soit un
* {@link ContentHandler} avec {@link #generate(Document, ContentHandler)}, soit
* {@link DocumentHandler} avec {@link #generate(Document, ContentHandler)} ou
- * bien regenerer du RST avec {@link #generate(Document)} dans les deux dernier
- * cas il faut passer un {@link Writer} en paremetre du constructeur.
+ * bien regénérer du RST avec {@link #generate(Document)} dans les deux derniers
+ * cas il faut passer un {@link Writer} en parametre du constructeur.
* <p>
* On peut aussi transformer le {@link Document} en un autre {@link Document}
- * avec {@link #transform(Document, URL)}
- *
+ * avec {@link #transform(Document, URL, String...)}
+ *
+ * Created: 30 oct. 06 00:14:18
+ *
* @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
public class JRSTGenerator implements DocumentHandler {
@@ -114,14 +108,12 @@
*
* @param doc
* @throws IOException
- * @throws TransformerException
*/
public void generate(Document doc) throws IOException {
generate(doc, this);
}
- public void generate(Document doc, DocumentHandler handler)
- throws IOException {
+ public void generate(Document doc, DocumentHandler handler) {
DocumentWalker walker = new DocumentWalker(handler);
walker.walk(doc);
}
@@ -287,10 +279,7 @@
}
/*
- * (non-Javadoc)
- *
- * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String,
- * java.lang.String)
+ * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
*/
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException, IOException {
@@ -614,8 +603,8 @@
/**
* Ecrit le text, si indent est vrai, alors chaque ligne est indentée
*
- * @param text
- * @param indent
+ * @param text text to write
+ * @param doIndent do indent
*/
protected void write(String text, boolean doIndent) {
try {
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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
@@ -30,7 +29,6 @@
import java.awt.event.ActionListener;
import java.io.File;
import java.util.LinkedList;
-import java.util.Locale;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
@@ -47,10 +45,19 @@
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
-import org.codelutin.i18n.I18n;
import org.codelutin.util.Resource;
+/**
+ * JRST main interface.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
public class JRSTInterface extends JDialog {
+
/** serialVersionUID */
private static final long serialVersionUID = 5327326730753891936L;
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTLexer.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/JRSTLexer.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/JRSTLexer.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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>. ##%*/
-/* *
- * JRSTLexer.java
- *
- * Created: 28 oct. 06 00:44:20
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package org.codelutin.jrst;
import org.apache.commons.logging.Log;
@@ -55,9 +43,13 @@
* Pour mettre en place ce mecanisme le plus simple est d'utiliser les methodes
* {@link JRSTLexer#beginPeek()} et {@link JRSTLexer#endPeek()}
*
- *
- *
+ * Created: 28 oct. 06 00:44:20
+ *
* @author poussin, letellier
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
public class JRSTLexer {
@@ -225,7 +217,6 @@
/**
* remove one element from list of element already read
*
- * @return
* @throws IOException
*/
public void remove() throws IOException {
@@ -2244,7 +2235,6 @@
* return the number of line read
*
* @return int
- * @throws IOException
*/
public int getLineNumber() {
return in.getLineNumber();
@@ -2254,7 +2244,6 @@
* return the number of char read
*
* @return int
- * @throws IOException
*/
public int getCharNumber() {
return in.getCharNumber();
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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
@@ -147,15 +147,15 @@
*/
/**
- * * Le principe est d'utiliser les methodes peek* {@link JRSTLexer} pour
+ * Le principe est d'utiliser les methodes peek* {@link JRSTLexer} pour
* prendre l'element que l'on attend, si la methode retourne null ou un autre
* element et bien c que ce n'est pas le bon choix, cela veut dire que l'element
* courant est fini d'etre lu (plus de paragraphe dans la section par exemple)
* ou qu'il y a une erreur dans le fichier en entre.
* <p>
* On construit un arbre XML representant le RST au fur et a mesure, on peut
- * ensuite appliquer une fueille de style ou autre chose avec
- * {@link JRSTGeneratorTest}
+ * ensuite appliquer une feuille de style ou autre chose avec
+ * {@link JRSTGenerator}
*
* <p>
* Tous les elements ont un attribut level qui permet de savoir on il est dans
@@ -263,7 +263,13 @@
* warning (done)
* </pre>
*
+ * Created: 27 oct. 06 00:15:34
+ *
* @author poussin, letellier
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
public class JRSTReader {
@@ -320,6 +326,7 @@
}
/**
+ * @param name
* @return the defaultDirectives
*/
public static JRSTDirective getDefaultDirective(String name) {
@@ -327,8 +334,8 @@
}
/**
- * @param defaultDirectives
- * the defaultDirectives to set
+ * @param name
+ * @param directive the defaultDirectives to set
*/
public static void addDefaultDirectives(String name, JRSTDirective directive) {
JRSTReader.defaultDirectives.put(name, directive);
@@ -342,8 +349,8 @@
}
/**
- * @param JRSTDirective
- * the defaultDirectives to set
+ * @param name
+ * @param directive the defaultDirectives to set
*/
public void addDirectives(String name, JRSTDirective directive) {
directives.put(name, directive);
@@ -355,8 +362,7 @@
*
* @param reader
* @return
- * @throws IOException
- * @throws DocumentException
+ * @throws Exception
*/
public Document read(Reader reader) throws Exception {
JRSTLexer lexer = new JRSTLexer(reader);
@@ -998,7 +1004,6 @@
* @return Element
* @throws Exception
*/
- @SuppressWarnings("unchecked")
private Element[] composeFootnote(Element item) throws Exception {
Element[] result = null;
if (itemEquals("footnotes", item)) {
@@ -1109,7 +1114,6 @@
* @throws Exception
* @throws DocumentException
*/
- @SuppressWarnings("unchecked")
private Element composeOptionList(JRSTLexer lexer)
throws DocumentException, Exception {
Element item = lexer.peekOption();
@@ -1206,8 +1210,6 @@
* @return Element
* @throws Exception
*/
-
- @SuppressWarnings("unchecked")
private Element composeLineBlock(JRSTLexer lexer, Element item)
throws Exception {
Element result = null;
@@ -1279,7 +1281,6 @@
* @throws Exception
*
*/
-
private Element composeBlockQuote(Element item) throws Exception {
Element result = null;
result = DocumentHelper.createElement(BLOCK_QUOTE);
@@ -1403,7 +1404,6 @@
* @return Element
*
*/
- @SuppressWarnings("unchecked")
private Element composeTable(Element item) throws Exception {
Element result = DocumentHelper.createElement(TABLE);
@@ -1850,8 +1850,8 @@
* name
* @param Element
* e
- * @param boolean throwError
- * @param boolean eof
+ * @param throwError
+ * @param eof
* @return boolean
* @throws DocumentException
*/
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/ReStructuredText.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/ReStructuredText.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/ReStructuredText.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -15,8 +15,12 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-/* *
- * Docbook.java
+package org.codelutin.jrst;
+
+import java.util.regex.Pattern;
+
+/**
+ * ReStructuredText.
*
* Created: 27 oct. 06 11:10:30
*
@@ -26,16 +30,6 @@
* Last update: $Date$
* by : $Author$
*/
-
-package org.codelutin.jrst;
-
-import java.util.regex.Pattern;
-
-/**
- * @author poussin
- *
- */
-
public class ReStructuredText {
public static final String DTD = "http://docutils.sourceforge.net/docs/ref/docutils.dtd";
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/directive/ContentDirective.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/directive/ContentDirective.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/directive/ContentDirective.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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
@@ -22,11 +22,18 @@
import org.dom4j.Element;
import org.dom4j.Node;
+/**
+ * ContentDirective
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
public class ContentDirective implements JRSTDirective {
/*
- * (non-Javadoc)
- *
* @see org.codelutin.jrst.JRSTDirective#parse(org.dom4j.Element)
*/
public Node parse(Element e) {
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/directive/DateDirective.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/directive/DateDirective.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/directive/DateDirective.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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>. ##%*/
-/* *
- * DateDirective.java
- *
- * Created: 4 nov. 06 13:29:25
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package org.codelutin.jrst.directive;
import org.codelutin.jrst.JRSTDirective;
@@ -41,14 +29,17 @@
/**
* .. date:: .. time::
*
+ * Created: 4 nov. 06 13:29:25
+ *
* @author poussin
- *
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
public class DateDirective implements JRSTDirective {
/*
- * (non-Javadoc)
- *
* @see org.codelutin.jrst.JRSTDirective#parse(org.dom4j.Element)
*/
public Node parse(Element e) {
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/directive/ImageDirective.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/directive/ImageDirective.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/directive/ImageDirective.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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>. ##%*/
-/* *
- * Image.java
- *
- * Created: 4 nov. 06 12:52:02
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package org.codelutin.jrst.directive;
import org.codelutin.jrst.JRSTDirective;
@@ -44,7 +32,13 @@
* .. image:: picture.jpeg :height: 100 :width: 200 :scale: 50 :alt: alternate
* text :align: right
*
+ * Created: 4 nov. 06 12:52:02
+ *
* @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
public class ImageDirective implements JRSTDirective {
Modified: jrst/trunk/src/main/java/org/codelutin/jrst/directive/SectnumDirective.java
===================================================================
--- jrst/trunk/src/main/java/org/codelutin/jrst/directive/SectnumDirective.java 2009-02-05 17:30:06 UTC (rev 254)
+++ jrst/trunk/src/main/java/org/codelutin/jrst/directive/SectnumDirective.java 2009-02-05 18:02:48 UTC (rev 255)
@@ -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
@@ -22,11 +22,18 @@
import org.dom4j.Element;
import org.dom4j.Node;
+/**
+ * SectnumDirective.
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
public class SectnumDirective implements JRSTDirective {
/*
- * (non-Javadoc)
- *
* @see org.codelutin.jrst.JRSTDirective#parse(org.dom4j.Element)
*/
public Node parse(Element e) {
1
0
r254 - in maven-jrst-plugin/trunk: . src/main/java/org/codelutin/jrst/plugin src/site/fr/rst
by chatellier@users.labs.libre-entreprise.org 05 Feb '09
by chatellier@users.labs.libre-entreprise.org 05 Feb '09
05 Feb '09
Author: chatellier
Date: 2009-02-05 17:30:06 +0000 (Thu, 05 Feb 2009)
New Revision: 254
Modified:
maven-jrst-plugin/trunk/changelog.txt
maven-jrst-plugin/trunk/pom.xml
maven-jrst-plugin/trunk/src/main/java/org/codelutin/jrst/plugin/GenerationJRstException.java
maven-jrst-plugin/trunk/src/main/java/org/codelutin/jrst/plugin/JRstPlugin.java
maven-jrst-plugin/trunk/src/site/fr/rst/index.rst
Log:
Set default locale to 'en'
Remove some required setting for parameter with default values
Write javadoc in english
Modified: maven-jrst-plugin/trunk/changelog.txt
===================================================================
--- maven-jrst-plugin/trunk/changelog.txt 2009-01-16 18:21:20 UTC (rev 253)
+++ maven-jrst-plugin/trunk/changelog.txt 2009-02-05 17:30:06 UTC (rev 254)
@@ -1,3 +1,8 @@
+ver-0-8-4 chatellier 200902xx
+ * 20090205 Set default locale to 'en'
+ * 20090205 Remove some required setting for parameter with default values
+ * 20090205 Write javadoc in english
+
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 :)
Modified: maven-jrst-plugin/trunk/pom.xml
===================================================================
--- maven-jrst-plugin/trunk/pom.xml 2009-01-16 18:21:20 UTC (rev 253)
+++ maven-jrst-plugin/trunk/pom.xml 2009-02-05 17:30:06 UTC (rev 254)
@@ -36,7 +36,7 @@
<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.
+ Maven2 plugin to generate reStructuredText file into xDoc.
</description>
<inceptionYear>2006</inceptionYear>
@@ -54,6 +54,7 @@
<!-- Site en et fr -->
<maven.site.locales>fr,en</maven.site.locales>
+ <jrst.version>0.8.4-SNAPSHOT</jrst.version>
</properties>
<!-- ************************************************************* -->
Modified: maven-jrst-plugin/trunk/src/main/java/org/codelutin/jrst/plugin/GenerationJRstException.java
===================================================================
--- maven-jrst-plugin/trunk/src/main/java/org/codelutin/jrst/plugin/GenerationJRstException.java 2009-01-16 18:21:20 UTC (rev 253)
+++ maven-jrst-plugin/trunk/src/main/java/org/codelutin/jrst/plugin/GenerationJRstException.java 2009-02-05 17:30:06 UTC (rev 254)
@@ -1,5 +1,5 @@
/* *##% Plugin maven JRst
- * Copyright (C) 2006 - 2008 CodeLutin
+ * Copyright (C) 2006 - 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,22 +15,10 @@
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-/* *
- * GenerationJRstException.java
- *
- * Created: 14 avril 2006
- *
- * @author ruchaud
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package org.codelutin.jrst.plugin;
/**
- * GenerationJRstException
+ * GenerationJRstException.
*
* @author ruchaud
* @version $Revision$
@@ -42,9 +30,9 @@
/** serialVersionUID */
private static final long serialVersionUID = 7121169280356405413L;
-
- static private String filesErrors = "";
+ protected static String filesErrors = "";
+
public GenerationJRstException(String fileIn) {
filesErrors += fileIn + "\n";
}
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-16 18:21:20 UTC (rev 253)
+++ maven-jrst-plugin/trunk/src/main/java/org/codelutin/jrst/plugin/JRstPlugin.java 2009-02-05 17:30:06 UTC (rev 254)
@@ -1,5 +1,5 @@
/* *##% Plugin maven JRst
- * Copyright (C) 2006 - 2008 CodeLutin
+ * Copyright (C) 2006 - 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>. ##%*/
-/* *
- * JRstPlugin.java
- *
- * Created: 14 avril 2006
- *
- * @author ruchaud
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package org.codelutin.jrst.plugin;
import org.apache.maven.plugin.AbstractMojo;
@@ -58,111 +46,125 @@
*
* @goal jrst
* @phase pre-site
+ *
+ * Created: 14 avril 2006
+ *
+ * @author ruchaud
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
public class JRstPlugin extends AbstractMojo {
- /** La liste des ressource a copier si rien n'est specifie via la propriete includeResources */
+ /**
+ * Default copy patterns if {@link #includeResources}
+ * is <tt>null</tt>.
+ */
protected static final String[] DEFAULT_INCLUDE_RESOURCES = {
- "**\\/*.png",
- "**\\/*.jpeg",
- "**\\/*.jpg",
- "**\\/*.gif"
+ "**\\/*.png",
+ "**\\/*.jpeg",
+ "**\\/*.jpg",
+ "**\\/*.gif"
};
-
/**
- * Répertoire source des fichiers Rst
+ * Site source directory.
*
* @parameter default-value="src/site"
- * @required
+ * @since 0.8
*/
protected File directoryIn;
/**
- * Encoding en entrée
+ * Site source encoding.
*
* @parameter default-value="UTF-8"
+ * @since 0.8
*/
protected String inputEncoding = "UTF-8";
/**
- * Encoding en sortie
+ * Site generated directory.
*
- * @parameter default-value="UTF-8"
+ * @parameter default-value="target/generated-site"
+ * @since 0.8
*/
- protected String outputEncoding = "UTF-8";
-
+ protected File directoryOut;
+
/**
- * Répertoire cible des fichiers xdoc générée
+ * Site generated encoding.
*
- * @parameter default-value="target/generated-site"
- * @required
+ * @parameter default-value="UTF-8"
+ * @since 0.8
*/
- protected File directoryOut;
+ protected String outputEncoding = "UTF-8";
/**
- * Répertoire cible des fichiers resources générée
+ * Copied resource destination directory.
*
* @parameter default-value="target/generated-site/resources"
- * @required
+ * @since 0.8
*/
protected File resourceDirectoryOut;
/**
- * Arréte la génération en cas d'erreurs
+ * Ignore errors.
*
* @parameter default-value="true"
+ * @since 0.8
*/
protected boolean ignoreErrors = true;
/**
- * Ecrase les fichiers générés
+ * Overwrite already existing generated files.
*
* @parameter default-value="ifnewer"
+ * @since 0.8
*/
protected String overwrite = "ifnewer";
/**
- * La locale par defaut a utiliser.
+ * Default locale for generated files structure.
*
- * @parameter default-value="fr"
+ * @parameter default-value="en"
+ * @since 0.8
*/
- protected String defaultLocale = "fr";
+ protected String defaultLocale = "en";
/**
- * Permet d'obtenir plus d'information
+ * Verbose.
*
- * @parameter expression="${jrst.verbose}" default-value="${maven.verbose}"
+ * @parameter default-value="${maven.verbose}" expression="${jrst.verbose}"
+ * @since 0.8
*/
protected boolean verbose;
/**
- * Flag pour forcer la generation des rst et la copie des resources.
+ * Overwrite resources.
*
- * @parameter expression="${jrst.force}" default-value="false"
+ * @parameter default-value="false" expression="${jrst.force}"
+ * @since 0.8
*/
protected boolean force;
/**
- * La liste des ressources a recopier
+ * Resources patterns to copy.
*
* @parameter expression="${jrst.includeResources}"
+ * @since 0.8.3
*/
protected String[] includeResources;
/** Number of generated files. */
protected int numberFilesGenerates;
- /**
- * Retourne la langue par defaut precisé dans le pom.xml
- *
- * @return la langue par defaut precisé dans le pom.xml
+ /**
+ * Get overwrite.
+ *
+ * @see JRST.Overwrite
+ * @return the overwrite
*/
- protected String getDefaultLocale() {
- return defaultLocale;
- }
-
- /** @return the overwrite */
public JRST.Overwrite getOverwrite() {
JRST.Overwrite result = JRST.Overwrite.NEVER;
if (this.overwrite.contains("new")) {
@@ -174,28 +176,33 @@
return result;
}
+ /**
+ * Execute mojo.
+ */
public void execute() throws MojoExecutionException {
try {
actionGenerate();
} catch (GenerationJRstException e) {
- getLog().error("Error during generation for :\n"
- + GenerationJRstException.getFilesErrors());
+ getLog().error(
+ "Error during generation for :\n"
+ + GenerationJRstException.getFilesErrors());
if (!ignoreErrors) {
- throw new MojoExecutionException("Erreur lors de l'execution");
+ throw new MojoExecutionException("Error during generation");
}
}
actionCopy();
}
- private void actionGenerate() {
- getLog().info("Génération des fichier xdocs à partir des fichiers rst");
+ protected void actionGenerate() {
+ getLog().info("Generating reStructuredText files into xDoc");
- MirroredFileUpdater rstUpdater = new RstUpdater(directoryIn, directoryOut, defaultLocale);
-
+ MirroredFileUpdater rstUpdater = new RstUpdater(directoryIn,
+ directoryOut, defaultLocale);
+
numberFilesGenerates = 0;
DirectoryScanner ds = new DirectoryScanner();
ds.setBasedir(directoryIn);
- ds.setIncludes(new String[]{"**\\/*.rst"});
+ ds.setIncludes(new String[] { "**\\/*.rst" });
ds.scan();
String[] files = ds.getIncludedFiles();
@@ -204,7 +211,7 @@
if (!force && rstUpdater.isFileUpToDate(in)) {
if (verbose) {
- getLog().info("skip up-to-date rst file : " + in);
+ getLog().info("Skip up-to-date reStructuredText file : " + in);
}
continue;
}
@@ -212,7 +219,8 @@
doAction(in, rstUpdater.getMirrorFile(in));
}
- getLog().info("Generating " + numberFilesGenerates + " files to " + directoryOut);
+ getLog().info("Generating " + numberFilesGenerates + " files to "
+ + directoryOut);
}
public boolean doAction(File in, File out) {
@@ -220,8 +228,8 @@
getLog().info("Using " + in);
try {
- JRST.generate(JRST.TYPE_XDOC, in, inputEncoding,
- out, outputEncoding, getOverwrite());
+ JRST.generate(JRST.TYPE_XDOC, in, inputEncoding, out,
+ outputEncoding, getOverwrite());
numberFilesGenerates++;
} catch (Exception e) {
getLog().error(e);
@@ -238,27 +246,30 @@
}
protected void actionCopy() {
- getLog().info("Copie des fichiers images");
+ getLog().info("Copy resources files");
- MirroredFileUpdater resourceUpdater = new RessourceUpdater(directoryIn, resourceDirectoryOut, defaultLocale);
-
+ MirroredFileUpdater resourceUpdater = new RessourceUpdater(directoryIn,
+ resourceDirectoryOut, defaultLocale);
+
DirectoryScanner ds = new DirectoryScanner();
ds.setBasedir(directoryIn);
- ds.setIncludes(includeResources == null || includeResources.length == 0 ? DEFAULT_INCLUDE_RESOURCES : includeResources);
+ ds.setIncludes(includeResources == null
+ || includeResources.length == 0 ? DEFAULT_INCLUDE_RESOURCES
+ : includeResources);
ds.scan();
for (String file : ds.getIncludedFiles()) {
File in = new File(directoryIn, file);
if (!force && resourceUpdater.isFileUpToDate(in)) {
if (verbose) {
- getLog().info("skip up-to-date resource file : " + in);
+ getLog().info("Skip up-to-date resource file : " + in);
}
// do not copy the resource
continue;
}
File out = resourceUpdater.getMirrorFile(in);
if (verbose) {
- getLog().info("copy resource " + in + " to " + out);
+ getLog().info("Copy resource " + in + " to " + out);
}
try {
FileUtil.copy(in, out);
@@ -269,7 +280,7 @@
}
/**
- * An updater for rst files
+ * An updater for rst files.
*
* @author chemit
*/
@@ -277,23 +288,26 @@
protected String defaultLocale;
- protected RstUpdater(File sourceDirectory, File destinationDirectory, String defaultLocale) {
+ protected RstUpdater(File sourceDirectory, File destinationDirectory,
+ String defaultLocale) {
super(sourceDirectory, destinationDirectory);
this.defaultLocale = defaultLocale;
}
public File getMirrorFile(File f) {
String file = f.getAbsolutePath().substring(prefixSourceDirecotory);
- file = file.replace(".rst", ".xml").replaceFirst("([/\\\\])rst([/\\\\])", "$1xdoc$2");
+ file = file.replace(".rst", ".xml").replaceFirst(
+ "([/\\\\])rst([/\\\\])", "$1xdoc$2");
if (defaultLocale != null && !"".equals(defaultLocale)) {
- file = file.replaceFirst("([/\\\\])" + defaultLocale + "([/\\\\])", "$1");
+ file = file.replaceFirst("([/\\\\])" + defaultLocale
+ + "([/\\\\])", "$1");
}
return new File(destinationDirectory, file);
}
}
/**
- * An updater for resources files
+ * An updater for resources files.
*
* @author chemit
*/
@@ -301,7 +315,8 @@
protected String defaultLocale;
- protected RessourceUpdater(File sourceDirectory, File destinationDirectory, String defaultLocale) {
+ protected RessourceUpdater(File sourceDirectory,
+ File destinationDirectory, String defaultLocale) {
super(sourceDirectory, destinationDirectory);
this.defaultLocale = defaultLocale;
}
@@ -310,7 +325,8 @@
String file = f.getAbsolutePath().substring(prefixSourceDirecotory);
file = file.replaceFirst("([/\\\\])rst([/\\\\])", "$1$2");
if (defaultLocale != null && !"".equals(defaultLocale)) {
- file = file.replaceFirst("([/\\\\])" + defaultLocale + "([/\\\\])", "$1");
+ file = file.replaceFirst("([/\\\\])" + defaultLocale
+ + "([/\\\\])", "$1");
}
return new File(destinationDirectory, file);
}
Modified: maven-jrst-plugin/trunk/src/site/fr/rst/index.rst
===================================================================
--- maven-jrst-plugin/trunk/src/site/fr/rst/index.rst 2009-01-16 18:21:20 UTC (rev 253)
+++ maven-jrst-plugin/trunk/src/site/fr/rst/index.rst 2009-02-05 17:30:06 UTC (rev 254)
@@ -6,12 +6,12 @@
Présentation
------------
-Le plugin maven pour utiliser la librairie jrst.
+Le plugin maven2 pour utiliser la librairie jrst.
Fonctionnement
--------------
-Maven ne gere pas le RST par defaut, voilà pourquoi le plugin
+Maven ne gère pas le RST par défaut, voilà pourquoi le plugin
maven-jrst-plugin a été développé.
Il utilise donc une structure similaire des sources des sites
@@ -34,7 +34,7 @@
<plugin>
<groupId>org.codelutin</groupId>
<artifactId>maven-jrst-plugin</artifactId>
- <version>${jrst.version}</version>
+ <version>${maven-jrst-plugin.version}</version>
<configuration>
<directoryIn>${basedir}/src/site</directoryIn>
<directoryOut>${project.build.directory}/generated-site</directoryOut>
@@ -56,8 +56,8 @@
pre-site : maven-antrun-plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Ce plugin est utilisé pour copier les fichier "non-rst"
-dans le répertoire de generation de site.
+Ce plugin est utilisé pour copier les fichiers "non-rst"
+dans le répertoire de génération de site.
::
@@ -69,7 +69,9 @@
<configuration>
<tasks>
<mkdir dir="${basedir}/src/site"/>
- <copy todir="${project.build.directory}/generated-site" verbose="${maven.verbose}" overwrite="false">
+ <copy todir="${project.build.directory}/generated-site"
+ verbose="${maven.verbose}"
+ overwrite="false">
<fileset dir="${basedir}/src/site">
<exclude name="**/rst/**"/>
</fileset>
@@ -91,7 +93,6 @@
<plugin>
<artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-7</version>
<configuration>
<siteDirectory>${project.build.directory}/generated-site</siteDirectory>
<inputEncoding>UTF-8</inputEncoding>
1
0
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