This project extends Maven Doxia with a macro offering an advanced way of including static or dynamic content into generated technical sites & documents that are built within the Maven ecosystem.
Include Macro for Maven2 & 3 :: Doxia starts where the standard Snippet macro ends. It combines features like standard file & snippet inclusion, source code highlighting and dynamic content creation without adding additional dependencies like requiring custom site skins or modifications to the standard site templates.
Maven :: Doxia is used by the maven-site-plugin to build project sites within a Maven project. The Macro defined by this extension can be used as soon as it was registered within your own project's pom.xml (Maven - Project Object Model).
See Usage & Parameter Reference for an overview how the Macro can be used in own projects.
![]() | Inclusion with Syntax Highlighting | ![]() | Advanced Snippet Selection | Templates & Dynamic Content |
NotesBundled highlighting schemes (brushes) include support for: Java, JavaFX, JavaScript, JSP, Groovy, GSP, XML/XHTML, SQL, Bash, Batch, Flex/AS3 and more. Behind the scenes, syntax highlighting is implemented using a well known javascript library (SyntaxHighlighter) that runs on Rhino during a build. This results in good support for highlighting schemes in combination with no requirement for client side javascript. |
Snippet Selection using ExpressionsAmong other options, snippets can be selected using AOP-like, XPath and Regular expressions as well as the traditional snippet IDs (similar to snippet macro). Examples:
| |
Example Template 'hello-world.jsp.vm':
%{include|source=samples/hello-world.jsp.vm|title=Hello World 2}
| NotesAny source that ends with the file extension ".vm" is considered a velocity template and processed before any inclusion and snippet extraction is applied (w. or wo. highlighting of the final results). All call-time parameters that were specified with the Macro call are available inside the velocity template using ${paramName}. In addition when using a source-class, dynamic content can be made available to the template which is excessively used in the bundled templates and extensions. See reference for more details on using templates and look after bundled extensions to see how this feature can be used. |