dotCMS includes a viewtool - $dotwiki - that can parse markdown and wiki formated content. The viewtool supports Mediawiki, textile, confluence, tracwiki and twiki markup. Depending on what format your content is marked up in, using the tool looks something like this:
$dotwiki.mediawiki("wiki content")
$dotwiki.textile("wiki content")
$dotwiki.confluence("wiki content")
$dotwiki.textile("wiki content")
$dotwiki.tracwiki("wiki content")
$dotwiki.twiki("wiki content")
The following example shows how the WikiTool is mapped in the toolbox-xml file:
<tool>
<key>dotwiki</key>
<scope>application</scope>
<class>com.dotcms.rendering.velocity.viewtools.WikiTool</class>
</tool>
public class WikiTool
This class is used to transform marked-up text into HTML using one of the following markup languages: MediaWiki, Confluence, Textile, TracWiki and TWiki
Method Detail
mediawiki
public java.lang.String **mediawiki**(java.lang.Stringtext)
Converts text into a partial html using the MediaWiki markup language
Parameters:text
- Text to convertReturns:HTML String
mediawikiToHTML
public java.lang.String **mediawikiToHTML** //(java.lang.Stringtext,
java.lang.StringcssPath)
Converts text into a partial html using the MediaWiki markup language
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, this value is not setReturns:HTML String
mediawikiToFullHTML
public java.lang.String **mediawikiToFullHTML**(java.lang.Stringtext,
java.lang.StringcssPath)
Converts text into a full html using the MediaWiki markup language
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedReturns:HTML String
textile
public java.lang.String **textile**(java.lang.Stringtext)
Converts text into a partial html using the Textile markup language
Parameters:text
- Text to convertReturns:HTML String
textileToHTML
public java.lang.String **textileToHTML**(java.lang.Stringtext,
java.lang.StringcssPath)
Converts text into a partial html using the Textile markup language
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedReturns:HTML String
textileToFullHTML
public java.lang.String **textileToFullHTML**(java.lang.Stringtext,
java.lang.StringcssPath)
Converts text into a full html using the Textile markup language
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedReturns:HTML String
confluence
public java.lang.String **confluence**(java.lang.Stringtext)
Converts text into a partial html using the Confluence markup language
Parameters:text
- Text to convertReturns:HTML String
confluenceToHTML
public java.lang.String **confluenceToHTML**(java.lang.Stringtext,
java.lang.StringcssPath)
Converts text into a partial html using the Confluence markup language
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedReturns:HTML String
confluenceToFullHTML
public java.lang.String **confluenceToFullHTML**(java.lang.Stringtext,
java.lang.StringcssPath)
Converts text into a full html using the Confluence markup language
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedReturns:HTML String
tracwiki
public java.lang.String **tracwiki**(java.lang.Stringtext)
Converts text into a partial html using the TrackWiki markup language
Parameters:text
- Text to convertReturns:HTML String
tracwikiToHTML
public java.lang.String **tracwikiToHTML**(java.lang.Stringtext,
java.lang.StringcssPath)
Converts text into a partial html using the TrackWiki markup language
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedReturns:HTML String
tracwikiToFullHTML
public java.lang.String **tracwikiToFullHTML**(java.lang.Stringtext,
java.lang.StringcssPath)
Converts text into a full html using the TrackWiki markup language
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedReturns:HTML String
twiki
public java.lang.String **twiki**(java.lang.Stringtext)
Converts text into a partial html using the TWiki markup language
Parameters:text
- Text to convertReturns:HTML String
twikiToHTML
public java.lang.String **twikiToHTML**(java.lang.Stringtext,
java.lang.StringcssPath)
Converts text into a partial html using the TWiki markup language
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedReturns:HTML String
twikiToFullHTML
public java.lang.String **twikiToFullHTML**(java.lang.Stringtext,
java.lang.StringcssPath)
Converts text into a full html using the TWiki markup language
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedReturns:HTML String
wikiOtherLanguageToHTML
public java.lang.String **wikiOtherLanguageToHTML**(java.lang.Stringtext,
java.lang.StringmarkupLanguage)
Converts string into and html using one of the following markup languages: MediaWiki, Confluence, Textile, TracWiki and TWiki
Parameters:text
- Text to convertmarkupLanguage
- Name of the markupt language to useReturns:HTML String
wikiOtherLanguageToHTML
public java.lang.String **wikiOtherLanguageToHTML**(java.lang.Stringtext,
java.lang.StringcssPath,
java.lang.StringmarkupLanguage)
Converts string into a parcial HTML using the markup language (MediaWiki, Confluence, Textile, TracWiki and TWiki) and css path specified
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedmarkupLanguage
- Type of Wiki Markup language to use. Values allowed: MediaWiki, Confluence, Textile, TracWiki, and TWikiReturns:HTML String
wikiOtherLanguageToFullHTML
public java.lang.String **wikiOtherLanguageToFullHTML**(java.lang.Stringtext,
java.lang.StringcssPath,
java.lang.StringmarkupLanguage)
Converts string into an full HTML using the markup language (MediaWiki, Confluence, Textile, TracWiki and TWiki) and css path specified
Parameters:text
- Text to convertcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedmarkupLanguage
- Type of Wiki Markup language to use. Values allowed: MediaWiki, Confluence, Textile, TracWiki, and TWikiReturns:HTML String
wikiToHTML
public java.lang.String **wikiToHTML**(java.lang.Stringtext,
booleanfullHTML,
java.lang.StringcssPath,
java.lang.StringmarkupLanguage)
Converts string into an full or parcial HTML, using the markup language (MediaWiki, Confluence, Textile, TracWiki and TWiki) and css path specified
Parameters:text
- Text to convertfullHTML
- True if you want to generate the full html body; false if you want to generate just the given textcssPath
- Path to the css file you want ot use. If it is null, no addtional css file will be includedmarkupLanguage
- Type of Wiki Markup language to use. Values allowed: MediaWiki, Confluence, Textile, TracWiki, and TWikiReturns:HTML String