# \[ANN\] A new package Jinja.jl - Template Engine for JuliaLang

**URL:** <https://discourse.julialang.org/t/ann-a-new-package-jinja-jl-template-engine-for-julialang/71412>\
**Category:** Package Announcements\
**Tags:** web, html\
**Created:** [November 12, 2021, 11:58pm UTC](https://discourse.julialang.org/t/ann-a-new-package-jinja-jl-template-engine-for-julialang/71412 "2021-11-12T23:58:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![QGMW22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qgmw22/32/30765_2.png) [@QGMW22](https://discourse.julialang.org/u/QGMW22)\
**Post date:** [November 12, 2021, 11:58pm UTC](https://discourse.julialang.org/t/ann-a-new-package-jinja-jl-template-engine-for-julialang/71412/1 "2021-11-12T23:58:30Z")

</div>

I’m grad to announce that I released the Jinja(Also, this is my first time to post here).

Jinja is the template engine for JuliaLang. features

- Very very small! There are no dependency.
- You can write a Julia code directly in HTML.

Jinja is a Template Engine, but it has a slightly different function from Python3 jinja2. It’s a function that **allows you to write Julia code as it is in HTML**! Because of this, it is very easy to write code to embed in the template. So you can write like this.

HTML Template File is:

```julia
<html>
    <head><title>JinjaPage</title></head>
    <body>
        The current time is <strong>
        `
        time
        `
        </strong>
        , and this is random number : `Int(round(rand()*100))`
    </body>
</html>

```

Julia code is:

```julia
using Jinja
using Dates

tmp = Template("./time.html") #The last HTML
init = Dict("time"=>now())
println(tmp(init))
#The current time comes in the last HTML code intead of the Julia code and returns it.

```

This code returns HTML of String type, like this:

```julia
<html>
    <head><title>JinjaPage</title></head>
    <body>
        The current time is <strong>
        2021-11-13T08:52:12.340
        </strong>
        , and this is random number : 37
    </body>
</html>

```

Please trying using Jinja.jl!

Resources

- [source](https://github.com/QGMW22/Jinja.jl)
- [Documents](https://qgmw22.github.io/Jinja.jl/docs/)

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [November 13, 2021, 12:02am UTC](https://discourse.julialang.org/t/ann-a-new-package-jinja-jl-template-engine-for-julialang/71412/2 "2021-11-13T00:02:11Z")

</div>

Looks nice. I do wonder about the name — Are you part of the Python Jinja2 team?

---

<div class="post-metadata">

**Author:** ![QGMW22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qgmw22/32/30765_2.png) [@QGMW22](https://discourse.julialang.org/u/QGMW22)\
**Post date:** [November 13, 2021, 12:02am UTC](https://discourse.julialang.org/t/ann-a-new-package-jinja-jl-template-engine-for-julialang/71412/3 "2021-11-13T00:02:42Z")

</div>

No.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [November 13, 2021, 12:04am UTC](https://discourse.julialang.org/t/ann-a-new-package-jinja-jl-template-engine-for-julialang/71412/4 "2021-11-13T00:04:05Z")

</div>

Is it worth checking with them about using their name?

---

<div class="post-metadata">

**Author:** ![QGMW22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qgmw22/32/30765_2.png) [@QGMW22](https://discourse.julialang.org/u/QGMW22)\
**Post date:** [November 13, 2021, 12:16am UTC](https://discourse.julialang.org/t/ann-a-new-package-jinja-jl-template-engine-for-julialang/71412/5 "2021-11-13T00:16:25Z")

</div>

I haven’t checked with the Python Jinja team yet. I’ll rename it so as not to misunderstand.

---

<div class="post-metadata">

**Author:** ![sashmit](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sashmit/32/18791_2.png) [@sashmit](https://discourse.julialang.org/u/sashmit)\
**Post date:** [November 13, 2021, 1:46am UTC](https://discourse.julialang.org/t/ann-a-new-package-jinja-jl-template-engine-for-julialang/71412/6 "2021-11-13T01:46:46Z")

</div>

perhaps jin.jl? OTOH, there is a jinja.js.

thanks for the package, i love the django/jinja syntax.
