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
May 2012
- 2 participants
- 40 discussions
r682 - in branches/jrst-docutils-jython/src/site: . resources resources/images resources/images/logos
by jpages@users.nuiton.org 29 May '12
by jpages@users.nuiton.org 29 May '12
29 May '12
Author: jpages
Date: 2012-05-29 11:02:20 +0200 (Tue, 29 May 2012)
New Revision: 682
Url: http://nuiton.org/repositories/revision/jrst/682
Log:
Ajout des images des logos du projet
Added:
branches/jrst-docutils-jython/src/site/resources/
branches/jrst-docutils-jython/src/site/resources/images/
branches/jrst-docutils-jython/src/site/resources/images/logos/
branches/jrst-docutils-jython/src/site/resources/images/logos/jrst-logo.png
branches/jrst-docutils-jython/src/site/resources/images/logos/restructuredtext-logo.png
Added: branches/jrst-docutils-jython/src/site/resources/images/logos/jrst-logo.png
===================================================================
(Binary files differ)
Property changes on: branches/jrst-docutils-jython/src/site/resources/images/logos/jrst-logo.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/jrst-docutils-jython/src/site/resources/images/logos/restructuredtext-logo.png
===================================================================
(Binary files differ)
Property changes on: branches/jrst-docutils-jython/src/site/resources/images/logos/restructuredtext-logo.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
Author: jpages
Date: 2012-05-29 10:57:14 +0200 (Tue, 29 May 2012)
New Revision: 681
Url: http://nuiton.org/repositories/revision/jrst/681
Log:
Ajout du profil maven-project-info-reports-plugin dans le pom du projet
Modified:
branches/jrst-docutils-jython/pom.xml
Modified: branches/jrst-docutils-jython/pom.xml
===================================================================
--- branches/jrst-docutils-jython/pom.xml 2012-05-29 08:47:10 UTC (rev 680)
+++ branches/jrst-docutils-jython/pom.xml 2012-05-29 08:57:14 UTC (rev 681)
@@ -456,6 +456,49 @@
<module>maven-jrst-plugin</module>
</modules>
</profile>
+
+ <profile>
+ <id>reporting</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+
+ <reporting>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>${projectInfoReportsPluginVersion}</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>project-team</report>
+ <report>mailing-list</report>
+ <report>cim</report>
+ <report>issue-tracking</report>
+ <report>license</report>
+ <report>scm</report>
+ <report>dependencies</report>
+ <report>dependency-convergence</report>
+ <report>plugin-management</report>
+ <report>plugins</report>
+ <report>dependency-management</report>
+ <report>summary</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ </plugins>
+ </reporting>
+
+ </profile>
+
</profiles>
+
+
</project>
1
0
r680 - in branches/jrst-docutils-jython: . jrst-doc/src/site src/site
by jpages@users.nuiton.org 29 May '12
by jpages@users.nuiton.org 29 May '12
29 May '12
Author: jpages
Date: 2012-05-29 10:47:10 +0200 (Tue, 29 May 2012)
New Revision: 680
Url: http://nuiton.org/repositories/revision/jrst/680
Log:
Modification des fichiers xmls relatifs au site (ajout banner right et links)
Modified:
branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml
branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml
branches/jrst-docutils-jython/pom.xml
branches/jrst-docutils-jython/src/site/site_en.xml
branches/jrst-docutils-jython/src/site/site_fr.xml
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml 2012-05-29 08:02:04 UTC (rev 679)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml 2012-05-29 08:47:10 UTC (rev 680)
@@ -25,22 +25,7 @@
-->
<project name="${project.name}">
- <skin>
- <groupId>org.apache.maven.skins</groupId>
- <artifactId>maven-fluido-skin</artifactId>
- <version>1.2.1</version>
- </skin>
- <custom>
- <fluidoSkin>
- <topBarEnabled>true</topBarEnabled>
- <googleSearch/>
- <sideBarEnabled>false</sideBarEnabled>
- <searchEnabled>true</searchEnabled>
- <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
- </fluidoSkin>
- </custom>
-
<poweredBy>
<logo href="http://jrst.labs.libre-entreprise.org" name="JRst"
img="${project.url}/images/jrst-logo.png"/>
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml 2012-05-29 08:02:04 UTC (rev 679)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml 2012-05-29 08:47:10 UTC (rev 680)
@@ -26,22 +26,6 @@
<project name="${project.name}">
- <skin>
- <groupId>org.apache.maven.skins</groupId>
- <artifactId>maven-fluido-skin</artifactId>
- <version>1.2.1</version>
- </skin>
-
- <custom>
- <fluidoSkin>
- <topBarEnabled>true</topBarEnabled>
- <googleSearch/>
- <sideBarEnabled>false</sideBarEnabled>
- <searchEnabled>true</searchEnabled>
- <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
- </fluidoSkin>
- </custom>
-
<poweredBy>
<logo href="http://jrst.labs.libre-entreprise.org" name="JRst"
img="${project.url}/images/jrst-logo.png"/>
Modified: branches/jrst-docutils-jython/pom.xml
===================================================================
--- branches/jrst-docutils-jython/pom.xml 2012-05-29 08:02:04 UTC (rev 679)
+++ branches/jrst-docutils-jython/pom.xml 2012-05-29 08:47:10 UTC (rev 680)
@@ -433,11 +433,11 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/jrst/trunk</connection>
+ <connection>scm:svn:http://svn.nuiton.org/svn/jrst/branches/jrst-docutils-jython</connection>
<developerConnection>
- scm:svn:http://svn.nuiton.org/svn/jrst/trunk
+ scm:svn:http://svn.nuiton.org/svn/jrst/branches/jrst-docutils-jython
</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/jrst/trunk</url>
+ <url>http://www.nuiton.org/repositories/browse/jrst/branches/jrst-docutils-jython</url>
</scm>
<distributionManagement>
Modified: branches/jrst-docutils-jython/src/site/site_en.xml
===================================================================
--- branches/jrst-docutils-jython/src/site/site_en.xml 2012-05-29 08:02:04 UTC (rev 679)
+++ branches/jrst-docutils-jython/src/site/site_en.xml 2012-05-29 08:47:10 UTC (rev 680)
@@ -25,12 +25,32 @@
-->
<project name="${project.name}">
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.2.1</version>
+ </skin>
+ <custom>
+ <fluidoSkin>
+ <topBarEnabled>true</topBarEnabled>
+ <googleSearch/>
+ <sideBarEnabled>false</sideBarEnabled>
+ <searchEnabled>true</searchEnabled>
+ <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
+ </fluidoSkin>
+ </custom>
+
<bannerLeft>
<name>${project.name}</name>
<href>/</href>
</bannerLeft>
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
+
<poweredBy>
<logo href="http://maven.apache.org" name="Maven"
img="${project.url}/images/logos/maven-feather.png"/>
@@ -42,7 +62,9 @@
</breadcrumbs>
<links>
- <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/"/>
+ <item name="Nuiton.org" href="http://nuiton.org"/>
+ <item name="Code Lutin" href="http://www.codelutin.com"/>
+ <item name="Libre entreprise" href="http://www.libre-entreprise.org"/>
</links>
<menu name="Language">
Modified: branches/jrst-docutils-jython/src/site/site_fr.xml
===================================================================
--- branches/jrst-docutils-jython/src/site/site_fr.xml 2012-05-29 08:02:04 UTC (rev 679)
+++ branches/jrst-docutils-jython/src/site/site_fr.xml 2012-05-29 08:47:10 UTC (rev 680)
@@ -26,11 +26,32 @@
<project name="${project.name}">
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.2.1</version>
+ </skin>
+
+ <custom>
+ <fluidoSkin>
+ <topBarEnabled>true</topBarEnabled>
+ <googleSearch/>
+ <sideBarEnabled>false</sideBarEnabled>
+ <searchEnabled>true</searchEnabled>
+ <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
+ </fluidoSkin>
+ </custom>
+
<bannerLeft>
<name>${project.name}</name>
<href>/</href>
</bannerLeft>
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
+
<poweredBy>
<logo href="http://maven.apache.org" name="Maven"
img="${project.url}/images/logos/maven-feather.png"/>
@@ -39,7 +60,9 @@
<body>
<links>
- <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/"/>
+ <item name="Nuiton.org" href="http://nuiton.org"/>
+ <item name="Code Lutin" href="http://www.codelutin.com"/>
+ <item name="Libre entreprise" href="http://www.libre-entreprise.org"/>
</links>
<breadcrumbs>
1
0
r679 - in branches/jrst-docutils-jython: . docutils doxia-module-jrst/src/main/java/org/nuiton/jrst doxia-module-jrst/src/site jrst jrst/src/main/java/org/nuiton/jrst jrst/src/site jrst-doc jrst-doc/src/site jrst-doc/src/site/en/rst/devel jrst-doc/src/site/resources/schemas jrst-doc/src/site/rst/devel maven-jrst-plugin/src/site src/site
by jpages@users.nuiton.org 29 May '12
by jpages@users.nuiton.org 29 May '12
29 May '12
Author: jpages
Date: 2012-05-29 10:02:04 +0200 (Tue, 29 May 2012)
New Revision: 679
Url: http://nuiton.org/repositories/revision/jrst/679
Log:
Mise ?\195?\160 jour des fichiers XML relatifs au site (ajout dans le footer de maven-site-nuiton.org.js )
Mise ?\195?\160 jour de la documentation d?\195?\169veloppeur (diagrammeGeneration)
Ajout dans les changelogs des modifications apport?\195?\169es par Jrst 1.6
Modified:
branches/jrst-docutils-jython/changelog.txt
branches/jrst-docutils-jython/docutils/changelog.txt
branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java
branches/jrst-docutils-jython/doxia-module-jrst/src/site/site_en.xml
branches/jrst-docutils-jython/doxia-module-jrst/src/site/site_fr.xml
branches/jrst-docutils-jython/jrst-doc/changelog.txt
branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/developerDoc.rst
branches/jrst-docutils-jython/jrst-doc/src/site/resources/schemas/diagrammeGeneration.png
branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docDeveloppeur.rst
branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml
branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml
branches/jrst-docutils-jython/jrst/changelog.txt
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java
branches/jrst-docutils-jython/jrst/src/site/site_en.xml
branches/jrst-docutils-jython/jrst/src/site/site_fr.xml
branches/jrst-docutils-jython/maven-jrst-plugin/src/site/site_en.xml
branches/jrst-docutils-jython/maven-jrst-plugin/src/site/site_fr.xml
branches/jrst-docutils-jython/src/site/site_en.xml
branches/jrst-docutils-jython/src/site/site_fr.xml
Modified: branches/jrst-docutils-jython/changelog.txt
===================================================================
--- branches/jrst-docutils-jython/changelog.txt 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/changelog.txt 2012-05-29 08:02:04 UTC (rev 679)
@@ -1,3 +1,7 @@
+1.6.0 jpages 20120529
+
+ * Add footer script maven-site-nuiton.org.js
+
1.0.1 xxx 200909xx
* Add port in url regex
Modified: branches/jrst-docutils-jython/docutils/changelog.txt
===================================================================
--- branches/jrst-docutils-jython/docutils/changelog.txt 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/docutils/changelog.txt 2012-05-29 08:02:04 UTC (rev 679)
@@ -1,3 +1,7 @@
+version-0.9 20120525
+
+ * Uses now docutils 0.9
+
version-0.8.1 20120417
* first version with docutils 0.8.1
\ No newline at end of file
Modified: branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java
===================================================================
--- branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2012-05-29 08:02:04 UTC (rev 679)
@@ -29,6 +29,9 @@
import java.io.FileWriter;
import java.io.Reader;
import java.io.StringReader;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.maven.doxia.module.xdoc.XdocParser;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.sink.Sink;
@@ -52,6 +55,7 @@
try {
// Write the source in a file to use it with JRST
File sourceFile = File.createTempFile("source",".rst");
+ sourceFile.deleteOnExit();
FileWriter fileWriter = new FileWriter(sourceFile);
IOUtil.copy(source, fileWriter);
Modified: branches/jrst-docutils-jython/doxia-module-jrst/src/site/site_en.xml
===================================================================
--- branches/jrst-docutils-jython/doxia-module-jrst/src/site/site_en.xml 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/doxia-module-jrst/src/site/site_en.xml 2012-05-29 08:02:04 UTC (rev 679)
@@ -66,5 +66,24 @@
<menu ref="reports"/>
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
</body>
</project>
Modified: branches/jrst-docutils-jython/doxia-module-jrst/src/site/site_fr.xml
===================================================================
--- branches/jrst-docutils-jython/doxia-module-jrst/src/site/site_fr.xml 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/doxia-module-jrst/src/site/site_fr.xml 2012-05-29 08:02:04 UTC (rev 679)
@@ -66,5 +66,24 @@
<menu ref="reports"/>
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
</body>
</project>
Modified: branches/jrst-docutils-jython/jrst/changelog.txt
===================================================================
--- branches/jrst-docutils-jython/jrst/changelog.txt 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/jrst/changelog.txt 2012-05-29 08:02:04 UTC (rev 679)
@@ -1,3 +1,7 @@
+ver 1.6.0 jpages 20120525
+ * XML generation with Jython and DocUtils
+ * PDF generation with IText from HTML
+
ver 1.0.0 ?
* migrate to org.nuiton groupId
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-29 08:02:04 UTC (rev 679)
@@ -118,7 +118,7 @@
/** XSL Stylesheet to transform Docbook into PDF. */
protected static final String DOCBOOK_2_FO = "/docbook/fo/docbook.xsl";
- public static final String PATTERN_TYPE = "xml|xhtml|docbook|html|htmlInnerBody|xdoc|rst|fo|pdf|odt|rtf";
+ public static final String PATTERN_TYPE = "xml|xhtml|docbook|html|htmlInnerBody|xdoc|rst|fo|pdf";
/** HTML output format type */
public static final String TYPE_HTML = "html";
Modified: branches/jrst-docutils-jython/jrst/src/site/site_en.xml
===================================================================
--- branches/jrst-docutils-jython/jrst/src/site/site_en.xml 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/jrst/src/site/site_en.xml 2012-05-29 08:02:04 UTC (rev 679)
@@ -85,5 +85,24 @@
<menu ref="reports"/>
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
</body>
</project>
Modified: branches/jrst-docutils-jython/jrst/src/site/site_fr.xml
===================================================================
--- branches/jrst-docutils-jython/jrst/src/site/site_fr.xml 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/jrst/src/site/site_fr.xml 2012-05-29 08:02:04 UTC (rev 679)
@@ -87,5 +87,24 @@
<menu ref="reports"/>
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
</body>
</project>
Modified: branches/jrst-docutils-jython/jrst-doc/changelog.txt
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/changelog.txt 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/jrst-doc/changelog.txt 2012-05-29 08:02:04 UTC (rev 679)
@@ -1,3 +1,9 @@
+ver 1.6.0 jpages 20120525
+ * New skin (fluido)
+ * New version of dev documentation (Jython, DocUtils and IText)
+ * Warnings and errors fixed
+
+
ver 1.0.0 ?
* migrate to org.nuiton groupId
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/developerDoc.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/developerDoc.rst 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/developerDoc.rst 2012-05-29 08:02:04 UTC (rev 679)
@@ -39,7 +39,7 @@
Generation
==========
-|diagrammegeneration|
+|diagrammeGeneration|
Links :
@@ -49,6 +49,7 @@
* XMLmind (convertion from FO towards ODT and RTF) : http://www.xmlmind.com/foconverter/what_is_xfc.html
* FOP (convertion from FO towards PDF) : http://xmlgraphics.apache.org/fop
+ * IText (convertion from HTML towards PDF) : http://itextpdf.com/
Use exemple
===========
@@ -140,6 +141,6 @@
.. _Cascading Style Sheets: http://en.wikipedia.org/wiki/Cascading_Style_Sheets
.. _DocUtils: http://docutils.sourceforge.net/docs/ref/doctree.html
.. _Jython: http://jython.org/index.html
-.. |diagrammegeneration| image:: images/diagrammeGeneration.png
-.. |classDiagramme| image:: images/DiagrammeClass.png
-.. |sequenceDiagramme| image:: images/DiagrammeSequence.png
+.. |diagrammeGeneration| image:: images/diagrammeGeneration.png
+.. |classDiagramme| image:: images/diagrammeClass.png
+.. |sequenceDiagramme| image:: images/diagrammeSequence.png
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/resources/schemas/diagrammeGeneration.png
===================================================================
(Binary files differ)
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docDeveloppeur.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docDeveloppeur.rst 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docDeveloppeur.rst 2012-05-29 08:02:04 UTC (rev 679)
@@ -53,6 +53,7 @@
* XMLmind (convertion de FO vers ODT et RTF) : http://www.xmlmind.com/foconverter/what_is_xfc.html
* FOP (convertion de FO vers PDF) : http://xmlgraphics.apache.org/fop
+ * IText (convertion de HTML vers PDF) : http://itextpdf.com/
Exemple d'utilisation
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml 2012-05-29 08:02:04 UTC (rev 679)
@@ -93,5 +93,24 @@
href="http://sonar.nuiton.org/sonar/project/index/org.nuiton:jrst"/>
</menu>
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
</body>
</project>
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml 2012-05-29 08:02:04 UTC (rev 679)
@@ -96,5 +96,24 @@
href="http://sonar.nuiton.org/sonar/project/index/org.nuiton:jrst"/>
</menu>
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
</body>
</project>
Modified: branches/jrst-docutils-jython/maven-jrst-plugin/src/site/site_en.xml
===================================================================
--- branches/jrst-docutils-jython/maven-jrst-plugin/src/site/site_en.xml 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/maven-jrst-plugin/src/site/site_en.xml 2012-05-29 08:02:04 UTC (rev 679)
@@ -68,5 +68,24 @@
<menu ref="reports"/>
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
</body>
</project>
Modified: branches/jrst-docutils-jython/maven-jrst-plugin/src/site/site_fr.xml
===================================================================
--- branches/jrst-docutils-jython/maven-jrst-plugin/src/site/site_fr.xml 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/maven-jrst-plugin/src/site/site_fr.xml 2012-05-29 08:02:04 UTC (rev 679)
@@ -66,6 +66,25 @@
</menu>
<menu ref="reports"/>
-
+
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
</body>
</project>
Modified: branches/jrst-docutils-jython/src/site/site_en.xml
===================================================================
--- branches/jrst-docutils-jython/src/site/site_en.xml 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/src/site/site_en.xml 2012-05-29 08:02:04 UTC (rev 679)
@@ -48,6 +48,9 @@
<menu name="Language">
<item name="Français" href="../index.html"/>
<item name="English" href="index.html"/>
+ <item name="Nuiton.org" href="http://nuiton.org"/>
+ <item name="Code Lutin" href="http://www.codelutin.com"/>
+ <item name="Libre entreprise" href="http://www.libre-entreprise.org"/>
</menu>
<menu name="Community">
@@ -68,5 +71,24 @@
</menu>
<menu ref="reports"/>
+
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
</body>
</project>
Modified: branches/jrst-docutils-jython/src/site/site_fr.xml
===================================================================
--- branches/jrst-docutils-jython/src/site/site_fr.xml 2012-05-25 13:49:52 UTC (rev 678)
+++ branches/jrst-docutils-jython/src/site/site_fr.xml 2012-05-29 08:02:04 UTC (rev 679)
@@ -49,6 +49,9 @@
<menu name="Langue">
<item name="Français" href="index.html"/>
<item name="English" href="./en/index.html"/>
+ <item name="Nuiton.org" href="http://nuiton.org"/>
+ <item name="Code Lutin" href="http://www.codelutin.com"/>
+ <item name="Libre entreprise" href="http://www.libre-entreprise.org"/>
</menu>
<menu name="Communauté">
@@ -66,5 +69,24 @@
<menu ref="modules"/>
<menu ref="reports"/>
+
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
</body>
</project>
1
0
r678 - in branches/jrst-docutils-jython/jrst-doc/src/site: en/rst/devel en/rst/user rst/devel rst/user
by jpages@users.nuiton.org 25 May '12
by jpages@users.nuiton.org 25 May '12
25 May '12
Author: jpages
Date: 2012-05-25 15:49:52 +0200 (Fri, 25 May 2012)
New Revision: 678
Url: http://nuiton.org/repositories/revision/jrst/678
Log:
Correction de la documentation (plus de warning ou error).
Modified:
branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/Todo.rst
branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/XSLpresentation.rst
branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/developerDoc.rst
branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/externalDoc.rst
branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/library.rst
branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/user/RSTpresentation.rst
branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/user/functionality.rst
branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/Todo.rst
branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docDeveloppeur.rst
branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docExterne.rst
branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/presentationXSL.rst
branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/faq.rst
branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/fonctionnalites.rst
branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/presentationRST.rst
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/Todo.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/Todo.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/Todo.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
====
Todo
====
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/XSLpresentation.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/XSLpresentation.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/XSLpresentation.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
=====================================
XSL (Extensible Stylesheets Language)
=====================================
@@ -124,7 +125,7 @@
``|`` left|right Indicate an alternative (a node either the other (or both))
/ person/name Access path to the elements (person/arm/left)
* * Pattern "joker" indicating any element
-``//`` ``//``person Indicate all the node descendants
+``//`` ``//`` person Indicate all the node descendants
. . Characterize the current node
``..`` ``..`` Indicate the parent node
@ @value Indicate a characteristic attribute
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/developerDoc.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/developerDoc.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/developerDoc.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
=======================
Developer Documentation
=======================
@@ -111,6 +112,7 @@
.. topic:: Titre
:Author: Letellier Sylvain
+
.. Attention:: this text must be interpreted independently
because it must be interpreted like a **paragraph**
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/externalDoc.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/externalDoc.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/externalDoc.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
======================
External documentation
======================
@@ -32,4 +33,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/javase/6/docs/technotes/guides/javadoc/doclet/overview.…
\ No newline at end of file
+To generate javadoc in RST form : http://java.sun.com/javase/6/docs/technotes/guides/javadoc/doclet/overview.…
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/library.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/library.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/devel/library.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
=====================
Various librairy used
=====================
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/user/RSTpresentation.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/user/RSTpresentation.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/user/RSTpresentation.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
=========================
A ReStructuredText Primer
=========================
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/user/functionality.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/user/functionality.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/en/rst/user/functionality.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
=========================
Functionalities suggested
=========================
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/Todo.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/Todo.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/Todo.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
====
Todo
====
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docDeveloppeur.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docDeveloppeur.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docDeveloppeur.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -129,6 +129,7 @@
Pour cela, il faut utiliser la commande::
JRST -x fichierXSL, fichierXSL2 fichierRST
+
ou::
JRST --xslFile fichierXSL, fichierXSL2 fichierRST
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docExterne.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docExterne.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/docExterne.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
=====================
Documentation externe
=====================
@@ -32,4 +33,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/javase/6/docs/technotes/guides/javadoc/doclet/overview.…
\ 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.…
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/presentationXSL.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/presentationXSL.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/rst/devel/presentationXSL.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
========================================
Le XSL (Extensible Stylesheets Language)
========================================
@@ -126,17 +127,17 @@
La notation Xpath permet de définir des patterns, c'est-à-dire des chaînes de caractères permettant de repérer
un noeud dans le document XML. Les principaux patterns sont :
-======= ============== =================================================================
-Pattern Exemple Signification
-======= ============== =================================================================
-``|`` Gauche|Milieu Indique une alternative (un noeud ou bien l'autre (ou les deux))
-/ personne/nom Chemin d'accès aux éléments (personne/bras/gauche)
-* * Motif "joker" désignant n'importe quel élément
-``//`` ``//``personne Indique tous les descendants d'un noeud
-. . Caractérise le noeud courant
-``..`` ``..`` Désigne le noeud parent
-@ @valeur Indique un attribut caractéristique
-======= ============== =================================================================
+======= =============== =================================================================
+Pattern Exemple Signification
+======= =============== =================================================================
+``|`` Gauche|Milieu Indique une alternative (un noeud ou bien l'autre (ou les deux))
+/ personne/nom Chemin d'accès aux éléments (personne/bras/gauche)
+* * Motif "joker" désignant n'importe quel élément
+``//`` ``//`` personne Indique tous les descendants d'un noeud
+. . Caractérise le noeud courant
+``..`` ``..`` Désigne le noeud parent
+@ @valeur Indique un attribut caractéristique
+======= =============== =================================================================
La transformation peut être réalisée :
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/faq.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/faq.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/faq.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
===
FAQ
===
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/fonctionnalites.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/fonctionnalites.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/fonctionnalites.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
=========================
Fonctionnalités proposées
=========================
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/presentationRST.rst
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/presentationRST.rst 2012-05-25 13:10:47 UTC (rev 677)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/rst/user/presentationRST.rst 2012-05-25 13:49:52 UTC (rev 678)
@@ -22,6 +22,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
===============================
Introduction à ReStructuredText
===============================
@@ -83,11 +84,11 @@
__ http://docutils.sourceforge.net/docs/rst/quickref.html#inline-markup
Dans les paragraphes et le corps du texte, nous pouvons utiliser
-des marqueurs pour *italique* avec "`` *italique* ``" ou **gras**
-avec "`` **gras** ``".
+des marqueurs pour *italique* avec " `` *italique* `` " ou **gras**
+avec " `` **gras** `` ".
Notez qu'aucun traitement supplémentaire n'est apporté entre deux
-doubles apostrophes inversées -- les astérisques, comme dans "`` * ``",
+doubles apostrophes inversées -- les astérisques, comme dans " `` * `` ",
sont donc conservées en l'état.
Si vous souhaitez utiliser un de ces caractères "spéciaux" dans
@@ -102,9 +103,6 @@
``\*``
-(``\*`` n'est pas implanté dans le JRST seul les `` fonctionnent)
-
-
__ http://docutils.sourceforge.net/docs/rst/quickref.html#escaping
Listes
1
0
r677 - in branches/jrst-docutils-jython/doxia-module-jrst: . src/main/java/org/nuiton/jrst
by jpages@users.nuiton.org 25 May '12
by jpages@users.nuiton.org 25 May '12
25 May '12
Author: jpages
Date: 2012-05-25 15:10:47 +0200 (Fri, 25 May 2012)
New Revision: 677
Url: http://nuiton.org/repositories/revision/jrst/677
Log:
Coorection de JRSTParser pour la g?\195?\169n?\195?\169ration de site.
Modified:
branches/jrst-docutils-jython/doxia-module-jrst/changelog.txt
branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java
Modified: branches/jrst-docutils-jython/doxia-module-jrst/changelog.txt
===================================================================
--- branches/jrst-docutils-jython/doxia-module-jrst/changelog.txt 2012-05-25 10:03:29 UTC (rev 676)
+++ branches/jrst-docutils-jython/doxia-module-jrst/changelog.txt 2012-05-25 13:10:47 UTC (rev 677)
@@ -1,3 +1,7 @@
+doxia-module-jrst (1.6.0)
+
+ * JrstParser use now JRST.java methods to generate the site
+
doxia-module-jrst (1.1.0) ?
* migrate to nuiton
Modified: branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java
===================================================================
--- branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2012-05-25 10:03:29 UTC (rev 676)
+++ branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2012-05-25 13:10:47 UTC (rev 677)
@@ -56,8 +56,12 @@
IOUtil.copy(source, fileWriter);
// Generation of the xml file
+ // Transformation to XML
Document doc = JRST.generateDocutils(sourceFile);
+ // Application of xsl stylesheets
+ doc = JRST.generateXml(doc, JRST.TYPE_XDOC);
+
// Give xsl result to XDoc parser
Reader reader = new StringReader(doc.asXML());
super.parse(reader, sink);
1
0
r676 - branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst
by jpages@users.nuiton.org 25 May '12
by jpages@users.nuiton.org 25 May '12
25 May '12
Author: jpages
Date: 2012-05-25 12:03:29 +0200 (Fri, 25 May 2012)
New Revision: 676
Url: http://nuiton.org/repositories/revision/jrst/676
Log:
Completed JRST javadoc.
Modified:
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-25 09:30:55 UTC (rev 675)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-25 10:03:29 UTC (rev 676)
@@ -42,6 +42,8 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.TransformerException;
+
+import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.Document;
@@ -52,7 +54,6 @@
import org.nuiton.jrst.convertisor.DocUtils2RST;
import org.nuiton.jrst.convertisor.DocUtilsVisitor;
import org.nuiton.util.ApplicationConfig;
-import org.nuiton.util.FileUtil;
import org.nuiton.util.Resource;
import org.nuiton.util.StringUtil;
import org.python.util.PythonInterpreter;
@@ -192,14 +193,6 @@
}
- static public String getMimeType(String generationType) {
- String result = mimeType.get(generationType);
- if (result == null) {
- result = "application/octet-stream";
- }
- return result;
- }
-
/**
* Main method.
*
@@ -285,8 +278,8 @@
File fileOut, Overwrite overwrite) throws Exception {
if (fileOut != null
&& fileOut.exists()
- && (overwrite == Overwrite.NEVER || (overwrite == Overwrite.IFNEWER && FileUtil
- .isNewer(fileIn, fileOut)))) {
+ && (overwrite == Overwrite.NEVER || (overwrite == Overwrite.IFNEWER && FileUtils
+ .isFileNewer(fileIn, fileOut)))) {
log.info("Don't generate file " + fileOut
+ ", because already exists");
@@ -308,11 +301,10 @@
}
/**
- * TODO !
+ * Transforms a restructured text file to a XML file using Jython interpreter to execute DocUtils scripts.
*
- *
- * @param in
- * @return
+ * @param in Input restructured text file (.rst)
+ * @return A document which contains XML code
* @throws Exception
*/
public static Document generateDocutils(File in) throws Exception {
@@ -377,11 +369,11 @@
}
/**
- * TODO !
+ * Applies XSL stylesheet(s) to a XML document
*
- * @param doc
- * @param xslListOrOutType
- * @return
+ * @param doc A document which contains XML code
+ * @param xslListOrOutType String which describes transformations to apply to the XML document
+ * @return A document which contains XML transformed by XSL stylesheets
* @throws IOException
* @throws TransformerException
*/
@@ -419,10 +411,10 @@
}
/**
- * TODO !
+ * Writes the XML content generated in a file
*
- * @param doc
- * @param fileOut
+ * @param doc Document which contains XML code
+ * @param fileOut Output file
* @throws IOException
*/
public static void generateFile(Document doc, File fileOut) throws IOException {
@@ -448,11 +440,11 @@
}
/**
- * TODO !
+ * Generates PDF file with IText with an HTML document
*
- * @param result
- * @param fileIn
- * @param fileOut
+ * @param result Document which contains HTML code
+ * @param fileIn ReST file used to build resources path
+ * @param fileOut PDF Output file
* @throws Exception
*/
public static void generatePdf(Document result, File fileIn, File fileOut) throws Exception {
1
0
25 May '12
Author: sletellier
Date: 2012-05-25 11:30:55 +0200 (Fri, 25 May 2012)
New Revision: 675
Url: http://nuiton.org/repositories/revision/jrst/675
Log:
- Up to mavenpom 3.3.1
- Up all dependencies versions
- Optimize imports
- Remove unused dependencies
- Remove unused classes
- Update third party
- Refactor JRST generate methods
- Fill some javadoc
Removed:
branches/jrst-docutils-jython/docutils/docutils.iml
branches/jrst-docutils-jython/jrst/src/main/java/org/dom4j/io/
Modified:
branches/jrst-docutils-jython/doxia-module-jrst/pom.xml
branches/jrst-docutils-jython/doxia-module-jrst/src/license/THIRD-PARTY.properties
branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java
branches/jrst-docutils-jython/doxia-module-jrst/src/test/java/org/nuiton/jrst/JrstParserTest.java
branches/jrst-docutils-jython/jrst-doc/pom.xml
branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml
branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml
branches/jrst-docutils-jython/jrst/pom.xml
branches/jrst-docutils-jython/jrst/src/license/THIRD-PARTY.properties
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/DocumentWalker.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfig.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfigAction.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfigOption.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTGenerator.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTInterface.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTResourceResolver.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTUserAgent.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/convertisor/DocUtils2RST.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java
branches/jrst-docutils-jython/pom.xml
Deleted: branches/jrst-docutils-jython/docutils/docutils.iml
===================================================================
--- branches/jrst-docutils-jython/docutils/docutils.iml 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/docutils/docutils.iml 2012-05-25 09:30:55 UTC (rev 675)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src/main/resources/docutils" isTestSource="false" />
- <excludeFolder url="file://$MODULE_DIR$/target" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- </component>
-</module>
-
Modified: branches/jrst-docutils-jython/doxia-module-jrst/pom.xml
===================================================================
--- branches/jrst-docutils-jython/doxia-module-jrst/pom.xml 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/doxia-module-jrst/pom.xml 2012-05-25 09:30:55 UTC (rev 675)
@@ -79,11 +79,6 @@
</dependency>
<dependency>
- <groupId>org.nuiton</groupId>
- <artifactId>nuiton-utils</artifactId>
- </dependency>
-
- <dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<scope>runtime</scope>
Modified: branches/jrst-docutils-jython/doxia-module-jrst/src/license/THIRD-PARTY.properties
===================================================================
--- branches/jrst-docutils-jython/doxia-module-jrst/src/license/THIRD-PARTY.properties 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/doxia-module-jrst/src/license/THIRD-PARTY.properties 2012-05-25 09:30:55 UTC (rev 675)
@@ -4,27 +4,30 @@
# - Apache License
# - BSD License
# - BSD style
+# - Bouncy Castle Licence
+# - Bouncy Castle License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
# - Common Public License Version 1.0
+# - GNU Lesser General Public License (LGPL), version 2.1
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
+# - Mozilla Public License
# - Mozilla Public License Version 1.0
-# - Mozilla Public License version 1.1
# - The Apache Software License, Version 2.0
+# - The Jython License
+# - The Werken Company License
# - X License (http://icu-project.org/repos/icu/icu4j/trunk/main/shared/licenses/license.h…)
# - http://classworlds.codehaus.org/license.html
-# - http://jaxen.codehaus.org/license.html
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Fri Dec 16 17:05:07 CET 2011
+#Fri May 25 10:28:45 CEST 2012
com.ibm.icu--icu4j--2.6.1=X License (http\://icu-project.org/repos/icu/icu4j/trunk/main/shared/licenses/license.html)
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD
-jaxen--jaxen--1.1.1=http\://jaxen.codehaus.org/license.html
jdom--jdom--1.0=The Apache Software License, Version 2.0
org.codehaus.plexus--plexus-classworlds--1.2-alpha-9=http\://classworlds.co…
Modified: branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java
===================================================================
--- branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -25,19 +25,15 @@
package org.nuiton.jrst;
-import java.io.*;
-import java.net.URL;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.Reader;
+import java.io.StringReader;
import org.apache.maven.doxia.module.xdoc.XdocParser;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.sink.Sink;
import org.codehaus.plexus.util.IOUtil;
import org.dom4j.Document;
-import org.nuiton.util.FileUtil;
-import org.nuiton.util.Resource;
-import sun.nio.ch.FileKey;
/**
* Parse an RST model, transform it into xdoc model and emit events into the
@@ -60,7 +56,7 @@
IOUtil.copy(source, fileWriter);
// Generation of the xml file
- Document doc = JRST.generateXML(sourceFile, JRST.TYPE_XDOC);
+ Document doc = JRST.generateDocutils(sourceFile);
// Give xsl result to XDoc parser
Reader reader = new StringReader(doc.asXML());
Modified: branches/jrst-docutils-jython/doxia-module-jrst/src/test/java/org/nuiton/jrst/JrstParserTest.java
===================================================================
--- branches/jrst-docutils-jython/doxia-module-jrst/src/test/java/org/nuiton/jrst/JrstParserTest.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/doxia-module-jrst/src/test/java/org/nuiton/jrst/JrstParserTest.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -25,14 +25,13 @@
package org.nuiton.jrst;
+import java.io.Reader;
+import java.io.StringWriter;
import org.apache.maven.doxia.AbstractModuleTest;
import org.apache.maven.doxia.module.xdoc.XdocSink;
import org.apache.maven.doxia.parser.Parser;
import org.apache.maven.doxia.sink.Sink;
-import java.io.Reader;
-import java.io.StringWriter;
-
/**
* @author chatellier
* @version $Revision : 1$
Modified: branches/jrst-docutils-jython/jrst/pom.xml
===================================================================
--- branches/jrst-docutils-jython/jrst/pom.xml 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/pom.xml 2012-05-25 09:30:55 UTC (rev 675)
@@ -50,26 +50,20 @@
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
- <dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
+
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
- <!--dependency>
- <groupId>commons-primitives</groupId>
- <artifactId>commons-primitives</artifactId>
- </dependency-->
<dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
</dependency>
+
<dependency>
<groupId>org.nuiton.i18n</groupId>
<artifactId>nuiton-i18n</artifactId>
@@ -79,42 +73,39 @@
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</dependency>
+
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<scope>runtime</scope>
</dependency>
- <!-- Apache FOP (Formatting Objects Processor) XSL-FO -->
+
<dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>fop</artifactId>
- </dependency>
- <dependency>
<groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>
<scope>runtime</scope>
</dependency>
- <!-- <dependency>
- <artifactId>xalan</artifactId>
- <groupId>xalan</groupId>
- </dependency> -->
+
<dependency>
<groupId>net.sf.docbook</groupId>
<artifactId>docbook-xsl</artifactId>
<type>zip</type>
<classifier>resources</classifier>
</dependency>
+
<!-- Test librairies -->
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.nuiton.thirdparty</groupId>
<artifactId>sdoc</artifactId>
@@ -210,7 +201,7 @@
<configuration>
<outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
<includeGroupIds>net.sf.docbook</includeGroupIds>
- <includeArtifacIds>docbook-xsl</includeArtifacIds>
+ <includeArtifactIds>docbook-xsl</includeArtifactIds>
<includeTypes>zip</includeTypes>
<includeClassifiers>resources</includeClassifiers>
<excludeTransitive>true</excludeTransitive>
Modified: branches/jrst-docutils-jython/jrst/src/license/THIRD-PARTY.properties
===================================================================
--- branches/jrst-docutils-jython/jrst/src/license/THIRD-PARTY.properties 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/license/THIRD-PARTY.properties 2012-05-25 09:30:55 UTC (rev 675)
@@ -2,28 +2,31 @@
#-------------------------------------------------------------------------------
# Already used licenses in project :
# - BSD License
+# - BSD style
+# - Bouncy Castle License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
# - Common Public License Version 1.0
+# - GNU Lesser General Public License (LGPL), version 2.1
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
# - MIT/X Consortium License
+# - Mozilla Public License
# - Mozilla Public License Version 1.0
-# - Mozilla Public License version 1.1
# - The Apache Software License, Version 2.0
+# - The Jython License
+# - The Werken Company License
# - X License (http://icu-project.org/repos/icu/icu4j/trunk/main/shared/licenses/license.h…)
-# - http://jaxen.codehaus.org/license.html
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Aug 18 07:17:49 CEST 2011
+#Fri May 25 10:25:29 CEST 2012
com.ibm.icu--icu4j--2.6.1=X License (http\://icu-project.org/repos/icu/icu4j/trunk/main/shared/licenses/license.html)
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD
-jaxen--jaxen--1.1.1=http\://jaxen.codehaus.org/license.html
jdom--jdom--1.0=The Apache Software License, Version 2.0
net.sf.docbook--docbook-xsl--1.76.1=MIT/X Consortium License
org.nuiton.thirdparty--sdoc--0.5.0-beta-patchcl=Lesser General Public License (LGPL) v 3.0
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/DocumentWalker.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/DocumentWalker.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/DocumentWalker.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -25,6 +25,7 @@
package org.nuiton.jrst;
+import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.Document;
@@ -32,8 +33,6 @@
import org.dom4j.Node;
import org.dom4j.Text;
-import java.util.List;
-
/**
* DocumentWalker.
*
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -26,20 +26,27 @@
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
import java.net.URL;
-import java.util.*;
-
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.TransformerException;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
-import org.dom4j.io.MyDocumentInputSource;
import org.nuiton.i18n.I18n;
import org.nuiton.i18n.init.ClassPathI18nInitializer;
import org.nuiton.jrst.convertisor.DocUtils2RST;
@@ -77,7 +84,7 @@
public static final String BANG = "!";
- public static final String FILE_PREFIX = "file:";
+ public static final String FILE_URI_PREFIX = "file:";
public enum Overwrite {
NEVER, IFNEWER, ALLTIME
@@ -87,23 +94,28 @@
protected static Log log = LogFactory.getLog(JRST.class);
/** XSL Stylesheet to transform RST into HTML. */
- protected static final String rst2xhtml = "/xsl/rst2xhtml.xsl";
+ protected static final String RST_2_XHTML = "/xsl/rst2xhtml.xsl";
+
/** XSL Stylesheet to transform RST into HTML (but only inner body fragment). */
- protected static final String rst2xhtmlInnerBody = "/xsl/rst2xhtmlInnerBody.xsl";
+ protected static final String XSL_RST_2_XHTML_INNER_BODY_XSL = "/xsl/rst2xhtmlInnerBody.xsl";
+
/** XSL Stylesheet to transform RST into Xdoc. */
- protected static final String rst2xdoc = "/xsl/rst2xdoc.xsl";
+ protected static final String RST_2_XDOC = "/xsl/rst2xdoc.xsl";
+
/** XSL Stylesheet to transform RST into Docbook. */
- protected static final String rst2docbook = "/xsl/dn2dbk.xsl";
+ protected static final String RST_2_DOCBOOK = "/xsl/dn2dbk.xsl";
/** XSL Stylesheet to transform Docbook into xHTML. */
- protected static final String docbook2xhtml = "/docbook/xhtml/docbook.xsl";
+ protected static final String DOCBOOK_2_XHTML = "/docbook/xhtml/docbook.xsl";
+
/** XSL Stylesheet to transform Docbook into javahelp. */
- protected static final String docbook2javahelp = "/docbook/javahelp/javahelp.xsl";
+ protected static final String DOCBOOK_2_JAVAHELP = "/docbook/javahelp/javahelp.xsl";
+
/** XSL Stylesheet to transform Docbook into htmlhelp. */
- protected static final String docbook2htmlhelp = "/docbook/htmlhelp/htmlhelp.xsl";
+ protected static final String DOCBOOK_2_HTMLHELP = "/docbook/htmlhelp/htmlhelp.xsl";
/** XSL Stylesheet to transform Docbook into PDF. */
- protected static final String docbook2fo = "/docbook/fo/docbook.xsl";
+ protected static final String DOCBOOK_2_FO = "/docbook/fo/docbook.xsl";
public static final String PATTERN_TYPE = "xml|xhtml|docbook|html|htmlInnerBody|xdoc|rst|fo|pdf|odt|rtf";
@@ -154,17 +166,16 @@
static {
stylesheets = new HashMap<String, String>();
- stylesheets.put(TYPE_HTML, rst2xhtml);
- stylesheets.put(TYPE_HTML_INNER_BODY, rst2xhtmlInnerBody);
- stylesheets.put(TYPE_XDOC, rst2xdoc);
- stylesheets.put(TYPE_DOCBOOK, rst2docbook);
- stylesheets.put(TYPE_XHTML, rst2docbook + "," + docbook2xhtml);
- stylesheets.put(TYPE_JAVAHELP, rst2docbook + "," + docbook2javahelp);
- stylesheets.put(TYPE_HTMLHELP, rst2docbook + "," + docbook2htmlhelp);
+ stylesheets.put(TYPE_HTML, RST_2_XHTML);
+ stylesheets.put(TYPE_HTML_INNER_BODY, XSL_RST_2_XHTML_INNER_BODY_XSL);
+ stylesheets.put(TYPE_XDOC, RST_2_XDOC);
+ stylesheets.put(TYPE_DOCBOOK, RST_2_DOCBOOK);
+ stylesheets.put(TYPE_XHTML, RST_2_DOCBOOK + "," + DOCBOOK_2_XHTML);
+ stylesheets.put(TYPE_JAVAHELP, RST_2_DOCBOOK + "," + DOCBOOK_2_JAVAHELP);
+ stylesheets.put(TYPE_HTMLHELP, RST_2_DOCBOOK + "," + DOCBOOK_2_HTMLHELP);
stylesheets.put(TYPE_RST, "");
- //stylesheets.put(TYPE_ODT, rst2docbook + "," + docbook2odf);
- stylesheets.put(TYPE_FO, rst2docbook + "," + docbook2fo);
- stylesheets.put(TYPE_PDF, rst2xhtml);
+ stylesheets.put(TYPE_FO, RST_2_DOCBOOK + "," + DOCBOOK_2_FO);
+ stylesheets.put(TYPE_PDF, RST_2_XHTML);
mimeType = new HashMap<String, String>();
mimeType.put(TYPE_HTML, "text/html");
@@ -225,15 +236,14 @@
overwrite = Overwrite.ALLTIME;
}
- generateDocutils(xslList, inputFile, ouputFile, overwrite);
+ generate(xslList, inputFile, ouputFile, overwrite);
}
private static String[] askOption() throws SecurityException,
- NoSuchMethodException, IOException {
+ NoSuchMethodException, IOException {
String[] result = null;
try {
- GraphicsEnvironment ge = GraphicsEnvironment
- .getLocalGraphicsEnvironment();
+ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
if (!(gs == null)) {
if (gs.length > 0) {
@@ -245,18 +255,17 @@
}
return result;
-
}
/**
* Graphical user interface
*
- * @return
+ * @return command as string
* @throws SecurityException
* @throws NoSuchMethodException
*/
protected static String[] askOptionGraph() throws SecurityException,
- NoSuchMethodException {
+ NoSuchMethodException {
JRSTInterface graph = new JRSTInterface(PATTERN_TYPE);
@@ -272,82 +281,112 @@
* @param overwrite The rule to overwrite file (NEVER, IFNEWER or ALLTIME )
* @throws Exception
*/
- public static void generateDocutils(String outputType, File fileIn,
+ public static void generate(String outputType, File fileIn,
File fileOut, Overwrite overwrite) throws Exception {
if (fileOut != null
&& fileOut.exists()
&& (overwrite == Overwrite.NEVER || (overwrite == Overwrite.IFNEWER && FileUtil
.isNewer(fileIn, fileOut)))) {
+
log.info("Don't generate file " + fileOut
+ ", because already exists");
} else {
- // Out
- OutputStream outputStream = new FileOutputStream(fileOut);
- // Generate XML
- Document doc = generateXML(fileIn, outputType);
+ // Transformation to XML
+ Document doc = generateDocutils(fileIn);
+ // Application of xsl stylesheets
+ doc = generateXml(doc, outputType);
+
// generation PDF
if (outputType.equals("pdf")) {
- generatePdf(doc, fileIn, outputStream);
+ generatePdf(doc, fileIn, fileOut);
} else {
- generateFile(doc, outputStream);
+ generateFile(doc, fileOut);
}
}
}
+ /**
+ * TODO !
+ *
+ *
+ * @param in
+ * @return
+ * @throws Exception
+ */
+ public static Document generateDocutils(File in) throws Exception {
- public static void generateFile(Document doc, OutputStream outputStream) throws IOException {
- // If the output file type si not "pdf", we can write in the final file
- OutputStreamWriter writer = null;
+ ByteArrayOutputStream out = null;
+
try {
- writer = new OutputStreamWriter(outputStream, UTF_8);
+ // Transformation to XML
+ out = new ByteArrayOutputStream();
- // write generated document
- writer.write(doc.asXML());
- }catch (Exception eee) {
- log.error("Failed to write file", eee);
- } finally {
- if (writer != null) {
- writer.close();
+ // Transformation of the __run__ URL into a path that python will use
+ // For example the URL is :
+ // jar:file:/home/user/.m2/repository/org/nuiton/jrst/docutils/1.6-SNAPSHOT/docutils-1.6-SNAPSHOT.jar!/__run__.py
+ // and it becomes :
+ // /home/user/.m2/repository/org/nuiton/jrst/docutils/1.6-SNAPSHOT/docutils-1.6-SNAPSHOT.jar/
+ URL resource = JRST.class.getResource("/" + DOCUTILS_LAUNCHER);
+ String docutilsPath = resource.getPath()
+ .replaceAll(DOCUTILS_LAUNCHER, "");
+
+ docutilsPath = docutilsPath.replaceAll(BANG, "");
+ docutilsPath = docutilsPath.replaceAll(FILE_URI_PREFIX, "");
+
+ // Import of the main script to use docutils ( __run__ )
+ PythonInterpreter interp = new PythonInterpreter();
+ String commandImport = IMPORT_SCRIPT;
+ interp.exec(commandImport);
+
+ // If the OS is windows, escapes the backslashs in the filepath
+ String filePath = in.getAbsolutePath();
+ String property = System.getProperty(OS_NAME).toLowerCase();
+ if (property.contains(WINDOWS_NAME)) {
+ filePath = filePath.replaceAll("\\\\", "\\\\\\\\");
}
- }
- }
+ // Sets an output stream in the python interpreter and executes the code
+ interp.setOut(out);
- public static void generatePdf(Document result, File fileIn, OutputStream outputStream) throws Exception {
- try {
- // Creation of the document builder
- DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- builder.setEntityResolver(result.getEntityResolver());
+ // Execution of the docutils script to transform rst to xml
+ String commandExec = String.format("__run__.exec_docutils('%s', '%s', '%s')",
+ docutilsPath, TYPE_XML, filePath);
+ interp.exec(commandExec);
- // We must redifine our own DocumentInputSource because of the visibility
- MyDocumentInputSource source = new MyDocumentInputSource(result);
- org.w3c.dom.Document doc = builder.parse(source);
+ // Cleans the python interpreter to avoid problems if they are multiple execution of this method
+ interp.cleanup();
- ITextRenderer renderer = new ITextRenderer();
+ // Transforms the output stream to a document
+ String xmlString = new String(out.toByteArray(), UTF_8);
- // Settings to resolve paths with the JRST User Agent
- String absolutePath = fileIn.getParentFile().getAbsolutePath();
- JRSTUserAgent jrstUserAgent = new JRSTUserAgent(absolutePath);
- jrstUserAgent.setBaseURL(absolutePath);
- renderer.getSharedContext().setUserAgentCallback(jrstUserAgent);
- jrstUserAgent.setSharedContext(renderer.getSharedContext());
+ Document doc = null;
+ try {
+ doc = DocumentHelper.parseText(xmlString);
+ } catch (DocumentException e) {
+ log.error("Error during the creation of the document", e);
+ }
- // Generation of the pdf file
- renderer.setDocument(doc, null);
- renderer.layout();
- renderer.createPDF(outputStream);
- } catch (Exception eee) {
- log.error("Failed to write PDF", eee);
+ return doc;
} finally {
- outputStream.close();
+ if (out != null) {
+ out.close();
+ }
}
}
+ /**
+ * TODO !
+ *
+ * @param doc
+ * @param xslListOrOutType
+ * @return
+ * @throws IOException
+ * @throws TransformerException
+ */
+ public static Document generateXml(Document doc, String xslListOrOutType) throws IOException, TransformerException {
- private static Document applyXsls(Document doc, String xslListOrOutType) throws IOException, TransformerException {
-
// search xsl file list to apply
String xslList = stylesheets.get(xslListOrOutType);
if (xslListOrOutType == null) {
@@ -358,7 +397,7 @@
JRSTGenerator gen = new JRSTGenerator();
String[] xsls = StringUtil.split(xslList, ",");
for (String xsl : xsls) {
- URL stylesheet = null;
+ URL stylesheet;
File file = new File(xsl);
if (file.exists()) {
stylesheet = file.toURI().toURL();
@@ -379,76 +418,90 @@
return doc;
}
- public static Document generateXML(File in, String outputType) throws Exception {
- ByteArrayOutputStream out = null;
- Document doc = null;
+ /**
+ * TODO !
+ *
+ * @param doc
+ * @param fileOut
+ * @throws IOException
+ */
+ public static void generateFile(Document doc, File fileOut) throws IOException {
+ // Out
+ OutputStreamWriter writer = null;
+
try {
- // Transformation to XML
- out = new ByteArrayOutputStream();
- doc = generateDocument(TYPE_XML, in, out);
+ OutputStream outputStream = new FileOutputStream(fileOut);
- // Application of xsl stylesheets
- doc = applyXsls(doc, outputType);
+ // If the output file type si not "pdf", we can write in the final file
+ writer = new OutputStreamWriter(outputStream, UTF_8);
+
+ // write generated document
+ writer.write(doc.asXML());
+ }catch (Exception eee) {
+ log.error("Failed to write file", eee);
} finally {
- if ( out != null) {
- out.close();
+ if (writer != null) {
+ writer.close();
}
}
-
- return doc;
}
+ /**
+ * TODO !
+ *
+ * @param result
+ * @param fileIn
+ * @param fileOut
+ * @throws Exception
+ */
+ public static void generatePdf(Document result, File fileIn, File fileOut) throws Exception {
- public static Document generateDocument(String outputType, File in, ByteArrayOutputStream out) throws Exception {
- /* Transformation of the __run__ URL into a path that python will use
- For example the URL is :
- jar:file:/home/user/.m2/repository/org/nuiton/jrst/docutils/1.6-SNAPSHOT/docutils-1.6-SNAPSHOT.jar!/__run__.py
- and it becomes :
- /home/user/.m2/repository/org/nuiton/jrst/docutils/1.6-SNAPSHOT/docutils-1.6-SNAPSHOT.jar/
- */
- URL resource = JRST.class.getResource("/" + DOCUTILS_LAUNCHER);
- String docutilsPath = resource.getPath()
- .replaceAll(DOCUTILS_LAUNCHER, "");
- docutilsPath = docutilsPath.replaceAll(BANG, "");
- docutilsPath = docutilsPath.replaceAll(FILE_PREFIX, "");
+ // Out
+ OutputStream outputStream = null;
- // Import of the main script to use docutils ( __run__ )
- PythonInterpreter interp = new PythonInterpreter();
- String commandImport = IMPORT_SCRIPT;
- interp.exec(commandImport);
+ try {
+ outputStream = new FileOutputStream(fileOut);
- // If the OS is windows, escapes the backslashs in the filepath
- String filePath = in.getAbsolutePath();
- String property = System.getProperty(OS_NAME).toLowerCase();
- if (property.contains(WINDOWS_NAME)) {
- filePath = filePath.replaceAll("\\\\", "\\\\\\\\");
- }
+ // Creation of the document builder
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ builder.setEntityResolver(result.getEntityResolver());
- // Sets an output stream in the python interpreter and executes the code
- interp.setOut(out);
+ // We must redifine our own DocumentInputSource because of the visibility
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(result.asXML().getBytes());
+ org.w3c.dom.Document doc = builder.parse(inputStream);
- // Execution of the docutils script to transform rst to xml
- String commandExec = String.format("__run__.exec_docutils('%s', '%s', '%s')",
- docutilsPath, outputType, filePath);
- interp.exec(commandExec);
+ ITextRenderer renderer = new ITextRenderer();
- // Cleans the python interpreter to avoid problems if they are multiple execution of this method
- interp.cleanup();
+ // Settings to resolve paths with the JRST User Agent
+ String absolutePath = fileIn.getParentFile().getAbsolutePath();
+ JRSTUserAgent jrstUserAgent = new JRSTUserAgent(absolutePath);
+ jrstUserAgent.setBaseURL(absolutePath);
+ renderer.getSharedContext().setUserAgentCallback(jrstUserAgent);
+ jrstUserAgent.setSharedContext(renderer.getSharedContext());
- // Transforms the output stream to a document
- String xmlString = new String(out.toByteArray(), UTF_8);
- Document doc = null;
- try {
- doc = DocumentHelper.parseText(xmlString);
- } catch (DocumentException e) {
- log.error("Error during the creation of the document", e);
+ // Generation of the pdf file
+ renderer.setDocument(doc, null);
+ renderer.layout();
+ renderer.createPDF(outputStream);
+ } catch (Exception eee) {
+ log.error("Failed to write PDF", eee);
+ } finally {
+ if (outputStream != null) {
+ outputStream.close();
+ }
}
-
- return doc;
}
-
+ /**
+ * Method used to generate rst document
+ * <br/>
+ * <b>WARN : don't work !</b>
+ *
+ * @param doc docutils document to generate
+ * @return rst document
+ * @throws IOException
+ */
public static String generateRST(Document doc) throws IOException {
// Creation d'un visitor qui convertie de l'xml vers le rst
DocUtilsVisitor visitor = new DocUtils2RST();
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfig.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfig.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfig.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -26,7 +26,6 @@
package org.nuiton.jrst;
import java.util.Properties;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationConfig;
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfigAction.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfigAction.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfigAction.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -25,11 +25,11 @@
package org.nuiton.jrst;
+import org.nuiton.util.ApplicationConfig.ActionDef;
+
import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
-import org.nuiton.util.ApplicationConfig.ActionDef;
-
/**
* JRST actions.
*
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfigOption.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfigOption.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTConfigOption.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -25,14 +25,13 @@
package org.nuiton.jrst;
-import static org.nuiton.i18n.I18n._;
-import static org.nuiton.i18n.I18n.n_;
-
import java.io.File;
-
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ApplicationConfig.OptionDef;
+import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.n_;
+
/**
* JRST options enum.
*
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTGenerator.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTGenerator.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTGenerator.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -26,6 +26,28 @@
package org.nuiton.jrst;
+import java.io.IOException;
+import java.io.Writer;
+import java.net.URL;
+import java.util.LinkedList;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.URIResolver;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.Node;
+import org.dom4j.Text;
+import org.dom4j.io.DocumentResult;
+import org.dom4j.io.DocumentSource;
+import org.nuiton.util.FasterCachedResourceResolver;
+import org.xml.sax.ContentHandler;
+
import static org.nuiton.jrst.ReStructuredText.ADDRESS;
import static org.nuiton.jrst.ReStructuredText.AUTHOR;
import static org.nuiton.jrst.ReStructuredText.AUTHORS;
@@ -57,30 +79,6 @@
import static org.nuiton.jrst.ReStructuredText.TRANSITION;
import static org.nuiton.jrst.ReStructuredText.VERSION;
-import java.io.IOException;
-import java.io.Writer;
-import java.net.URL;
-import java.util.LinkedList;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.dom4j.Document;
-import org.dom4j.Element;
-import org.dom4j.Node;
-import org.dom4j.Text;
-import org.dom4j.io.DocumentResult;
-import org.dom4j.io.DocumentSource;
-import org.nuiton.util.FasterCachedResourceResolver;
-import org.xml.sax.ContentHandler;
-
/**
* Cette classe contient plusieurs methodes pour générer, soit en utilisant une
* feuille de style {@link #generate(Document, URL, Writer)}, soit un
@@ -90,7 +88,7 @@
* 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, String...)}
+ * avec {@link #transform(Document, URL)}
*
* Created: 30 oct. 06 00:14:18
*
@@ -140,8 +138,8 @@
/**
* Generate using this class as handler, this generate RST text to out
* passed in constructor
- *
- * @param doc
+ *
+ * @param doc document to transform
* @throws IOException
*/
public void generate(Document doc) throws IOException {
@@ -156,8 +154,8 @@
/**
* Generate using handler passed in argument
*
- * @param doc
- * @param handler
+ * @param doc document
+ * @param handler saxon content handler
* @throws IOException
* @throws TransformerException
*/
@@ -178,9 +176,9 @@
/**
* Used writer passed in construction class
- *
- * @param doc
- * @param stylesheet
+ *
+ * @param doc document to transform
+ * @param stylesheet to apply
* @throws IOException
* @throws TransformerException
*/
@@ -191,10 +189,10 @@
/**
* Generate out from document using stylesheet
- *
- * @param doc
- * @param stylesheet
- * @param out
+ *
+ * @param doc document to transform
+ * @param stylesheet to apply
+ * @param out output
* @throws IOException
* @throws TransformerException
*/
@@ -221,14 +219,13 @@
/**
* Transform doc in another XML document.
*
- * @param doc
- * @param stylesheet
- * @param args
+ * @param doc document to transform
+ * @param stylesheet to apply
* @return the transformed document
* @throws TransformerException
* @throws IOException
*/
- public Document transform(Document doc, URL stylesheet, String... args)
+ public Document transform(Document doc, URL stylesheet)
throws TransformerException, IOException {
if (log.isInfoEnabled()) {
@@ -292,7 +289,7 @@
* Determine la longueur du text dans l'element
* <emphasis<>toto</emphasis<> qui donne *toto* retournera 6
*
- * @param e
+ * @param e element
* @return la longueur du text dans l'element.
*/
@SuppressWarnings("unchecked")
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTInterface.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTInterface.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTInterface.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -25,8 +25,6 @@
package org.nuiton.jrst;
-import static org.nuiton.i18n.I18n._;
-
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
@@ -36,7 +34,6 @@
import java.awt.event.ActionListener;
import java.io.File;
import java.util.LinkedList;
-
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
@@ -51,9 +48,10 @@
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
-
import org.nuiton.util.Resource;
+import static org.nuiton.i18n.I18n._;
+
/**
* JRST main interface.
*
@@ -127,7 +125,7 @@
/**
* le parametre initialise les options disponibles
*
- * @param o
+ * @param o option
*/
public JRSTInterface(String o) {
@@ -529,14 +527,12 @@
} else {
if (!ecrase) {
File file = new File(getSaveText().getText());
- if (file != null) {
- if (file.exists()) {
- int choix = askEcraser();
- if (choix == JOptionPane.YES_OPTION)
- ecrase = true;
- else if (choix == JOptionPane.NO_OPTION)
- exit = true;
- }
+ if (file.exists()) {
+ int choix = askEcraser();
+ if (choix == JOptionPane.YES_OPTION)
+ ecrase = true;
+ else if (choix == JOptionPane.NO_OPTION)
+ exit = true;
}
}
if (!exit) {
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTResourceResolver.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTResourceResolver.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTResourceResolver.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -24,6 +24,16 @@
*/
package org.nuiton.jrst;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.sax.SAXSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.FasterCachedResourceResolver;
@@ -33,17 +43,6 @@
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.Source;
-import javax.xml.transform.sax.SAXSource;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
/**
* @author sletellier <letellier(a)codelutin.com>
* @since 1.5
@@ -79,7 +78,7 @@
}
try {
- InputStream stream = null;
+ InputStream stream;
File file = new File(resouceFullName);
if (file.exists()) {
stream = new FileInputStream(file);
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTUserAgent.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTUserAgent.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTUserAgent.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -1,6 +1,34 @@
+/*
+ * #%L
+ * JRst :: Api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2012 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
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.jrst;
import com.lowagie.text.Image;
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xhtmlrenderer.extend.UserAgentCallback;
@@ -10,19 +38,12 @@
import org.xhtmlrenderer.resource.ImageResource;
import org.xhtmlrenderer.resource.XMLResource;
import org.xhtmlrenderer.swing.NaiveUserAgent;
-import org.xhtmlrenderer.util.XRLog;
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-
/**
- * Created with IntelliJ IDEA.
- * User: jpages
- * Date: 22/05/12
- * Time: 17:38
- * To change this template use File | Settings | File Templates.
+ * Class used to resolv images path for JRST documents for itext PDF generation
+ *
+ * @author jerome pages <jpages(a)codelutin.com>
+ * @since 1.6
*/
public class JRSTUserAgent implements UserAgentCallback {
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/convertisor/DocUtils2RST.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/convertisor/DocUtils2RST.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/convertisor/DocUtils2RST.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -29,10 +29,9 @@
import org.apache.commons.logging.LogFactory;
import org.dom4j.Element;
-import static org.nuiton.jrst.ReStructuredText.TITLE_CHAR;
-
import static org.nuiton.jrst.ReStructuredText.PARAGRAPH;
import static org.nuiton.jrst.ReStructuredText.TITLE;
+import static org.nuiton.jrst.ReStructuredText.TITLE_CHAR;
/**
*
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -25,29 +25,17 @@
package org.nuiton.jrst;
-import java.io.*;
+import java.io.File;
import java.util.Arrays;
import java.util.List;
-
import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.Fop;
-import org.apache.fop.apps.FopFactory;
-import org.apache.fop.apps.MimeConstants;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.nuiton.util.Resource;
-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;
-
/**
*
* @author chemit
@@ -64,15 +52,15 @@
*/
@Test
public void testResources() {
- Assert.assertNotNull(Resource.getURL(JRST.rst2xhtml));
- Assert.assertNotNull(Resource.getURL(JRST.rst2xdoc));
- Assert.assertNotNull(Resource.getURL(JRST.rst2docbook));
- Assert.assertNotNull(Resource.getURL(JRST.docbook2xhtml));
- Assert.assertNotNull(Resource.getURL(JRST.docbook2javahelp));
- Assert.assertNotNull(Resource.getURL(JRST.docbook2htmlhelp));
+ Assert.assertNotNull(Resource.getURL(JRST.RST_2_XHTML));
+ Assert.assertNotNull(Resource.getURL(JRST.RST_2_XDOC));
+ Assert.assertNotNull(Resource.getURL(JRST.RST_2_DOCBOOK));
+ Assert.assertNotNull(Resource.getURL(JRST.DOCBOOK_2_XHTML));
+ Assert.assertNotNull(Resource.getURL(JRST.DOCBOOK_2_JAVAHELP));
+ Assert.assertNotNull(Resource.getURL(JRST.DOCBOOK_2_HTMLHELP));
//FIXME echatellier 20110217 following assert fails
//Assert.assertNotNull(Resource.getURL(JRST.docbook2odf));
- Assert.assertNotNull(Resource.getURL(JRST.docbook2fo));
+ Assert.assertNotNull(Resource.getURL(JRST.DOCBOOK_2_FO));
}
@Ignore
@@ -114,7 +102,7 @@
File out = new File(testWorkDir, "toRst1-out.rst");
- JRST.generateDocutils(JRST.TYPE_RST, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_RST, in, out, JRST.Overwrite.ALLTIME);
List<?> readLines = FileUtils.readLines(out);
log.info(OUT_LINES);
@@ -133,6 +121,6 @@
File in = getTestFile("text.rst");
File out = getOutputTestFile("jrst-RstToXml.xml");
- JRST.generateDocutils(JRST.TYPE_XML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_XML, in, out, JRST.Overwrite.ALLTIME);
}
}
\ No newline at end of file
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -56,7 +56,7 @@
File in = getBugTestFile("testAdminitionInList1787.rst");
File out = getOutputTestFile("jrst-testAdminitionInList1787.html");
// out.deleteOnExit();
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
// Must contains <div class="note">
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -54,7 +54,7 @@
File in = getBugTestFile("testImages21.rst");
File out = getOutputTestFile("jrst-testImages.html");
// out.deleteOnExit();
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("alt=\"alternate text\"") > 0);
@@ -76,7 +76,7 @@
File in = getBugTestFile("testContent877.rst");
File out = getOutputTestFile("jrst-testContent.html");
// out.deleteOnExit();
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("Table des matières") > 0);
@@ -92,7 +92,7 @@
File in = getBugTestFile("testContents.rst");
File out = getOutputTestFile("jrst-testContents.html");
// out.deleteOnExit();
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("<b>") > 0);
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -52,7 +52,7 @@
public void testOptionArgumentSizeInList() throws Exception {
File in = getBugTestFile("testOptionArgumentSize1788.rst");
File out = getOutputTestFile("jrst-testOptionArgumentSize1788.html");
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
}
}
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -54,7 +54,7 @@
File in = getBugTestFile("testTable1290.rst");
File out = getOutputTestFile("jrst-tables.html");
// out.deleteOnExit();
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("Annee|Trait|Espece") > 0);
@@ -71,7 +71,7 @@
File in = getBugTestFile("testTable1375.rst");
File out = getOutputTestFile("jrst-tables.html");
// out.deleteOnExit();
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("<em>légérs</em>") > 0);
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -56,7 +56,7 @@
File in = getBugTestFile("testLinks.rst");
File out = getOutputTestFile("jrst-testLinks.html");
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("href=\"http://labs.libre-entreprise.org/tracker/?atid=113&group_id=8&func=…"") > 0);
@@ -75,7 +75,7 @@
File in = getBugTestFile("testLinks1380.rst");
File out = getOutputTestFile("jrst-testLinks.html");
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("nuiton's forge") > 0);
@@ -93,7 +93,7 @@
File in = getBugTestFile("testTab1378.rst");
File out = getOutputTestFile("jrst-testTab1378.html");
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
Pattern pattern = Pattern.compile(".*<blockquote>.*du bla bla \u00E9l\u00E9mentaire.*</blockquote>.*", Pattern.DOTALL);
@@ -110,7 +110,7 @@
File in = getBugTestFile("testOptionsList644.rst");
File out = getOutputTestFile("jrst-testOptionList644.html");
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("<span class=\"option\">-a</span>") > 0);
@@ -133,7 +133,7 @@
File in = getBugTestFile("testLinks.rst");
File out = getOutputTestFile("jrst-testLinks.html");
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("echapement de lien1_") > 0);
@@ -148,7 +148,7 @@
File in = getBugTestFile("testEmbeddedURIs.rst");
File out = getOutputTestFile("jrst-testEmbeddedURIs.html");
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.contains("href=\"http://www.python.org\""));
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java 2012-05-25 09:30:55 UTC (rev 675)
@@ -1,23 +1,21 @@
/*
* #%L
- *
- *
* $Id$
* $HeadURL$
* %%
* Copyright (C) 2011 Codelutin, Chatellier Eric
* %%
* This program 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 3 of the
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program 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 General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
+ *
+ * You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
@@ -54,7 +52,7 @@
File in = new File("src/test/resources/bugs/testNoSubtitle.rst");
File out = File.createTempFile("jrst-RstToHtml2", ".html");
// out.deleteOnExit();
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
}
/**
@@ -68,7 +66,7 @@
File in = new File("src/test/resources/bugs/testNoContentSubtitles.rst");
File out = File.createTempFile("jrst-testNoContentSubtitles", ".html");
// out.deleteOnExit();
- JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
Assert.assertTrue(content.indexOf("<h2>Prérequis</h2>") > 0);
Modified: branches/jrst-docutils-jython/jrst-doc/pom.xml
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/pom.xml 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst-doc/pom.xml 2012-05-25 09:30:55 UTC (rev 675)
@@ -78,27 +78,7 @@
</executions>
</plugin>
</plugins>
- <!--pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>doxia-module-jrst</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>default-site</id>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </pluginManagement-->
-
</build>
<!-- ************************************************************* -->
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/site_en.xml 2012-05-25 09:30:55 UTC (rev 675)
@@ -26,19 +26,19 @@
<project name="${project.name}">
<skin>
- <groupId>org.apache.maven.skins</groupId>
- <artifactId>maven-fluido-skin</artifactId>
- <version>1.2.1</version>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.2.1</version>
</skin>
<custom>
- <fluidoSkin>
- <topBarEnabled>true</topBarEnabled>
- <googleSearch/>
- <sideBarEnabled>false</sideBarEnabled>
- <searchEnabled>true</searchEnabled>
- <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
- </fluidoSkin>
+ <fluidoSkin>
+ <topBarEnabled>true</topBarEnabled>
+ <googleSearch/>
+ <sideBarEnabled>false</sideBarEnabled>
+ <searchEnabled>true</searchEnabled>
+ <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
+ </fluidoSkin>
</custom>
<poweredBy>
Modified: branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml
===================================================================
--- branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/jrst-doc/src/site/site_fr.xml 2012-05-25 09:30:55 UTC (rev 675)
@@ -27,19 +27,19 @@
<project name="${project.name}">
<skin>
- <groupId>org.apache.maven.skins</groupId>
- <artifactId>maven-fluido-skin</artifactId>
- <version>1.2.1</version>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.2.1</version>
</skin>
<custom>
- <fluidoSkin>
- <topBarEnabled>true</topBarEnabled>
- <googleSearch/>
- <sideBarEnabled>false</sideBarEnabled>
- <searchEnabled>true</searchEnabled>
- <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
- </fluidoSkin>
+ <fluidoSkin>
+ <topBarEnabled>true</topBarEnabled>
+ <googleSearch/>
+ <sideBarEnabled>false</sideBarEnabled>
+ <searchEnabled>true</searchEnabled>
+ <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
+ </fluidoSkin>
</custom>
<poweredBy>
Modified: branches/jrst-docutils-jython/pom.xml
===================================================================
--- branches/jrst-docutils-jython/pom.xml 2012-05-24 16:06:42 UTC (rev 674)
+++ branches/jrst-docutils-jython/pom.xml 2012-05-25 09:30:55 UTC (rev 675)
@@ -33,7 +33,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmineAndCentral</artifactId>
- <version>3.2</version>
+ <version>3.3.1</version>
</parent>
<artifactId>jrst</artifactId>
@@ -236,7 +236,7 @@
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
- <version>1.1.1</version>
+ <version>1.1.3</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
@@ -248,9 +248,17 @@
<artifactId>xmlParserAPIs</artifactId>
</exclusion>
<exclusion>
+ <groupId>xalan</groupId>
<artifactId>xalan</artifactId>
- <groupId>xalan</groupId>
</exclusion>
+ <exclusion>
+ <groupId>maven-plugins</groupId>
+ <artifactId>maven-cobertura-plugin</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>maven-plugins</groupId>
+ <artifactId>maven-findbugs-plugin</artifactId>
+ </exclusion>
</exclusions>
</dependency>
@@ -322,7 +330,7 @@
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
- <version>2.0.8</version>
+ <version>2.1.7</version>
</dependency>
@@ -396,8 +404,8 @@
<siteSourcesType>apt</siteSourcesType>
- <doxiaVersion>1.1.4</doxiaVersion>
- <nuitonUtilsVersion>2.2</nuitonUtilsVersion>
+ <doxiaVersion>1.3</doxiaVersion>
+ <nuitonUtilsVersion>2.4.8</nuitonUtilsVersion>
<nuitonI18nVersion>2.4.1</nuitonI18nVersion>
<xalanVersion>2.7.1</xalanVersion>
1
0
r674 - in branches/jrst-docutils-jython: doxia-module-jrst/src/main/java/org/nuiton/jrst jrst/src/main/java/org/nuiton/jrst jrst/src/test/java/org/nuiton/jrst jrst/src/test/java/org/nuiton/jrst/bugs
by jpages@users.nuiton.org 24 May '12
by jpages@users.nuiton.org 24 May '12
24 May '12
Author: jpages
Date: 2012-05-24 18:06:42 +0200 (Thu, 24 May 2012)
New Revision: 674
Url: http://nuiton.org/repositories/revision/jrst/674
Log:
Nettoyage dans la classe JRST : suppression de m?\195?\169thodes inutiles, renommage, restructuration du code,...
Modified:
branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java
branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java
Modified: branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java
===================================================================
--- branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2012-05-24 14:00:52 UTC (rev 673)
+++ branches/jrst-docutils-jython/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2012-05-24 16:06:42 UTC (rev 674)
@@ -54,26 +54,14 @@
public void parse(Reader source, Sink sink) throws ParseException {
try {
+ // Write the source in a file to use it with JRST
File sourceFile = File.createTempFile("source",".rst");
FileWriter fileWriter = new FileWriter(sourceFile);
IOUtil.copy(source, fileWriter);
- Document doc = JRST.generateXML(sourceFile);
- // Apply xsl on rst RST Document
- JRSTGenerator gen = new JRSTGenerator();
- String xsl = JRST.rst2xdoc;
- URL stylesheet = Resource.getURL(xsl);
- if (stylesheet == null) {
- throw new FileNotFoundException("Can't find stylesheet: "
- + xsl);
- }
+ // Generation of the xml file
+ Document doc = JRST.generateXML(sourceFile, JRST.TYPE_XDOC);
- // add entity resolver
- gen.setUriResolver(new JRSTResourceResolver(xsl));
-
- // do transformation
- doc = gen.transform(doc, stylesheet);
-
// Give xsl result to XDoc parser
Reader reader = new StringReader(doc.asXML());
super.parse(reader, sink);
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-24 14:00:52 UTC (rev 673)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-24 16:06:42 UTC (rev 674)
@@ -225,7 +225,7 @@
overwrite = Overwrite.ALLTIME;
}
- generate(xslList, inputFile, ouputFile, overwrite);
+ generateDocutils(xslList, inputFile, ouputFile, overwrite);
}
private static String[] askOption() throws SecurityException,
@@ -249,7 +249,7 @@
}
/**
- * Interface graphique.
+ * Graphical user interface
*
* @return
* @throws SecurityException
@@ -263,14 +263,17 @@
return graph.getCmd();
}
- public static void generate(String outputType, File fileIn,
- File fileOut, Overwrite overwrite) throws Exception {
- generate(outputType, fileIn, fileOut, UTF_8, overwrite);
- }
-
- public static void generate(String outputType, File fileIn,
- File fileOut, String outputEncoding, Overwrite overwrite) throws Exception {
-
+ /**
+ * Transforms a Restructured Text (ReST) file to another type ( html, xdoc, pdf, etc... )
+ *
+ * @param outputType The type of the output file ( html, xdoc, pdf, etc... )
+ * @param fileIn The restructured text input file (rst)
+ * @param fileOut The output file
+ * @param overwrite The rule to overwrite file (NEVER, IFNEWER or ALLTIME )
+ * @throws Exception
+ */
+ public static void generateDocutils(String outputType, File fileIn,
+ File fileOut, Overwrite overwrite) throws Exception {
if (fileOut != null
&& fileOut.exists()
&& (overwrite == Overwrite.NEVER || (overwrite == Overwrite.IFNEWER && FileUtil
@@ -281,121 +284,68 @@
// Out
OutputStream outputStream = new FileOutputStream(fileOut);
- // Generate
- Document result = generateDocument(outputType, fileIn);
+ // Generate XML
+ Document doc = generateXML(fileIn, outputType);
// generation PDF
if (outputType.equals("pdf")) {
-
- try {
- // Creation of the document builder
- DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- builder.setEntityResolver(result.getEntityResolver());
-
- // We must redifine our own DocumentInputSource because of the visibility
- MyDocumentInputSource source = new MyDocumentInputSource(result);
- org.w3c.dom.Document doc = builder.parse(source);
-
- ITextRenderer renderer = new ITextRenderer();
-
- // Settings to resolve paths with the JRST User Agent
- String absolutePath = fileIn.getParentFile().getAbsolutePath();
- JRSTUserAgent jrstUserAgent = new JRSTUserAgent(absolutePath);
- jrstUserAgent.setBaseURL(absolutePath);
- renderer.getSharedContext().setUserAgentCallback(jrstUserAgent);
- jrstUserAgent.setSharedContext(renderer.getSharedContext());
-
- // Generation of the pdf file
- renderer.setDocument(doc, null);
- renderer.layout();
- renderer.createPDF(outputStream);
- } catch (Exception eee) {
- log.error("Failed to write PDF", eee);
- } finally {
- outputStream.close();
- }
-
+ generatePdf(doc, fileIn, outputStream);
} else {
- // If the output file type si not "pdf", we can write in the final file
- OutputStreamWriter writer = null;
- try {
- writer = new OutputStreamWriter(outputStream, outputEncoding);
-
- // write generated document
- writer.write(result.asXML());
- }catch (Exception eee) {
- log.error("Failed to write " + outputType + " file", eee);
- } finally {
- if (writer != null) {
- writer.close();
- }
- }
-
+ generateFile(doc, outputStream);
}
}
}
- /**
- *
- * @param outputType
- * @param in
- * @throws Exception
- */
- public static String generate(String outputType, String in) throws Exception {
- File inFile = File.createTempFile("in", "rst");
- FileUtil.writeString(inFile, in);
- return generateString(outputType, inFile);
- }
- /**
- *
- * @param outputType
- * @param in
- * @throws Exception
- */
- public static Writer generate(String outputType, File in) throws Exception {
- StringWriter writer = new StringWriter();
- writer.write(generateString(outputType,in));
- return writer;
- }
+ public static void generateFile(Document doc, OutputStream outputStream) throws IOException {
+ // If the output file type si not "pdf", we can write in the final file
+ OutputStreamWriter writer = null;
+ try {
+ writer = new OutputStreamWriter(outputStream, UTF_8);
-
- /**
- *
- * @param outputType
- * @param in
- * @throws Exception
- */
- public static StringBuffer generate(String outputType, StringBuffer in) throws Exception {
- return new StringBuffer(generate(outputType, in.toString()));
+ // write generated document
+ writer.write(doc.asXML());
+ }catch (Exception eee) {
+ log.error("Failed to write file", eee);
+ } finally {
+ if (writer != null) {
+ writer.close();
+ }
+ }
}
- /**
- *
- * @param outputType
- * @param in
- * @throws Exception
- */
- public static String generateString(String outputType, File in) throws Exception {
+ public static void generatePdf(Document result, File fileIn, OutputStream outputStream) throws Exception {
+ try {
+ // Creation of the document builder
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ builder.setEntityResolver(result.getEntityResolver());
- return generateDocument(outputType, in).asXML();
- }
- /**
- *
- * @param outputType
- * @param in
- * @throws Exception
- */
- public static Document generateDocument(String outputType, File in) throws Exception {
+ // We must redifine our own DocumentInputSource because of the visibility
+ MyDocumentInputSource source = new MyDocumentInputSource(result);
+ org.w3c.dom.Document doc = builder.parse(source);
- Document doc = generateXML(in);
+ ITextRenderer renderer = new ITextRenderer();
- // Sortie vers rst
- doc = applyXsls(doc, outputType);
- return doc;
+ // Settings to resolve paths with the JRST User Agent
+ String absolutePath = fileIn.getParentFile().getAbsolutePath();
+ JRSTUserAgent jrstUserAgent = new JRSTUserAgent(absolutePath);
+ jrstUserAgent.setBaseURL(absolutePath);
+ renderer.getSharedContext().setUserAgentCallback(jrstUserAgent);
+ jrstUserAgent.setSharedContext(renderer.getSharedContext());
+
+ // Generation of the pdf file
+ renderer.setDocument(doc, null);
+ renderer.layout();
+ renderer.createPDF(outputStream);
+ } catch (Exception eee) {
+ log.error("Failed to write PDF", eee);
+ } finally {
+ outputStream.close();
+ }
}
+
private static Document applyXsls(Document doc, String xslListOrOutType) throws IOException, TransformerException {
// search xsl file list to apply
@@ -429,14 +379,17 @@
return doc;
}
- public static Document generateXML(File in) throws Exception {
- // RST to XML transformation in a StringWriter
+ public static Document generateXML(File in, String outputType) throws Exception {
ByteArrayOutputStream out = null;
Document doc = null;
try {
+ // Transformation to XML
out = new ByteArrayOutputStream();
doc = generateDocument(TYPE_XML, in, out);
+
+ // Application of xsl stylesheets
+ doc = applyXsls(doc, outputType);
} finally {
if ( out != null) {
out.close();
@@ -456,7 +409,7 @@
*/
URL resource = JRST.class.getResource("/" + DOCUTILS_LAUNCHER);
String docutilsPath = resource.getPath()
- .replaceAll(DOCUTILS_LAUNCHER, "");
+ .replaceAll(DOCUTILS_LAUNCHER, "");
docutilsPath = docutilsPath.replaceAll(BANG, "");
docutilsPath = docutilsPath.replaceAll(FILE_PREFIX, "");
@@ -483,8 +436,8 @@
// Cleans the python interpreter to avoid problems if they are multiple execution of this method
interp.cleanup();
+ // Transforms the output stream to a document
String xmlString = new String(out.toByteArray(), UTF_8);
-
Document doc = null;
try {
doc = DocumentHelper.parseText(xmlString);
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java 2012-05-24 14:00:52 UTC (rev 673)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java 2012-05-24 16:06:42 UTC (rev 674)
@@ -114,7 +114,7 @@
File out = new File(testWorkDir, "toRst1-out.rst");
- JRST.generate(JRST.TYPE_RST, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_RST, in, out, JRST.Overwrite.ALLTIME);
List<?> readLines = FileUtils.readLines(out);
log.info(OUT_LINES);
@@ -133,6 +133,6 @@
File in = getTestFile("text.rst");
File out = getOutputTestFile("jrst-RstToXml.xml");
- JRST.generate(JRST.TYPE_XML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_XML, in, out, JRST.Overwrite.ALLTIME);
}
}
\ No newline at end of file
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java 2012-05-24 14:00:52 UTC (rev 673)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java 2012-05-24 16:06:42 UTC (rev 674)
@@ -56,7 +56,7 @@
File in = getBugTestFile("testAdminitionInList1787.rst");
File out = getOutputTestFile("jrst-testAdminitionInList1787.html");
// out.deleteOnExit();
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
// Must contains <div class="note">
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java 2012-05-24 14:00:52 UTC (rev 673)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java 2012-05-24 16:06:42 UTC (rev 674)
@@ -54,7 +54,7 @@
File in = getBugTestFile("testImages21.rst");
File out = getOutputTestFile("jrst-testImages.html");
// out.deleteOnExit();
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("alt=\"alternate text\"") > 0);
@@ -76,7 +76,7 @@
File in = getBugTestFile("testContent877.rst");
File out = getOutputTestFile("jrst-testContent.html");
// out.deleteOnExit();
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("Table des matières") > 0);
@@ -92,7 +92,7 @@
File in = getBugTestFile("testContents.rst");
File out = getOutputTestFile("jrst-testContents.html");
// out.deleteOnExit();
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("<b>") > 0);
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java 2012-05-24 14:00:52 UTC (rev 673)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java 2012-05-24 16:06:42 UTC (rev 674)
@@ -52,7 +52,7 @@
public void testOptionArgumentSizeInList() throws Exception {
File in = getBugTestFile("testOptionArgumentSize1788.rst");
File out = getOutputTestFile("jrst-testOptionArgumentSize1788.html");
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
}
}
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java 2012-05-24 14:00:52 UTC (rev 673)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java 2012-05-24 16:06:42 UTC (rev 674)
@@ -54,7 +54,7 @@
File in = getBugTestFile("testTable1290.rst");
File out = getOutputTestFile("jrst-tables.html");
// out.deleteOnExit();
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("Annee|Trait|Espece") > 0);
@@ -71,7 +71,7 @@
File in = getBugTestFile("testTable1375.rst");
File out = getOutputTestFile("jrst-tables.html");
// out.deleteOnExit();
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("<em>légérs</em>") > 0);
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java 2012-05-24 14:00:52 UTC (rev 673)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java 2012-05-24 16:06:42 UTC (rev 674)
@@ -56,7 +56,7 @@
File in = getBugTestFile("testLinks.rst");
File out = getOutputTestFile("jrst-testLinks.html");
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("href=\"http://labs.libre-entreprise.org/tracker/?atid=113&group_id=8&func=…"") > 0);
@@ -75,7 +75,7 @@
File in = getBugTestFile("testLinks1380.rst");
File out = getOutputTestFile("jrst-testLinks.html");
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("nuiton's forge") > 0);
@@ -93,7 +93,7 @@
File in = getBugTestFile("testTab1378.rst");
File out = getOutputTestFile("jrst-testTab1378.html");
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
Pattern pattern = Pattern.compile(".*<blockquote>.*du bla bla \u00E9l\u00E9mentaire.*</blockquote>.*", Pattern.DOTALL);
@@ -110,7 +110,7 @@
File in = getBugTestFile("testOptionsList644.rst");
File out = getOutputTestFile("jrst-testOptionList644.html");
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("<span class=\"option\">-a</span>") > 0);
@@ -133,7 +133,7 @@
File in = getBugTestFile("testLinks.rst");
File out = getOutputTestFile("jrst-testLinks.html");
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.indexOf("echapement de lien1_") > 0);
@@ -148,7 +148,7 @@
File in = getBugTestFile("testEmbeddedURIs.rst");
File out = getOutputTestFile("jrst-testEmbeddedURIs.html");
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
assertTrue(content.contains("href=\"http://www.python.org\""));
Modified: branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java 2012-05-24 14:00:52 UTC (rev 673)
+++ branches/jrst-docutils-jython/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java 2012-05-24 16:06:42 UTC (rev 674)
@@ -54,7 +54,7 @@
File in = new File("src/test/resources/bugs/testNoSubtitle.rst");
File out = File.createTempFile("jrst-RstToHtml2", ".html");
// out.deleteOnExit();
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
}
/**
@@ -68,7 +68,7 @@
File in = new File("src/test/resources/bugs/testNoContentSubtitles.rst");
File out = File.createTempFile("jrst-testNoContentSubtitles", ".html");
// out.deleteOnExit();
- JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
+ JRST.generateDocutils(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out, JRST.UTF_8);
Assert.assertTrue(content.indexOf("<h2>Prérequis</h2>") > 0);
1
0
r673 - branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst
by jpages@users.nuiton.org 24 May '12
by jpages@users.nuiton.org 24 May '12
24 May '12
Author: jpages
Date: 2012-05-24 16:00:52 +0200 (Thu, 24 May 2012)
New Revision: 673
Url: http://nuiton.org/repositories/revision/jrst/673
Log:
Ajout de commentaires.
Modified:
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java
branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTUserAgent.java
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-24 12:52:39 UTC (rev 672)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRST.java 2012-05-24 14:00:52 UTC (rev 673)
@@ -288,8 +288,11 @@
if (outputType.equals("pdf")) {
try {
+ // Creation of the document builder
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
builder.setEntityResolver(result.getEntityResolver());
+
+ // We must redifine our own DocumentInputSource because of the visibility
MyDocumentInputSource source = new MyDocumentInputSource(result);
org.w3c.dom.Document doc = builder.parse(source);
@@ -313,6 +316,7 @@
}
} else {
+ // If the output file type si not "pdf", we can write in the final file
OutputStreamWriter writer = null;
try {
writer = new OutputStreamWriter(outputStream, outputEncoding);
@@ -447,7 +451,7 @@
/* Transformation of the __run__ URL into a path that python will use
For example the URL is :
jar:file:/home/user/.m2/repository/org/nuiton/jrst/docutils/1.6-SNAPSHOT/docutils-1.6-SNAPSHOT.jar!/__run__.py
- and it will become :
+ and it becomes :
/home/user/.m2/repository/org/nuiton/jrst/docutils/1.6-SNAPSHOT/docutils-1.6-SNAPSHOT.jar/
*/
URL resource = JRST.class.getResource("/" + DOCUTILS_LAUNCHER);
Modified: branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTUserAgent.java
===================================================================
--- branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTUserAgent.java 2012-05-24 12:52:39 UTC (rev 672)
+++ branches/jrst-docutils-jython/jrst/src/main/java/org/nuiton/jrst/JRSTUserAgent.java 2012-05-24 14:00:52 UTC (rev 673)
@@ -64,6 +64,7 @@
// Sets the scale of the image
scaleToOutputResolution(image);
+ // Creation of the image for IText
ITextFSImage iTextFSImage = new ITextFSImage(image);
imageResource = new ImageResource(iTextFSImage);
} catch (Exception eee) {
@@ -101,24 +102,27 @@
public String resolveURI(String uri) {
if (uri == null) return null;
String ret = null;
+ // If path is null, we try to set the baseURL with the uri, or if it doesn't work, with the current path
if (path == null) {
try {
URL result = new URL(uri);
setBaseURL(result.toExternalForm());
} catch (MalformedURLException e) {
try {
+ // Sets the current file for the base url
setBaseURL(new File(".").toURI().toURL().toExternalForm());
} catch (Exception e1) {
- XRLog.exception("The default NaiveUserAgent doesn't know how to resolve the base URL for " + uri);
+ log.info("The default NaiveUserAgent doesn't know how to resolve the base URL for " + uri);
return null;
}
}
}
try {
+ // If the URI is absolute, we return the string of the url
return new URL(uri).toString();
} catch (MalformedURLException e) {
- XRLog.load("Could not read " + uri + " as a URL; may be relative. Testing using parent URL " + path);
+ // If we are here, the uri is relative so we must build the absolute link with the path
try {
File filePath = new File(path);
URI resourcePath = filePath.toURI();
@@ -128,7 +132,7 @@
URL result = resourcePath.toURL();
ret = result.toURI().toString();
} catch (Exception e1) {
- XRLog.exception("The default NaiveUserAgent cannot resolve the URL " + uri + " with base URL " + path);
+ log.error("The default NaiveUserAgent cannot resolve the URL " + uri + " with base URL " + path, e1);
}
}
return ret;
1
0