gorender_transformer

pub transformer that renders templates with Go text.template template engine using JSON data file.

Prerequisites

This transformer depends on gorender CLI utility that renders templates.

Usage example

pubspec.yaml

name: gorender_example
dependencies:
  gorender_transformer: any
transformers:
- gorender_transformer

web/example.txt.tpl

Hello, {{ .user }}

web/example.json

{"user": "Guest"}

Options

template-extension

Template extensions

TYPE: String DEFAULT: .gtpl

data-extension

Data extensions

TYPE: String DEFAULT: .json

html-extension

Templates that will be rendered with html.template package. The full extension of the template should consist of html-extension and template-extension, for example: .html.gtpl.

TYPE: String DEFAULT: .html

Libraries

gorender_transformer