in doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java [197:240]
private void addModuleFiles(
File rootDir,
File moduleBasedir,
ParserModule module,
String excludes,
Map<String, DocumentRenderer> files,
boolean editable,
boolean skipDuplicates)
throws IOException, RendererException {
if (!moduleBasedir.exists() || ArrayUtils.isEmpty(module.getExtensions())) {
return;
}
String moduleRelativePath =
PathTool.getRelativeFilePath(rootDir.getAbsolutePath(), moduleBasedir.getAbsolutePath());
List<String> allFiles = FileUtils.getFileNames(moduleBasedir, "**/*", excludes, false);
for (String extension : module.getExtensions()) {
String fullExtension = "." + extension;
List<String> docs = filterExtensionIgnoreCase(allFiles, fullExtension);
// *.<extension>.vm
List<String> velocityFiles = filterExtensionIgnoreCase(allFiles, fullExtension + ".vm");
docs.addAll(velocityFiles);
for (String doc : docs) {
DocumentRenderingContext docRenderingContext = new DocumentRenderingContext(
moduleBasedir, moduleRelativePath, doc, module.getParserId(), extension, editable);
// TODO: DOXIA-111: we need a general filter here that knows how to alter the context
if (endsWithIgnoreCase(doc, ".vm")) {
docRenderingContext.setAttribute("velocity", "true");
}
if (!checkForDuplicate(docRenderingContext, files, skipDuplicates)) {
String key = docRenderingContext.getOutputName();
files.put(key, new DoxiaDocumentRenderer(docRenderingContext));
}
}
}
}