A screenshot of a JetBrains IDE showing the settings panel that allows users to update

Flexible Freemarker

Flexible Freemarker is a plugin for JetBrains IDEs that allows you to edit and preview FreeMarker templates with ease.

This repository exists as a community hub and issue tracker.

Feedback and Support

If you have any feedback, suggestions, or issues with the plugin, please use our Github repository to report them (you may have found it already). You can also use the repository to contribute to the plugin development or request new features.

Features

  • Syntax highlighting for FreeMarker template language
  • Live preview of template output with custom data models
  • Code completion and navigation for template directives and expressions
  • Error checking and validation for template syntax and semantics
  • Support for multiple template configurations and output formats

Installation

You can install Flexible Freemarker from the JetBrains Marketplace or from the IDE settings.

  • From the Marketplace: Go to Flexible Freemarker and click on the Install button. Then restart your IDE to activate the plugin.
  • From the IDE settings: Go to File > Settings > Plugins and search for Flexible Freemarker. Click on the Install button and activate the plugin.

Usage

To use Flexible Freemarker, you need to have a FreeMarker template file and a data model file in your project.

  • Install the plugin
  • Check that *.ftl file types are correctly associated (Settings > File Types > "Flexible Freemarker" > List should include *.ftl; Add if missing)
  • Go to the Settings page ( Settings > Tools > "Flexible Freemarker") and start adding your own macros and functions.
  • Start adding your first element - click on the "+" icon next to the upper table. Choose a unique name and hit "Ok".
  • Select the newly created element and change the element properties in the form that shows up below.
  • Select "apply" to store all changes.
  • Congratulations! You just added your first element. Try it out immediately on your ftl files. Autocomplete, Highlighting and other options are instantly available.

To edit and preview a FreeMarker template, follow these steps:

  • Open the template file in the editor. You will see the syntax highlighting and code completion features for the template language.
  • Open the data model file in the editor. You will see the syntax highlighting and code completion features for the data format.
  • To preview the template output, click on the Preview button on the top right corner of the editor. A new tab will open with the rendered output of the template using the data model.
  • To change the template configuration or output format, click on the Settings button on the top right corner of the editor. A dialog will open where you can adjust the options for the template processing.
  • To refresh the preview, click on the Refresh button on the top right corner of the editor. The preview tab will update with the latest output of the template using the data model.