This is Tim, the Red Guy of all template engines! Just a quick example, careful it's highly addictive:
var catchy = ["the first Mate", "the great Pantzini", "principal Hiney"]
section.container > div.row > div.col-12.text-center
h1.fw-bold: "Hello, It's me!"
for $p in $catchy:
span.badge.text-bg-secondary.mx-2: $p
Tim is currently available as a Nimble library for Nim development. I plan to bring Tim to other programming languages as a standalone CLI app using S2S compilation. Building Tim for Node is also a good idea.
Meanwile, check /example directory to see HttpBeast + Tim. Here is a preview of the generated HTML. Cheers!
I'm glad to see that your projects keep evolving. Congrats.
Also, I'm curious about something from your readme: Built-in real-time Server-Side Rendering SSR via ZeroMQ. How is that?
I remember liked how you used the "Unix way" to connect your apps. So you using ZeroMQ is new to me. I'm search for a really fast IPC, that why I curious.
Changing the subject, I would be happy if some day you find time to convince Nim community to add more colors to our palette.
Thank you for feedback!
One day there will be a trilogy, Tim + Bro (Scss/Sass alt) + Lesscript (TS alt), maybe I should create new showcase topics about these. Thanks to this wonderful language, I can be so creative, even though I'm just a graphic designer 😅
Tim helps decoupling frontend and backend development. This is the main goal of this project. I wanted a template engine that would give me the freedom to update the source of my templates without recompiling the main app over and over.
I am writing a traditional CMS with headless capabilities, plugins and themes system. I want to be easy to install, run and update. For themes, the first thing that came to my mind was "I need a templating engine" but not some weird mustache-like {{whatever}} placeholders mixed with ugly HTML.
Back to Tim! There will be a standalone app that will include the base features, and also:
For example tim to nim:
section#myaccount > div.container > div.row
if $this.loggedin:
h1.fw-bold: "Hello, " & $this.username
a.btn-dark href=$this.logoutlink: "Logout"
else:
h1.fw-bold: "Hello"
proc getHomeView*(local: JsonNode): string =
result = "<section id=\"myaccount\"><div class=\"container\"><div class=\"row\">"
if local["loggedin"].getBool:
add result, "<h1 class=\"fw-bold\">Hello, " & local["username"].getStr & "</h1>"
add result, "<a href=\"" & local["logoutlink"].getStr & "\">Logout</a>"
else:
add result, "<h1 class=\"fw-bold\">Hello!</h1>"
add result, "</div></div></section>"
Other features:
Anyway, it's not written in stone. I'm open to new ideas and suggestions. Cheers!