Skip to content

Instantly share code, notes, and snippets.

@breezhang
Created May 22, 2014 14:04
Show Gist options
  • Save breezhang/e5e89dd97c28b9035f1c to your computer and use it in GitHub Desktop.
Save breezhang/e5e89dd97c28b9035f1c to your computer and use it in GitHub Desktop.
Templating system choose
Choosing a Templating System
1. Reusability
2. stand-alone
3. result-independent
4. simple, small, lightweight
5. clear template syntax
6. completely Unicode
7. good syntax-error-checking and good error-messages, to make the writing and debugging of templates easy
8. fast
9. basic functionality (from "category 4" above):
placeholders/string-substitution
conditionals
loops
macros (with parameters)
restricted "embedded expressions" (formatting, arithmetics etc.)
10. additional functionality:
inclusion of other templates (for reusability and "things" which are used in several templates)
escaping-mechanism (e.g. for html: escape < > & ' ")
(MAYBE) definition of the result-encoding
(MAYBE) set template-variables
11. complain about undefined/non-existing variables in the template by default (Most template-engines
silently ignore undefined variables in the template.
But silently ignoring errors is bad,
and wrong data is much worse than no data and an error-message.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment