google
yahoo
bing

How to use staticwiki

Using the maven plugin

One of the uses of staticwiki is as maven plugin. When maven generates the site, the staticwiki engine can be used to generate the pages.
For this you need to create the following data structure


module-home
src
site
wiki
page1.wiki
page2.wiki
site.xml
pom.xml

The wiki pages contain the staticwiki markup.
The site.xml file has the normal structure.

In the pom you need to include the staticwiki plugin to assure the site plugin known how to handle the wiki files. This can be done using the following excerpt.


<build>
...
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.staticwiki</groupId>
<artifactId>staticwiki-site-plugin</artifactId>
<version>0.8</version>
</dependency>
</dependencies>
</plugin>
...
</plugins>
...
</build>

<repositories>
...
<repository>
<id>progs</id>
<url>http://maven.progs.be/m2repo</url>
</repository>
...
</repositories>

Using the wiki renderer

Of course the staticwiki renderer can also be used in code. The easiest way to to use the default markup. In that case, the following code can be used.


WikiRenderer wikiRenderer = WikiFactory.getWikiRenderer( new AllowAllResourceHandler() );
String res = wikiRenderer.render( wikiText );

In many cases, it is important to change how links and resources are handled. In that case you should get the wiki renderer with a proper

ResourceHandler

implementation.

Customizing the output