# Text template engines

**URL:** <https://discourse.julialang.org/t/text-template-engines/33865>\
**Category:** New to Julia\
**Created:** [January 27, 2020, 6:00pm UTC](https://discourse.julialang.org/t/text-template-engines/33865 "2020-01-27T18:00:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [January 27, 2020, 6:00pm UTC](https://discourse.julialang.org/t/text-template-engines/33865/1 "2020-01-27T18:00:10Z")

</div>

Are there any generic template engines for Julia, like Mako, Jinja and others are for Python? I couldn’t find any, and website generators in Julia (e.g. JuDoc, Franklin) don’t seem to use template engines either. Am I missing something, or there are indeed none? I mostly use a template engine (Mako for now) to generate HTML and Latex.

---

<div class="post-metadata">

**Author:** ![cce](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cce/32/460_2.png) [@cce](https://discourse.julialang.org/u/cce)\
**Post date:** [September 24, 2020, 2:12pm UTC](https://discourse.julialang.org/t/text-template-engines/33865/2 "2020-09-24T14:12:40Z")

</div>

There is [HAML.jl](https://github.com/tkluck/HAML.jl/). Any others? [Genie.jl](https://github.com/GenieFramework/Genie.jl) has one built-in.

---

<div class="post-metadata">

**Author:** ![JonasIsensee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jonasisensee/32/4704_2.png) [@JonasIsensee](https://discourse.julialang.org/u/JonasIsensee)\
**Post date:** [September 24, 2020, 3:05pm UTC](https://discourse.julialang.org/t/text-template-engines/33865/3 "2020-09-24T15:05:20Z")

</div>

Is [https://github.com/jverzani/Mustache.jl](https://github.com/jverzani/Mustache.jl)  
what you are looking for ?

---

<div class="post-metadata">

**Author:** ![cce](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cce/32/460_2.png) [@cce](https://discourse.julialang.org/u/cce)\
**Post date:** [September 25, 2020, 4:16am UTC](https://discourse.julialang.org/t/text-template-engines/33865/4 "2020-09-25T04:16:46Z")

</div>

What I’m looking for is something like [lit-html](https://lit-html.polymer-project.org/) where you can use Julia to directly build HTML/SVG, with the core library doing the escaping. Anything like this?

---

<div class="post-metadata">

**Author:** ![yurivish](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yurivish/32/307_2.png) [@yurivish](https://discourse.julialang.org/u/yurivish)\
**Post date:** [September 25, 2020, 4:29am UTC](https://discourse.julialang.org/t/text-template-engines/33865/5 "2020-09-25T04:29:20Z")

</div>

[https://github.com/yurivish/Hyperscript.jl](https://github.com/yurivish/Hyperscript.jl) ?

---

<div class="post-metadata">

**Author:** ![cce](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cce/32/460_2.png) [@cce](https://discourse.julialang.org/u/cce)\
**Post date:** [September 25, 2020, 3:33pm UTC](https://discourse.julialang.org/t/text-template-engines/33865/7 "2020-09-25T15:33:11Z")

</div>

As @fonsp points out in a Hyperscript.jl [discussion](https://github.com/yurivish/Hyperscript.jl/issues/21), something like Observable’s [Hypertext Literal](https://observablehq.com/@observablehq/htl), but for Julia would be fantastic.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [September 26, 2020, 9:52am UTC](https://discourse.julialang.org/t/text-template-engines/33865/8 "2020-09-26T09:52:58Z")

</div>

Thanks for all these suggestions! As far as I understand, the only real **text** templating engine here is `Mustache.jl`, others are specific to HTML. In principle it’s nice that the syntax is (almost?) cross-platform, and the same templates can be used with `mustache` implementations in other languages. However I think I’m staying with Python’s `Mako` for now, as it doesn’t require learning another “sub-language” just for templating and uses basically plain Python instead.
