You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by vs...@apache.org on 2008/03/08 14:06:47 UTC

svn commit: r634948 - /maven/doxia/doxia-tools/trunk/doxia-converter/src/site/apt/usage.apt

Author: vsiveton
Date: Sat Mar  8 05:06:47 2008
New Revision: 634948

URL: http://svn.apache.org/viewvc?rev=634948&view=rev
Log:
o improved usage

Modified:
    maven/doxia/doxia-tools/trunk/doxia-converter/src/site/apt/usage.apt

Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/site/apt/usage.apt?rev=634948&r1=634947&r2=634948&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-converter/src/site/apt/usage.apt (original)
+++ maven/doxia/doxia-tools/trunk/doxia-converter/src/site/apt/usage.apt Sat Mar  8 05:06:47 2008
@@ -30,7 +30,7 @@
 
  The following examples describe the basic usage of the Doxia Converter.
 
-* Display Help
+* Command Line Help
 
 +-----+
 # java -jar target/apache-doxia-1.0-SNAPSHOT-jar-with-dependencies.jar -h
@@ -53,7 +53,7 @@
 out: apt, docbook, fo, itext, latex, rtf, xdoc, xhtml
 +-----+
 
-* Executes Conversion
+* Command Line Execution
 
 +-----+
 # java -jar target/apache-doxia-1.0-SNAPSHOT-jar-with-dependencies.jar \
@@ -61,4 +61,33 @@
     -from xhtml \
     -out /path/to/outputdir \
     -to apt
++-----+
+
+  <<Note>>: <<<from>>> parameter could be empty. In this case, Doxia converter try to autodetect the <<<from>>>
+  input from the <<<in>>> file parameter.
+
+* Java Usage
+
++-----+
+String in = "...";
+String from = "...";
+String out = "...";
+String to = "...";
+
+Converter converter = new DefaultConverter();
+try
+{
+    InputFile input = InputFile.valueOf( in, from, converter.getInputFormats() );
+    OutputFile output = OutputFile.valueOf( out, to, converter.getOutputFormats() );
+
+    converter.convert( input, output );
+}
+catch ( UnsupportedFormatException e )
+{
+    e.printStackTrace();
+}
+catch ( ConverterException e )
+{
+    e.printStackTrace();
+}
 +-----+