Jinja2 templates is an experimental feature for advanced template generation. It is not recommended for general use unless you are comfortable with writing scripts.

Literals


    I love red roses
    

Random choices


    I love {{ choice('red', 'blue', 'green') }} roses
        
This will randomly choose one of the three colors.

Iterations

        
    {% for colour in ['red', 'blue', 'green'] %}
        {% prompt %}I love {{ colour }} roses{% endprompt %}
    {% endfor %}
        
    
This will produce three prompts, one for each color. The prompt tag is used to mark the text that will be used as the prompt. If no prompt tag is present then only one prompt is assumed

Wildcards

        
    {% for colour in wildcard("__colours__") %}
        {% prompt %}I love {{ colour }} roses{% endprompt %}
    {% endfor %}
        
    
This will produce one prompt for each colour in the wildcard.txt file.

Conditionals

        
    {% for colour in ["red", "blue", "green"] %}
        {% if colour == "red" %}
            {% prompt %}I love {{ colour }} roses{% endprompt %}
        {% else %}
            {% prompt %}I hate {{ colour }} roses{% endprompt %}
        {% endif %}
    {% endfor %}
        
    
This will produce the following prompts:
Jinja2 templates are based on the Jinja2 template engine. For more information see the Jinja2 documentation..
If you are using these templates, please let me know if they are useful.