1
0

tex: update composability section's listing

This commit is contained in:
surtur 2023-08-14 22:25:04 +02:00
parent 0d6ac6125e
commit 2baaffaf27
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

@ -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