https://github.com/jwdeveloper/temel
Html elements server side renderer
https://github.com/jwdeveloper/temel
html html-css-javascript html-python jinja jinja2 python-serverside-rendering renderer serverside-rendering templates
Last synced: 4 months ago
JSON representation
Html elements server side renderer
- Host: GitHub
- URL: https://github.com/jwdeveloper/temel
- Owner: jwdeveloper
- License: gpl-3.0
- Created: 2024-08-18T08:05:49.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-08-18T12:15:58.000Z (11 months ago)
- Last Synced: 2025-02-15T10:47:14.317Z (5 months ago)
- Topics: html, html-css-javascript, html-python, jinja, jinja2, python-serverside-rendering, renderer, serverside-rendering, templates
- Language: HTML
- Homepage:
- Size: 80.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Introduction
Have you ever felt that `Jinja` templates are too harsh to work with, however
making frontend in `JavaScript` frameworks makes you 🤮? If so, you’ve come to the right place!
Temel is hybrid combines the flexibility of React-like components with the simplicity of Jinja templates.
It allows you to define elements as HTML files, and then use those elements as custom HTML tags named according to their respective file names.
[Check out an example to see how it works!](#define-templates)
Join the support [discord](https://discord.gg/2hu6fPPeF7) and visit the `#programming` channel for questions,
contributions and ideas. Feel free to make pull requests with missing/new features, fixes, etc## Getting started
1. #### Install the dependencie
```xml
pip install temel
```
2. #### Define templates
`CustomButton.html`
```html
{{name}}
````Layout.html`
```html
Header section
````Page.html`
```html
Page Header Message
{{% for button in buttons %}}
{{% endfor %}}
```
3. Call the renderer. Let's render `Page.html`
```python
import temel
if __name__ == '__main__':
context = {
'buttons': [
{
'name': 'Home'
},
{
'name': 'Settings'
},
{
'name': 'Profile'
}]
}
temel.load_templates('C:\\templates')
output = temel.parse("Page.html", context)
with open('output.html', 'w') as f:
f.write(output)
```4. See the output file
```html
Header section
Page Header Message
Home
Settings
Profile
```## Contributing
[Library documentation for contributors](https://github.com/jwdeveloper/Temel)
Your improvements are welcome! Feel free to open an issue
or pull request.