latera

Crates.iolatera
lib.rslatera
version0.0.1
sourcesrc
created_at2022-09-19 18:55:35.484928
updated_at2022-09-19 18:55:35.484928
descriptionLaTeX Template engine based on Tera
homepage
repositoryhttps://github.com/k12ish/LaTera
max_upload_size
id669312
size498,190
(k12ish)

documentation

README

LaTera

Use Tera for 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 #}

Use LaTera for LaTeX:

\section{ <# block section #><# endblock section #> }
\begin{itemize}
  <# for user in users #>
    \item \href{ << user.url >> }{ << user.username >> }
  <# endfor #>
\end{itemize}
<% a comment %>

Objectives

  • Avoid templating issues with curly brackets in your LaTex code
  • Be somewhat compatible with LaTeX syntax highlighting

Changelog

  • Changed block syntax
-variable_start = { "{{-" | "{{" }
-variable_end   = { "-}}" | "}}" }
+variable_start = { "<<-" | "<<" }
+variable_end   = { "->>" | ">>" }
-tag_start      = { "{%-" | "{%" }
-tag_end        = { "-%}" | "%}" }
+tag_start      = { "<#-" | "<#" }
+tag_end        = { "-#>" | "#>" }
-comment_start  = { "{#-" | "{#" }
-comment_end    = { "-#}" | "#}" }
+comment_start  = { "<%-" | "<%" }
+comment_end    = { "-%>" | "%>" }
  • Rewrite tests
  • Escape text for LaTeX, not HTML
Commit count: 978

cargo fmt