https://github.com/davidbrochart/rightside
https://github.com/davidbrochart/rightside
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/davidbrochart/rightside
- Owner: davidbrochart
- License: mit
- Created: 2018-05-06T11:19:50.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-13T16:29:55.000Z (about 8 years ago)
- Last Synced: 2025-11-29T09:10:29.403Z (7 months ago)
- Language: Python
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A tiny template engine that doesn't invite itself inside your code, but gently shows on the right side.
```python
import rightside
text = '''\
This is just to show what you can do with rightside.
You can filter lines,
remove unwanted ones, *if* a == 3
and keep only the ones that you want. *elif* a + 1 == 3
You can word1 word2. *for* word1, word2 in [('replace', 'things'), ('repeat', 'them')]
*for* _ in range(3):
You can repeat/replace conditionally (_). *if* _ == 1
*endfor*
'''
rightside.a = 2
print(rightside.process(text))
```
```
This is just to show what you can do with rightside.
You can filter lines,
and keep only the ones that you want.
You can replace things.
You can repeat them.
You can repeat/replace conditionally (1).
```