Skip to content

Instantly share code, notes, and snippets.

@andreivasiliu
Created May 7, 2021 06:10
Show Gist options
  • Save andreivasiliu/aa66f727f3f306000306a77c023c244c to your computer and use it in GitHub Desktop.
Save andreivasiliu/aa66f727f3f306000306a77c023c244c to your computer and use it in GitHub Desktop.
# From: https://wiki.tcl-lang.org/page/TemplaTcl%3A+a+Tcl+template+engine
source tt.tcl
set template {
<element><%= $myvar %></element>
}
# Create template engine
TemplaTcl::create tt
# Load template from string; alternative is parseFile for file
tt parse $template
tt setVar myvar "Hello world"
puts [tt render]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment