SOAT (template engine)
This article provides insufficient context for those unfamiliar with the subject.July 2012) (Learn how and when to remove this template message) ( |
Original author(s) | Adnan Yunus |
---|---|
Stable release | 0.7.15
/ August 21, 2018[1] |
Written in | Python |
Engine | |
Type | Template engine |
License | BSD License |
Search SOAT (template engine) on Amazon.
SOAT is a template engine for the Python programming language and is licensed under a BSD License created by Adnan Yunus. It is similar to the Django template engine but provides Python expressions . It is a text-based template language and thus can be used to generate any markup as well as sourcecode.
The SOAT template engine allows customization of delimiters similar to Mustache_(template_system). Because it is merely a thin wrapper over python language, full language features such as functions are available within a template.
Features[edit]
Some of the unique features of SOAT are:[2]
- Delimiter changing
- One to many output buffers or files
- template inheritance (using python import)
- compiles down to the optimal python code just in time
- optional ahead-of-time template compilation
- easy to debug. Line numbers of exceptions directly point to the correct line in the template.
- configurable syntax
Example[edit]
Here is a small example of a template file 'example.cxx.soa'
#include <iostream>
int main(int argc, char *argv[]) {
printf("{{name}}");
}
Given a python dict data={'name': 'Hello world'}, This produces the C++ string:
#include <iostream>
int main(int argc, char *argv[]) {
printf("Hello world");
}
Sources[edit]
- ↑ "artometa/soat". GitHub.
- ↑ "artometa/soat". GitHub.
External links[edit]
- SOAT website
- SOAT on Python pypi
- soat on GitHub
This article "SOAT (template engine)" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:SOAT (template engine). Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.