assoba-template-api

Assoba template engine API

Лицензия

Лицензия

Группа

Группа

fr.assoba.open
Идентификатор

Идентификатор

assoba-template-api
Последняя версия

Последняя версия

1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

assoba-template-api
Assoba template engine API

Скачать assoba-template-api

Как подключить последнюю версию

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

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.scala-lang : scala-compiler jar 2.10.1
org.scalatest : scalatest_2.10 jar 1.9.1
commons-lang : commons-lang jar 2.6
com.github.scala-incubator.io : scala-io-file_2.10 jar 0.4.2

Модули Проекта

Данный проект не имеет модулей.

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!

Версии библиотеки

Версия
1.0