Assoba template engine parent pom


License

License

GroupId

GroupId

fr.assoba.open
ArtifactId

ArtifactId

template-parent
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

pom
Description

Description

Assoba template engine parent pom
Assoba template engine parent pom
Project URL

Project URL

https://github.com/neuneu2k/assoba-template
Source Code Management

Source Code Management

https://github.com/neuneu2k/assoba-template

Download template-parent

Filename Size
template-parent-1.0.pom 4 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/fr.assoba.open/template-parent/ -->
<dependency>
    <groupId>fr.assoba.open</groupId>
    <artifactId>template-parent</artifactId>
    <version>1.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/fr.assoba.open/template-parent/
implementation 'fr.assoba.open:template-parent:1.0'
// https://jarcasting.com/artifacts/fr.assoba.open/template-parent/
implementation ("fr.assoba.open:template-parent:1.0")
'fr.assoba.open:template-parent:pom:1.0'
<dependency org="fr.assoba.open" name="template-parent" rev="1.0">
  <artifact name="template-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='fr.assoba.open', module='template-parent', version='1.0')
)
libraryDependencies += "fr.assoba.open" % "template-parent" % "1.0"
[fr.assoba.open/template-parent "1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • assoba-template-api
  • template-maven-plugin
  • template-test

assoba-template

Introduction

Just another fork of the play2 template library, aka twirl

Why the play2 template system instead of Scalate

One word: IDE's, both eclipse and IDEA support the play2 template syntax and provide static typing helpers.

While HAML derived languages are great for HTML templating, they are not designed for generic text templating, wich means that the only Scalate competitor is SSP. The Play2 syntax is both more simple (to write, not to parse :D) and more typesafe than the SSP one.

Why fork ?

Both Play2 and Twirl are designed to be used from SBT, bringing the sbt dependency on scala 2.9.x, for scala 2.10 developpements, this means quite a lot of cruft in the maven plugin.

This fork also includes some design choices on template name detection and template "format" detection that are more germane to generic templating and not only HTML templating.

How to use it ?

Include the following tiny runtime dependency in the project that will use templates.

<dependency>
        <groupId>fr.assoba.open</groupId>
        <artifactId>assoba-template-api</artifactId>
        <version>1.0</version>
</dependency>

Add the following plugin to the build>plugins section in your pom

<plugin>
    <groupId>fr.assoba.open</groupId>
    <artifactId>template-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Put your templates beside your scala code in src/main/scala,

templates should be named [CLASSNAME].stl for generic templates and [CLASSNAME].html.stl for html templates (with play2 escaping rules)

Template syntax documented in the play2 documentation

Both m2eclipse and IDEA should detect the generated-sources automatically

Credits

All credits are to go to the Play developers who devised the template language and provided its implementation!

Versions

Version
1.0