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/10/28 11:28:43 UTC

svn commit: r708512 - in /maven/doxia/site/src/site/apt: developers/index.apt modules/index.apt

Author: vsiveton
Date: Tue Oct 28 03:28:42 2008
New Revision: 708512

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

Modified:
    maven/doxia/site/src/site/apt/developers/index.apt
    maven/doxia/site/src/site/apt/modules/index.apt

Modified: maven/doxia/site/src/site/apt/developers/index.apt
URL: http://svn.apache.org/viewvc/maven/doxia/site/src/site/apt/developers/index.apt?rev=708512&r1=708511&r2=708512&view=diff
==============================================================================
--- maven/doxia/site/src/site/apt/developers/index.apt (original)
+++ maven/doxia/site/src/site/apt/developers/index.apt Tue Oct 28 03:28:42 2008
@@ -3,7 +3,7 @@
  -----
  Vincent Siveton
  ------
- July 2007
+ 2008-10-27
  ------
 
 ~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -68,7 +68,7 @@
 }
 -----
 
- * <MyParseException> class
+ * <MyParseException> class (optional)
 
 -----
 import org.apache.maven.doxia.parser.ParseException;
@@ -80,7 +80,7 @@
 }
 -----
 
- * <MySiteModule> class
+ * <MySiteModule> class (optional, will be used by doxia-sitetools)
 
 -----
 import org.apache.maven.doxia.module.site.AbstractSiteModule;
@@ -100,9 +100,6 @@
 -----
 import org.apache.maven.doxia.sink.SinkAdapter;
 
-/**
- * @plexus.component
- */
 public class MySink
     extends SinkAdapter
 {
@@ -110,6 +107,21 @@
 }
 -----
 
+ * <MySinkFactory> class
+
+-----
+import org.apache.maven.doxia.sink.SinkFactory;
+
+/**
+ * @plexus.component role="org.apache.maven.doxia.sink.SinkFactory" role-hint="my"
+ */
+public class MySinkFactory
+    extends SinkFactory
+{
+...
+}
+-----
+
   []
 
 * {Create a New Doxia Macro}

Modified: maven/doxia/site/src/site/apt/modules/index.apt
URL: http://svn.apache.org/viewvc/maven/doxia/site/src/site/apt/modules/index.apt?rev=708512&r1=708511&r2=708512&view=diff
==============================================================================
--- maven/doxia/site/src/site/apt/modules/index.apt (original)
+++ maven/doxia/site/src/site/apt/modules/index.apt Tue Oct 28 03:28:42 2008
@@ -3,7 +3,7 @@
  -----
  Vincent Siveton
  ------
- July 2007
+ 2008-10-27
  ------
 
 ~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -163,12 +163,18 @@
  The following snippet shows how to use a Doxia <Parser> to transform an apt file to html:
 
 -----
-  Sink sink = new XhtmlSink( new FileWriter( "test.html" ) );
+  File userDir = new File( System.getProperty ( "user.dir" ) );
+  File inputFile = new File( userDir, "test.apt" );
+  File outputFile = new File( userDir, "test.html" );
 
-  Reader reader = new FileReader( "test.apt" );
+  SinkFactory sinkFactory = (SinkFactory) lookup( SinkFactory.ROLE, "html" ); // Plexus lookup
+
+  Sink sink = sinkFactory.createSink( outputFile.getParentFile(), outputFile.getName() ) );
 
   Parser parser = (AptParser) lookup( Parser.ROLE, "apt" ); // Plexus lookup
 
+  Reader reader = ReaderFactory.newReader( inputFile, "UTF-8" );
+
   parser.parse( reader, sink );
 -----