代码拉取完成,页面将自动刷新
<div class="dynamic-prompting">
Jinja2 templates is an experimental feature for advanced template generation. It is not recommended for general use unless you are comfortable with writing scripts.<br><br>
<h3>Literals</h3>
<pre><code class="codeblock">
I love red roses
</code></pre>
<h3>Random choices</h3>
<pre><code class="codeblock">
I love {{ choice('red', 'blue', 'green') }} roses
</code></pre>
This will randomly choose one of the three colors.<br><br>
<h3>Iterations</h3>
<pre>
<code class="codeblock">
{% for colour in ['red', 'blue', 'green'] %}
{% prompt %}I love {{ colour }} roses{% endprompt %}
{% endfor %}
</code>
</pre>
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<br><br>
<h3>Wildcards</h3>
<pre>
<code class="codeblock">
{% for colour in wildcard("__colours__") %}
{% prompt %}I love {{ colour }} roses{% endprompt %}
{% endfor %}
</code>
</pre>
This will produce one prompt for each colour in the wildcard.txt file. <br><br>
<h3>Conditionals</h3>
<pre>
<code class="codeblock">
{% for colour in ["red", "blue", "green"] %}
{% if colour == "red"}
{% prompt %}I love {{ colour }} roses{% endprompt %}
{% else %}
{% prompt %}I hate {{ colour }} roses{% endprompt %}
{% endif %}
{% endfor %}
</code>
</pre>
This will produce the following prompts:
<ul>
<li>I love red roses</li>
<li>I hate blue roses</li>
<li>I hate green roses</li>
</ul><br>
Jinja2 templates are based on the Jinja2 template engine. For more information see the <a href="https://jinja.palletsprojects.com/en/3.1.x/templates/">Jinja2 documentation.</a>.<br>
If you are using these templates, please let me know if they are useful.
</div>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。