Apache Freemarker docgen

Clone this repo:
  1. a7ff295 Included missing Xalan dependencies by ddekany · 9 days ago master
  2. 4feec25 Updated Ant dependency to non-vulnerable version (for the sake of tools that issue warning - it did not matter in our case) by ddekany · 10 days ago
  3. d6672dd Upgraded Xalan to 2.7.3, but also incremented version number to 0.0.3-SNAPSHOT, as that can break older FreeMarker builds. by ddekany · 10 days ago
  4. 2250aeb Downgraded to Xalan 2.7.2 to avoid breaking backward compatibility with Rat in the FreeMarker build by ddekany · 10 days ago 0.2-SNAPSHOT-final
  5. 62b1658 Updated to use FreeMarker 2.3.33. Updated some other dependencies too. by ddekany · 12 days ago


Build Status


Apache FreeMarker Docgen is an internal project under the Apache FreeMarker TLP, used for generating the FreeMarker Manual, the FreeMarker homepage, and maybe some more.

Docgen generates static web pages from a DocBook 5 “book” XML. But, it only implements the small subset of DocBook elements that we actually use, and it has no backward compatibility guarantees.


For some examples see:

For editing DocBook, we are using XXE, with the xxe-addon installed, which you can find in this project.


These tools must be installed:

  • JDK 8, tested with Oracle 1.8.0_212
  • Apache Maven, tested with 3.6.1
  • Node.js, tested with 12.18.2, 14.x.x maybe won't work. (Node.js is only used to generate static content while building Docgen itself.)

To build, ensure that npm (from Node.js) is in the path, then in the top project directory (freemarker-docgen) issue this:

mvn install

Node.js troubleshooting

Possible node.js related problems and solutions:

  • “Error: ENOENT, stat ”: create that directory manually, then retry.
  • If the system doesn't find npm: Open a new terminal (command window) so that it picks up the PATH environment variable changes. Adjust it if necessary.
  • If the build has once worked, but now keeps failing due to some missing modules, or anything strange, delete the “node_modules” directory, and issue npm install to recreate it.

Running Docgen from your IDE

If you develop/debug Docgen, it‘s convenient to launch it from your IDE. As an example, let’s generate the FreeMarker Manual. For that, create a Run Configuration in you IDE, with main class org.freemarker.docgen.cli.Main, and these command line arguments (replace <FREEMARKER_PROJECT_DIR> with the actual directory):


To ease comparing the outputs of different runs, you can set a fixed value for the last modification with a java argument like this:


Compiling LESS and JS

This happens automatically during build, in the generate-resources Maven phase. The generated output is in target\resources-gulp, which will be included in the core jar artifact.

Releasing a new Docgen version

[TODO] Standard ASF release procedure (staging, voting, etc.), so that we can release to the Maven Central. Not advertised, no announcements, no backward compatibility promises, but makes building our dependent projects easier.

Icon Font Attribution

The icon font in this project was built using IcoMoon and contains selected icons from: