mx:Doc

mx:Doc is Moxie's documentation generation task. It is based on Twitter Bootstrap, GoogleCode Prettify.

Directives

Directives are single-line text commands that surround a block of text and apply a rule to that text. Directives can not be combined nor can they be nested.

Directives are written as:

---DIRECTIVE---
Here is my text block.
---DIRECTIVE---

Text Block Directives

DirectiveDescription
NOMARKDOWNExcludes text block from Markdown processing
ESCAPEEscapes < > & and \n characters with their HTML equivalents.
FIXEDEscapes < > & and \n characters with their HTML equivalents and wraps the text in a <pre> block.

Prettify Directives

DirectiveDescription
CODEEscapes and wraps the textblock with Prettify
CSSEscapes and wraps the textblock with Prettify using a CSS syntax hint
JAVAEscapes and wraps the textblock with Prettify using a Java syntax hint
JSONEscapes and wraps the textblock with Prettify using a JSON syntax hint
SQLEscapes and wraps the textblock with Prettify using a SQL syntax hint
WIKIEscapes and wraps the textblock with Prettify using a WIKI syntax hint
XMLEscapes and wraps the textblock with Prettify using an XML syntax hint
YAMLEscapes and wraps the textblock with Prettify using a YAML syntax hint

Wiki Transform Directives

The wiki transform directives will interpret the enclosed text block using the Eclipse Mylyn WikiText parser for the specified syntax. This is useful, for example, for table generation since Markdown does not specify a table syntax.

DirectiveDescription
X:TWIKIInterprets the block as TWiki markup
X:TEXTILEInterprets the block as Textile markup
X:TRACWIKIInterprets the block as TracWiki markup
X:MEDIAWIKIInterprets the block as MediaWiki markup
X:CONFLUENCEInterprets the block as Confluence markup

Prettify Themes

Many Prettify themes are bundled in Moxie.

Complete Example

<mx:doc>
	<structure>
		<page name="overview" src="index.mkd" />
		<menu name="tasks">
			<page name="mx:Init" src="mxinit.mkd" />
			<page name="mx:Extract" src="mxextract.mkd" />
			<page name="mx:GitId" src="mxgitid.mkd" />
			<page name="mx:GhPages" src="mxghpages.mkd" />
			<divider />
			<page name="mx:Jar" src="mxjar.mkd" />
			<page name="mx:Doc" src="mxdoc.mkd" />
		</menu>
		<page name="design" src="design.mkd" />
		<page name="maxml" src="maxml.mkd" />
		<page name="releases" src="releases.mkd" />
		<menu name="download">
			<link name="moxie-core" src="moxie-core.jar" />
			<link name="moxie-all" src="moxie-all.jar" />
		</menu>
		<report name="reports" />
		<link name="GitHub" src="http://github.com/gitblit/moxie" />
		<divider />
	</structure>
	<substitute token="%VERSION%" value="${max-version}" />
	<nomarkdown startToken="%BEGINJSON%" endToken="%ENDJSON%" prettify="true" lang="lang-json" />
	<nomarkdown startToken="%BEGINXML%" endToken="%ENDXML%" prettify="true" lang="lang-xml" />			
	<regex searchPattern="\b(issue)(\s*[#]?|-){0,1}(\d+)\b" 
		replacePattern="&lt;a href='http://code.google.com/p/gitblit/issues/detail?id=$3'&gt;issue $3&lt;/a&gt;" />
	<resource>
		<fileset dir="${basedir}" includes="*.jar" />
	</resource>	
</mx:doc>