Doxia recently added support for Markdown documents in its version 1.7-SNAPSHOT. I have migrated some sites that used doxia-include-macro with apt to Markdown but apparently Markdown isn't parsed in my Velocity excerpts.
My site has a page cfg-enable.md. If I placed Markdown code in there it would be rendered correctly. However its actual content is:
<!-- MACRO{include|custom-library-enable=true} -->
I have a project as a dependency of maven-site-plugin. This project implements RequestParameterTransformer to allow me to translate some config xml + velocity templates into (hopefully) Markdown code. In RequestParameterTransformer.transformParameters(Map<String, Object> requestParams) I end up translating the original requestParams:
At the beginning of the method they were:
{sourceContent=<html><head></head><body><!-- MACRO{include|custom-library-enable=true} --></body></html>, custom-library-enable=true, source-content=null, parser=org.apache.maven.doxia.module.xhtml.XhtmlParser@acd3a1db}
And after executing the code below:
Object value = requestParams.get("custom-library-enable");
if (value != null) {
requestParams.put("source-content", requestParams.get(ENABLE_COMPONENT_PARAM));
requestParams.put("namespace-aware", true);
correctEncoding(requestParams);
transformEnableLibrary(value, requestParams);
}
I get
{namespace-aware=true, sourceContent=<html><head></head><body><!-- MACRO{include|custom-library-enable=true} --></body></html>, verbatim=false, source=classpath:/site/templates/components/enable-library.md.vm, source-class=org.tinyjee.maven.dim.extensions.XmlLoader, charset=UTF-8, xml=component.xml, parser=org.apache.maven.doxia.module.xhtml.XhtmlParser@86214f1a}
The problem is that the code inside my velocity templates is never interpreted as Markdown. For instance enable-library.md.vm:
#set($h1 = '#')
#set($h2 = '##')
#set($h3 = '###')
$h2 How to include this component $h2
To include the component follow these steps:
* Add the next dependency to *pom.xml*:
<!-- MACRO{include|custom-include-library=true} -->
* Add [this server resources](./cfg-resources.html).
* Add [the next properties configuration](./cfg-properties.html#properties_example) to *application-config.properties*
This is rendered as it appears in the file and the embedded MACRO isn't interpreted either.
Anonymous
Diff:
Diff:
Diff:
Diff:
Diff: