Doxia Features

Maven Doxia provides powerful macros for dynamic content. This page covers the most useful ones.

Table of Contents Macro

Generate a ToC from page headings:

<!-- MACRO{toc|fromDepth=2|toDepth=3|id=toc} -->
Parameter Description Default
fromDepth Starting heading level 1
toDepth Ending heading level 2
id Must be toc for styling Required

See Table of Contents[1] for details.

Snippet Macro

Include code from external files:

<!-- MACRO{snippet|id=example|file=src/main/java/Example.java} -->

Marking Snippets in Source

In your source file, mark the snippet boundaries:

public class Example {
    // START SNIPPET: example
    public void doSomething() {
        System.out.println("Hello");
    }
    // END SNIPPET: example
}

Snippet Parameters

Parameter Description
id Snippet identifier (matches START/END markers)
file Path to source file (relative to project root)
url URL to fetch snippet from
verbatim If false, content is processed as markup

Full File Include

Omit id to include the entire file:

<!-- MACRO{snippet|file=src/config/example.xml} -->

Echo Macro

Display the current date/time:

<!-- MACRO{echo|value=Today is ${currentDate}} -->

Useful for showing when documentation was generated.

Comments

Add comments that won't appear in output:

<!-- This is a comment and won't be rendered -->

Reference

Next Steps

Searching...
No results.