App-Templer

 view release on metacpan or  search on metacpan

PLUGINS.md  view on Meta::CPAN


There are three types of plugins which are supported:

* Plugins which are used for formatting.
    * These convert your input files from Textile, Markdown, etc, into HTML.

* Plugins which present variables for use in your template(s).
    * Creating variables that refer to file contents, file globs, etc.

* Plugins which filter content of your template(s).
    * Simplify the way template can be written (escaping `HTML::Template` syntax which is too rigid for some text-editors facility, namely `nxml-mode` in Emacs for instance).

Although similar there is a different API for the three plugin-families.


### Formatter Plugins

The formatting plugins are intentionally simple because they are explicitly
enabled on a per-page basis. There is no need to dynamically try them all in
turn, executing whichever matches a particular condition, for example.

PLUGINS.md  view on Meta::CPAN

* `format`
    * Given some input text return the rendered content.
    * This method receives all the per-page and global variables.


### Filter Plugins

The template filter plugin is similar in use as the formatter one. The only
difference is at the level it operates. While a formatter plugin operates on
the content of the page, a filter one operates directly on the core template
engine allowing one to escape `HTML::Template` rigid syntax.

A standard input page-file might look like this:

    Title: My page title.
    template-filter: dollar
    ----
    This is a html page with a ${title}.

A standard template layout might look like this:

templer.cfg.sample  view on Meta::CPAN

# but generally we'd expect only one layout to exist.
#
# Here we specify both the path to the layout directory and the layout to use
# if none is specified:
#
#
# layout-path = ./layouts/
#
# layout      = default.layout
#
# Layout template can be filtered in order to escape HTML::Template rigid
# syntax which is annoying with some text-editor
#
# template-filter = dollar, strict
#
##




##



( run in 1.784 second using v1.01-cache-2.11-cpan-ceb78f64989 )