Package org.apache.maven.doxia


package org.apache.maven.doxia
The Doxia API is based on Sink and Parser objects: its goal is to parse a given source model using a given parser, and emits Doxia events into the given sink. Further information about the Sink API in
invalid reference
org.apache.maven.doxia.sink
and the Parser API in org.apache.maven.doxia.parser. The Doxia interface is just a high-level API to ease using a parser.

Using Maven Doxia API

File userDir = new File( System.getProperty ( "user.dir" ) );
File inputFile = new File( userDir, "test.md" );
File outputFile = new File( userDir, "test.html" );

Reader source = ReaderFactory.newReader( inputFile, "UTF-8" );

@Inject @Named("html")
SinkFactory sinkFactory;
@Inject
Doxia doxia
try (Sink sink = sinkFactory.createSink(outputFile.getParentFile(), outputFile.getName())) {
doxia.parse( source, "apt", sink );
}
See Also: