https://github.com/creativcoder/templar
Dead simple template engine in Python for the blog post [Link]
https://github.com/creativcoder/templar
python-3 template-engine
Last synced: 7 months ago
JSON representation
Dead simple template engine in Python for the blog post [Link]
- Host: GitHub
- URL: https://github.com/creativcoder/templar
- Owner: creativcoder
- License: mit
- Created: 2017-03-03T17:25:31.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-11T17:58:59.000Z (almost 9 years ago)
- Last Synced: 2025-03-04T17:53:11.560Z (11 months ago)
- Topics: python-3, template-engine
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### templar [WIP]
Dead simple template engine in Python
Example 1:
```python
from templar import Templar
t = Templar()
t.compile('Hey Templar is {{remark}}')
rendered = t.render({'remark':'awesome'})
```
Output
```
Hey Templar is awesome
```
Example 2:
```python
from templar import Templar
t = Templar()
t.compile('Greetings! {% for n in names %} Hi n {% endfor %}')
rendered = t.render({'names':['alice', 'bob', 'malice']})
```
Output
```
Greetings! Hi alice
Hi bob
Hi malice
```