What is FMPP?
FMPP is a general-purpose text file preprocessing tool that uses FreeMarker templates. It process entire directories recursively. It can be used for generating complete static websites, source code, configuration files, etc. It can insert data from sources like CSV, XML, and JSON into the generated files. (You can add new kind of data sources in Java.) See the Tutorial for a more concrete introduction.
FMPP can be used with UN*X-style command-line interface, or as Ant task, or can be embedded into your application using its Java API.
FMPP was written in Java, thus it runs on all modern platforms (Windows, "Linux", OS X, etc.).
FMPP is Free software under Apache License 2.0. See license...
Features
A quick list of FMPP capabilities:
- FreeMarker as the preprocessor language:
- All the usual template constructs, such as include, if/else/elseif, loop.
- Macros with named arguments and nested content (body).
- Variables (global, or local for a macro call)
- Complex expressions using string, arithmetical and logical operations. Extensible with custom functions.
- Automatic and manual escaping (HTML, XML, custom function)
- Transforming (filtering) blocks of output; extensible with custom transformations in Java.
- Capturing block of output into a variable.
- Charset aware, internally uses UNICODE.
- Number and date/time formatting with masks (patterns). Locale sensitive formatting.
- Process entire directories recursively.
- Different file processing mode can be chosen for each file, based on path patterns (as file extension): execute file as template, or parse it as XML and then render it to output with a template, or binary-copy it, or ignore it.
- Can ignore bad source files and log the error message into a text file.
- Can guarantee that certain files will be processed later than others.
- XML file
- CSV and tab-separated text file
- JSON file
- Java "properties" file
- Ant properties, Ant project and target information
- System clock
- Plain text file
- Output splitting: a single source file can generate multiple output files (including 0 output files).
- Automatic file inclusion, automatic escaping, and whatnot that can be done with automatically inserted headers and footers, chosen based on path patterns.
- Generate HTML <img>-s with calculated width and height.
- Calculate the relative path to the home directory, or to any other file.
- Rendering (transforming) XML files with FreeMarker templates. (Similar to the typical XSLT usage pattern.)
- Query the size/existence of source files.
- Query output encoding (charset).
- URL-escaping (with the actual output charset).
Documentation
Download
To download the latest release, please visit the FMPP homepage: http://fmpp.sourceforge.net/
For text editor and IDE plug-ins and other FreeMarker template-related tools, please visit the FreeMarker homepage: http://freemarker.org/ (mirror: http://freemarker.sourceforge.net/)
Contact
Ask for help or provide suggestions:
- on the mailing list (The preferred way. Low traffic.):
- Subscribe/unsubscribe: http://lists.sourceforge.net/mailman/listinfo/fmpp-open
- News group interface: nntp://news.gmane.org/gmane.comp.text.fmpp
- Web interface (read only): http://news.gmane.org/thread.php?group=gmane.comp.text.fmpp
- on the SourceForge.net Web forum: http://sourceforge.net/forum/forum.php?forum_id=254571
- with private e-mail: ddekanyREMOVETHIS@freemail.hu (delete the "REMOVETHIS"!)
Please report bugs you find! Any programming, documentation content or grammatical mistakes (even minor typos). Thank you!
Use the bug reporting Web page,
or e-mail: ddekanyREMOVETHIS@freemail.hu (delete the "REMOVETHIS"!)
Please report FreeMarker bugs at the FreeMarker bug reporting Web page, not for me. If you are not sure if you have found a FreeMarker or FMPP bug, just report it as an FMPP bug.