How to use Scala Twirl template engine standalone, without Play Framework

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Mustache

    Logic-less Ruby templates.

  • I recently had to generate multiple configuration files for Apache httpd server. My first choice was Apache Module mod_macro, however, it has too many limitations. My second choice was to use mustache templates and I was super excited that it is also available in bash! Everything seems great until I attempted to use arrays, and it did not work. Most likely because it was implemented for Bash 3.x which is 10 years old. I did not want to mess with my environment by adding or switching to older version of Bash. Because Scala is my weapon of choice, I decided for my third attempt, to try solving this problem using Scala and Twirl templating engine. I know it might seem like an overkill, however, my previous choices have failed me, so I wanted my next attempt to be the final one! 😎

  • mo

    Mustache templates in pure bash (by tests-always-included)

  • I recently had to generate multiple configuration files for Apache httpd server. My first choice was Apache Module mod_macro, however, it has too many limitations. My second choice was to use mustache templates and I was super excited that it is also available in bash! Everything seems great until I attempted to use arrays, and it did not work. Most likely because it was implemented for Bash 3.x which is 10 years old. I did not want to mess with my environment by adding or switching to older version of Bash. Because Scala is my weapon of choice, I decided for my third attempt, to try solving this problem using Scala and Twirl templating engine. I know it might seem like an overkill, however, my previous choices have failed me, so I wanted my next attempt to be the final one! 😎

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • twirl-in-scala-standalone-example

    How to use Scala Twirl template engine standalone, without Play Framework.

  • Scala Twirl template engine can be use in standalone applications, without the need for Play Framework. I personally like to use it and for my use case I was able to solve the problem faster than trying to figure out Apache httpd mod_macro or mustache. If you like to check out complete project, you can find it on GitHub. Enjoy!

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts