1 个不稳定版本
0.0.1 | 2022 年 9 月 19 日 |
---|
#37 在 #tera
475KB
11K SLoC
LaTera
使用 Tera 进行 HTML 开发
<title>{% block title %}{% endblock title %}</title>
<ul>
{% for user in users %}
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
</ul>
{# a comment #}
使用 LaTera 进行 LaTeX 开发
\section{ <# block section #><# endblock section #> }
\begin{itemize}
<# for user in users #>
\item \href{ << user.url >> }{ << user.username >> }
<# endfor #>
\end{itemize}
<% a comment %>
目标
- 避免在 LaTeX 代码中因花括号引起的模板问题
- 与 LaTeX 语法高亮有一定兼容性
更新日志
- 更改块语法
-variable_start = { "{{-" | "{{" }
-variable_end = { "-}}" | "}}" }
+variable_start = { "<<-" | "<<" }
+variable_end = { "->>" | ">>" }
-tag_start = { "{%-" | "{%" }
-tag_end = { "-%}" | "%}" }
+tag_start = { "<#-" | "<#" }
+tag_end = { "-#>" | "#>" }
-comment_start = { "{#-" | "{#" }
-comment_end = { "-#}" | "#}" }
+comment_start = { "<%-" | "<%" }
+comment_end = { "-%>" | "%>" }
- 重写测试
- 对 LaTeX 进行文本转义,而不是 HTML
依赖项
~7–18MB
~217K SLoC