https://github.com/almas-ali/fasttemp
FastTemp is a simple, fast, and lightweight template engine for Python.
https://github.com/almas-ali/fasttemp
html-template-engine html-templating python-template-engine template-engine
Last synced: 7 months ago
JSON representation
FastTemp is a simple, fast, and lightweight template engine for Python.
- Host: GitHub
- URL: https://github.com/almas-ali/fasttemp
- Owner: Almas-Ali
- License: mit
- Created: 2023-12-23T06:52:53.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-23T07:04:11.000Z (almost 2 years ago)
- Last Synced: 2025-01-07T15:28:37.955Z (9 months ago)
- Topics: html-template-engine, html-templating, python-template-engine, template-engine
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
FastTemp - A HTML Template Engine
FastTemp is a simple, fast, and lightweight template engine for Python. It is still in development, and not ready for production use.
## The Principles of FastTemp
FastTemp is designed to be fast and easy to use. It has a rich syntax and supports many features. It's syntax highly inspired by [blade](https://laravel.com/docs/10.x/blade#main-content) from [Laravel](https://laravel.com/). We use the similar syntax to blade, but different in some ways. We are not trying to copy blade, but we are trying to make a template engine with a similar syntax to blade which is easy to use and fast. We are also trying to make it as lightweight as possible.
## Features
- [x] Variables
| Syntax | Description |
| --- | --- |
| `@set(variable, value)` | Set a variable |
| `{variable}` | Print the variable |
| `{% variable %}` | Print the variable with HTML escaped |- [x] Comments
| Syntax | Description |
| --- | --- |
| `@comment ... @endcomment` | Comment block |- [x] Control Structures
| Syntax | Description |
| --- | --- |
| `@if(condition) ... @endif` | If statement |
| `@if(condition) ... @else ... @endif` | If-else statement |
| `@unless ... @endunless` | Unless statement |
- [ ] Loops
| Syntax | Description |
| --- | --- |
| `@for ... @endfor` | For loop |
| `@foreach ... @endforeach` | For-each loop |
| `@while ... @endwhile` | While loop |- [ ] Includes
| Syntax | Description |
| --- | --- |
| `@include ...` | Include a template |- [ ] Layouts
| Syntax | Description |
| --- | --- |
| `@extends ...` | Extend a template |
| `@section ... @endsection` | Define a section |
| `@yield ...` | Yield a section |
| `@parent` | Yield the parent section |- [ ] Built-in Directives
- [ ] Built-in Functions
- [ ] Built-in Filters
- [ ] Built-in Tags- [ ] Custom Directives
- [ ] Custom Functions
- [ ] Custom Filters
- [ ] Custom Tags