# Maven Doxia API.

The Doxia API is based on Sinks objects: each sink consumes Doxia events to produce a resultant output format (eg Docbook, PDF, XHTML...).

## Using Maven Doxia API

The following snippet shows how to use a Doxia `Sink`:

`File userDir = new File( System.getProperty ( "user.dir" ) ); File outputFile = new File( userDir, "test.html" ); SinkFactory sinkFactory = (SinkFactory) lookup( SinkFactory.ROLE, "html" ); // Plexus lookup Sink sink = sinkFactory.createSink( outputFile.getParentFile(), outputFile.getName() ) ); // Sink head sink.head(); sink.title(); sink.text( "Title" ); sink.title_(); sink.author(); sink.text( "Author" ); sink.author_(); sink.date(); sink.text( "Date" ); sink.date_(); sink.head_(); // Sink head sink.body(); sink.paragraph(); sink.text( "Paragraph 1, line 1. Paragraph 1, line 2." ); sink.paragraph_(); ... sink.body_(); sink.flush(); sink.close();`

## Resources

- Maven Doxia Website
- Plexus