vayne 0.0.2
Run-time template compiler and VM for D
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
Vayne - Mustache-inspired template compiler and run-time interpreter for D
Vayne has been written mainly for use with vibe.d but it can be used in any other way. It is the successor to jax, a compile-time solution.
Compiles source text/html into bytecode to be interpreted at run time.
Features
- HTML compressor
- Parametrized macros
- Good and detailed error reporting
- Supports user defined escaping and translation
Options
o|output-dir - Output directory
p|time - Display elapsed time at end
v|verbose - Verbose output
l|line-numbers - Keep line numbers for error reporting (disables compression)
d|dep-cache - Dependant-cache directory
g|dep-gen-only - Only generate dependant-cache, do not re-compile dependants
c|compress - Compress HTML in between template tags
j|search - Search path(s) to look for dependency files
t|token - Token for token_url interpolation filter. Useful for cache-busting
Tags
{{& fileName }} - Include external file
{{&& fileName }} - Embed external file as mime-encoded content
{{* key, value; iterable }} {{key}} {{value}} {{/}} - Iterate any iteratable symbol
{{? expr }} true case {{: [expr] }} else case {{/}}
{{@ expr0, expr2 as ident }} - Create symbol scopes or named copy of expressions. For symbol scopes, expression must evalute to an object or associative array.
{{! comment }} - Comment
{{ expr }} - Write expression to output with automatic HTML escaping
{{{ expr }}} - Write expression to output without escaping
{{~ message-id-expr, arg0+ }} - Translate message-id with arguments and output - use triple brackets to disable escaping
{{#def myMacro(arg) }} macro text {{#arg}} {{#/}}
{{#myMacro("mooo") }} - Expand a macro
Check the example directory for a working example.
- 0.0.2 released 8 years ago
- eBookingServices/vayne
- MIT
- Copyright © 2016, Márcio Martins
- Authors:
- Dependencies:
- none
- Versions:
-
0.0.46 2019-Dec-12 0.0.45 2019-Jan-16 0.0.44 2018-Dec-19 0.0.43 2018-Sep-17 0.0.42 2018-Sep-13 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
1817 downloads total
-
- Score:
- 1.3
- Short URL:
- vayne.dub.pm