Skip to content

mrico/creole-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

creole-parser

Creole-parser is a simple java library to parse CREOLE wiki markup and converts it to XHTML.

Requirements

This library requires Java 6 or higher. To build creole-parser you must have Apache Maven installed. (http://maven.apache.org)

The creole-parser itself has no additional jar dependencies!

Getting started

Grap the latest sources from here and deploy the jar into your local maven repository:

git clone [email protected]:mrico/creole-parser.git
mvn install

Just use it (standalone):

java -jar creole-parser-${version}.jar < sample.wiki > sample.html

Usage

Convert some wiki markup to xhtml:

Document doc = Creole.parse("** Some wiki markup **");
new XHtmlWriter().write(doc, System.out);

Customize XHtmlWriter to use css classes:

Document doc = Creole.parse("** Some wiki markup **");

XHtmlWriter writer = new XHtmlWriter();
writer.addCssClass("p", "section");

writer.write(doc, System.out);

Customize XHtmlWriter to decorate specific elements:

Document doc = Creole.parse("** Some wiki markup **");

XHtmlWriter writer = new XHtmlWriter();
writer.setDecorator(Paragraph.class, new DivElementDecorator("section");

writer.write(doc, System.out);

You can easily create your own decorators by implementing XHtmlElementDecorator.

Releases

No releases published

Packages

No packages published

Languages