public class JRST extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JRST.Overwrite |
Modifier and Type | Field and Description |
---|---|
static String |
BANG |
protected static String |
DOCBOOK_2_FO
XSL Stylesheet to transform Docbook into PDF.
|
protected static String |
DOCBOOK_2_HTMLHELP
XSL Stylesheet to transform Docbook into htmlhelp.
|
protected static String |
DOCBOOK_2_JAVAHELP
XSL Stylesheet to transform Docbook into javahelp.
|
protected static String |
DOCBOOK_2_XHTML
XSL Stylesheet to transform Docbook into xHTML.
|
static String |
DOCUTILS_LAUNCHER |
static String |
FILE_URI_PREFIX |
static String |
IMPORT_SCRIPT |
protected static org.apache.commons.logging.Log |
log
to use log facility, just put in your code: log.info("...");
|
protected static Map<String,String> |
mimeType
Mime type associated with type
|
static String |
OS_NAME |
static String |
PATTERN_TYPE |
protected static String |
RST_2_DOCBOOK
XSL Stylesheet to transform RST into Docbook.
|
protected static String |
RST_2_XDOC
XSL Stylesheet to transform RST into Xdoc.
|
protected static String |
RST_2_XHTML
XSL Stylesheet to transform RST into HTML.
|
protected static Map<String,String> |
stylesheets
key, Out type; value: chain of XSL file to provide wanted file for output
|
static String |
TYPE_DOCBOOK
DOCBOOK output format type
|
static String |
TYPE_FO
FO output format type
|
static String |
TYPE_HTML
HTML output format type
|
static String |
TYPE_HTML_INNER_BODY
HTML output format type
|
static String |
TYPE_HTMLHELP
HTML HELP output format type
|
static String |
TYPE_JAVAHELP
JAVA HELP output format type
|
static String |
TYPE_ODT
ODT output format type
|
static String |
TYPE_PDF
PDF output format type
|
static String |
TYPE_XDOC
XDOC output format type
|
static String |
TYPE_XHTML
XHTML output format type
|
static String |
TYPE_XML
XML output format type
|
static String |
UTF_8 |
static String |
WINDOWS_NAME |
protected static String |
XSL_RST_2_XHTML_INNER_BODY_XSL
XSL Stylesheet to transform RST into HTML (but only inner body fragment).
|
Constructor and Description |
---|
JRST() |
Modifier and Type | Method and Description |
---|---|
protected static void |
askOptionGraph()
Graphical user interface
|
static void |
generate(String outputType,
File fileIn,
File fileOut,
JRST.Overwrite overwrite,
boolean simpleGeneration)
Transforms a Restructured Text (ReST) file to another type ( html, xdoc, pdf, etc...
|
static org.dom4j.Document |
generateDocutils(File in,
String encoding)
Transforms a restructured text file to a XML file using Jython interpreter to execute DocUtils scripts.
|
static void |
generateFile(org.dom4j.Document doc,
File fileOut)
Writes the XML content generated in a file
|
static void |
generatePdf(org.dom4j.Document result,
File fileIn,
File fileOut)
Generates PDF file with IText with an HTML document
|
static void |
generatePdf(File fileIn,
File fileOut,
JRST.Overwrite overwrite,
org.dom4j.Document doc)
Transforms a Restructured Text (ReST) file to pdf
|
static String |
generateRST(org.dom4j.Document doc)
Method used to generate rst document
WARN : don't work ! |
static org.dom4j.Document |
generateSimpleDoc(File fileIn,
String encoding)
Transforms a restructured text file to a XML file using JRST parser (used with option --simple)
|
static org.dom4j.Document |
generateXml(org.dom4j.Document doc,
String xslListOrOutType)
Applies XSL stylesheet(s) to a XML document
|
static void |
main(String... args)
Main method.
|
public static final String UTF_8
public static final String DOCUTILS_LAUNCHER
public static final String IMPORT_SCRIPT
public static final String WINDOWS_NAME
public static final String OS_NAME
public static final String BANG
public static final String FILE_URI_PREFIX
protected static org.apache.commons.logging.Log log
protected static final String RST_2_XHTML
protected static final String XSL_RST_2_XHTML_INNER_BODY_XSL
protected static final String RST_2_XDOC
protected static final String RST_2_DOCBOOK
protected static final String DOCBOOK_2_XHTML
protected static final String DOCBOOK_2_JAVAHELP
protected static final String DOCBOOK_2_HTMLHELP
protected static final String DOCBOOK_2_FO
public static final String PATTERN_TYPE
public static final String TYPE_HTML
public static final String TYPE_HTML_INNER_BODY
public static final String TYPE_XDOC
public static final String TYPE_DOCBOOK
public static final String TYPE_XHTML
public static final String TYPE_JAVAHELP
public static final String TYPE_HTMLHELP
public static final String TYPE_ODT
public static final String TYPE_FO
public static final String TYPE_PDF
public static final String TYPE_XML
protected static Map<String,String> stylesheets
public static void main(String... args) throws Exception
args
- main argsException
protected static void askOptionGraph() throws SecurityException, NoSuchMethodException
public static void generate(String outputType, File fileIn, File fileOut, JRST.Overwrite overwrite, boolean simpleGeneration) throws Exception
outputType
- The type of the output file ( html, xdoc, pdf, etc... )fileIn
- The restructured text input file (rst)fileOut
- The output fileoverwrite
- The rule to overwrite file (NEVER, IFNEWER or ALLTIME )Exception
public static void generatePdf(File fileIn, File fileOut, JRST.Overwrite overwrite, org.dom4j.Document doc) throws Exception
fileIn
- The restructured text input file (rst)fileOut
- The output fileoverwrite
- The rule to overwrite file (NEVER, IFNEWER or ALLTIME )doc
- document to generateException
public static org.dom4j.Document generateSimpleDoc(File fileIn, String encoding) throws Exception
fileIn
- Input restructured text file (.rst)encoding
- Output file encodingException
public static org.dom4j.Document generateDocutils(File in, String encoding) throws Exception
in
- Input restructured text file (.rst)encoding
- Output file encodingException
public static org.dom4j.Document generateXml(org.dom4j.Document doc, String xslListOrOutType) throws IOException, TransformerException
doc
- A document which contains XML codexslListOrOutType
- String which describes transformations to apply to the XML documentIOException
TransformerException
public static void generateFile(org.dom4j.Document doc, File fileOut) throws IOException
doc
- Document which contains XML codefileOut
- Output fileIOException
public static void generatePdf(org.dom4j.Document result, File fileIn, File fileOut) throws Exception
result
- Document which contains HTML codefileIn
- ReST file used to build resources pathfileOut
- PDF Output fileException
public static String generateRST(org.dom4j.Document doc) throws IOException
doc
- docutils document to generateIOException
Copyright © 2004–2014 CodeLutin. All rights reserved.