From 2baaffaf27d644b9e2cc46d0cba401670c800434 Mon Sep 17 00:00:00 2001 From: surtur Date: Mon, 14 Aug 2023 22:25:04 +0200 Subject: [PATCH] tex: update composability section's listing --- tex/part-practical.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tex/part-practical.tex b/tex/part-practical.tex index 140d694..d04f367 100644 --- a/tex/part-practical.tex +++ b/tex/part-practical.tex @@ -374,13 +374,15 @@ Echo's built-in facilities in a more ergonomic manner using \texttt{return c.Render(http.StatusOk, "home.tmpl")}. \vspace{\parskip} -\begin{lstlisting}[language=Go, caption={A conditional inside a Go template}, +\begin{lstlisting}[ +caption={Conditionaly enabling functionality inside a Go template based on user access level}, label=tmplConditionals, basicstyle=\linespread{0.9}\small\ttfamily, backgroundcolor=\color{lstbg}, +morekeywords={if,and,end}, ] {{ if and .User .User.IsLoggedIn .User.IsAdmin }} ... -{{end}} +{{ end }} \end{lstlisting} Templates used for rendering of the web pages were created in a composable