Questions tagged [pebble]

Pebble is a lightweight, open source, Java EE template engine.

Pebble is a java template engine inspired by Twig. It separates itself from the crowd with it's inheritance feature and it's easy-to-read syntax. It ships with built-in auto-escaping for security, and it includes integrated support for internationalization.

40 questions
4
votes
2 answers

Parse String template instead of file in Pebble Template Engine

Is it possible to use the Pebble Template Engine to build up a template from a String instead of having to provide a filename? val engine = PebbleEngine.Builder().build() val writer =…
Jan Vladimir Mostert
  • 12,380
  • 15
  • 80
  • 137
3
votes
0 answers

How to restart flask server via API while it uses multiprocessing inside

I have a flask app with waitress that gets some data in post-request, then it runs some long computations in long_function and returns result. These computations are parallel and I'm using pebble because I need a timeout option. Also I want the…
Anna
  • 199
  • 1
  • 10
3
votes
1 answer

How to check if a variable is defined in Pebble Templates?

Using Pebble version 3.0.6. I need to check if value 'v' has a specific variable (translated to Java: if Object v has a specific property). Looking for something like {% if v instanceof test.MyClass %} ... {% endif %} or {% if v has myProperty…
rmuller
  • 12,062
  • 4
  • 64
  • 92
3
votes
1 answer

Obtain the current date in Pebble

I'm using the Pebble template engine in a Java application that uses the Spring framework. I'm looking for a solution to get the current date in Pebble. Before to start with implementing this basic function, I'm wondering if the library already…
mat_boy
  • 12,998
  • 22
  • 72
  • 116
2
votes
1 answer

How do you configure Javalin to render Pebble pages/templates?

I tried Search the documentation but I still don't understand. Here's my code to start up the app. public static void main(String[] args){ Javalin app = Javalin.create( config -> { …
Hiep Huynh
  • 21
  • 1
  • 2
2
votes
1 answer

Gatling Pebble Templating

I am having issues resolving the dot (.) notation of pebble templating in Gatling to retrieve attributes of variables, such as Map key values. Here's an example of a session attribute that I've defined: session => session.set("location", Map("text"…
Justin Chao
  • 173
  • 1
  • 8
2
votes
1 answer

Pebble Template loops

I am trying to build a simple loop where I execute the template N times. I wrote a function that accepts a parameter and outputs string based on it and I need to execute it a bunch of times. Following works if I explicitly define a range: {% for t…
AlexC
  • 1,395
  • 14
  • 26
2
votes
1 answer

loading and compiling template in ratpack: blocking or not?

I'm adding Pebble template support to my ratpack application, and there is one matter that bothers me: should my RendererSupport instance use ratpack's Blocking.get() or not? As PebbleEngine has it's own cache, i can't say whether it would be…
leetwinski
  • 17,408
  • 2
  • 18
  • 42
1
vote
2 answers

concurrent.futures misbehaves on Python 3.8+ on Mac OS

Fellow co-worker and I have run into an issue on our Macs (His: Intel, Mine: M1). I'm on 12.5.1 Monterey (not sure of his). When using Python 3.7 and implementing the following code, all works as expected: Toy Example from concurrent.futures import…
XPlatform
  • 45
  • 8
1
vote
0 answers

is there a better way to create a timeout for a function in Python?

Is there a better way to create a timeout for a function in python? Following pebble's documentation, I wrote a function where I pass my original function as an argument: from pebble import ProcessPool from concurrent.futures import…
1
vote
1 answer

How to hot swap .twig or .pebble files in spring boot

So I've been using spring boot dev tools as a means to hot swap files when I make small changes. The problem I'm having right now is I have been using .pebble files which are located in the resources/templates file in my spring project. Dev tools…
c.s_._._
  • 63
  • 10
1
vote
0 answers

Text is overlapping in Table

I can see question asked regarding text overlapping for tables (Not header), but none of the result is helping me. please advice. I have a table with n number of rows (it is a looping with pebble). some time not every, normal text in the table is…
Indian
  • 49
  • 7
1
vote
0 answers

"Dictionary size changed during iteration" from Pebble ProcessPool

We've some parallel processing code which is built around Pebble, it's been working robustly for quite some time but we seem to have run into some odd edge-case. Based on the exception trace (and the rock-simple code feeding it) I suspect that it's…
jrandodev
  • 11
  • 1
1
vote
1 answer

Python Pebble ProcessPool how to set max_tasks

Pebble's process pools take parameters for max_workers and max_tasks. https://pythonhosted.org/Pebble/#pools The description of max_tasks is a little unclear: "If max_tasks is a number greater than zero each worker will be restarted after…
Neil
  • 3,020
  • 4
  • 25
  • 48
1
vote
0 answers

Does freemarker support parallel rendering as pebble

Freemarker can support multithreading In a multithreaded environment Configuration instances, Template instances and data-models should be handled as immutable (read-only) objects. But can it use parallel execution as pebblet when…
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
1
2 3