Spring Boot Starter Pebble

Spring Boot auto-configuration for Pebble template engine

License

License

Categories

Categories

Spring Boot Container Microservices
GroupId

GroupId

org.woodylab.boot
ArtifactId

ArtifactId

spring-boot-starter-pebble
Last Version

Last Version

0.2.3
Release Date

Release Date

Type

Type

jar
Description

Description

Spring Boot Starter Pebble
Spring Boot auto-configuration for Pebble template engine
Project URL

Project URL

https://github.com/LionelWoody/spring-boot-starter-pebble
Source Code Management

Source Code Management

https://github.com/LionelWoody/spring-boot-starter-pebble

Download spring-boot-starter-pebble

How to add to project

<!-- https://jarcasting.com/artifacts/org.woodylab.boot/spring-boot-starter-pebble/ -->
<dependency>
    <groupId>org.woodylab.boot</groupId>
    <artifactId>spring-boot-starter-pebble</artifactId>
    <version>0.2.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.woodylab.boot/spring-boot-starter-pebble/
implementation 'org.woodylab.boot:spring-boot-starter-pebble:0.2.3'
// https://jarcasting.com/artifacts/org.woodylab.boot/spring-boot-starter-pebble/
implementation ("org.woodylab.boot:spring-boot-starter-pebble:0.2.3")
'org.woodylab.boot:spring-boot-starter-pebble:jar:0.2.3'
<dependency org="org.woodylab.boot" name="spring-boot-starter-pebble" rev="0.2.3">
  <artifact name="spring-boot-starter-pebble" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.woodylab.boot', module='spring-boot-starter-pebble', version='0.2.3')
)
libraryDependencies += "org.woodylab.boot" % "spring-boot-starter-pebble" % "0.2.3"
[org.woodylab.boot/spring-boot-starter-pebble "0.2.3"]

Dependencies

compile (3)

Group / Artifact Type Version
com.mitchellbosecke : pebble jar 2.2.0
org.springframework.boot : spring-boot-starter-web Optional jar
org.springframework.boot : spring-boot-configuration-processor Optional jar

test (1)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar

Project Modules

There are no modules declared in this project.

Spring Boot Starter Pebble

Maven Central Build Status Coverage Status

Spring Boot Starter support for Pebble (A lightweight but rock solid Java templating engine.).

Usage

Getting started

Add spring-boot-starter-pebble as dependency.

With Gradle:

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.woodylab.boot:spring-boot-starter-pebble:0.2.3'
}

With Maven:

<dependency>
    <groupId>org.woodylab.boot</groupId>
    <artifactId>spring-boot-starter-pebble</artifactId>
    <version>0.2.3</version>
</dependency>

How to extend the library

CustomExtension is supported since version 0.2.0. You can define your extension, simply annotation it and then you can use it in your template.

@EnableAutoConfiguration
@PebbleExtension
public class CustomPebbleExtension extends AbstractExtension {
    @Override
    public Map<String, Filter> getFilters() {
        Map<String, Filter> filters = new HashMap<>();
        filters.put("noArgumentsButCanAccessContext", new Filter() {
            @Override
            public List<String> getArgumentNames() {
                return null;
            }
            @Override
            public String apply(Object input, Map<String, Object> args) {
                EvaluationContext context = (EvaluationContext) args.get("_context");
                PebbleTemplateImpl pebbleTemplate = (PebbleTemplateImpl) args.get("_self");
                if (context != null && pebbleTemplate != null) {
                    return "success";
                } else {
                    return "failure";
                }
            }
        });
        return filters;
    }
}

License

spring-boot-starter-pebble is published under Apache License 2.0.

Versions

Version
0.2.3
0.2.2
0.2.1
0.2.0
0.1.2