summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/lualatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-11-07 21:27:54 +0000
committerKarl Berry <karl@freefriends.org>2021-11-07 21:27:54 +0000
commitf74dcee34dd73e7bc5e394c7dcb4d81b185d0a30 (patch)
tree99c329535e6c476d1cb82bd1cf855435861de1f2 /Master/texmf-dist/doc/lualatex
parent4515fa2482931c7a82579ed40e52d15cfcedcd16 (diff)
yamlvars (7nov21)
git-svn-id: svn://tug.org/texlive/trunk@60990 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/lualatex')
-rw-r--r--Master/texmf-dist/doc/lualatex/yamlvars/README.md1
-rw-r--r--Master/texmf-dist/doc/lualatex/yamlvars/YAMLvars.pdfbin39208 -> 46334 bytes
-rw-r--r--Master/texmf-dist/doc/lualatex/yamlvars/YAMLvars.tex49
3 files changed, 42 insertions, 8 deletions
diff --git a/Master/texmf-dist/doc/lualatex/yamlvars/README.md b/Master/texmf-dist/doc/lualatex/yamlvars/README.md
index f901e1ef358..946ee2e374f 100644
--- a/Master/texmf-dist/doc/lualatex/yamlvars/README.md
+++ b/Master/texmf-dist/doc/lualatex/yamlvars/README.md
@@ -1,6 +1,7 @@
# YAMLvars -- parse a YAML document and create LaTeX definitons
This LuaLaTeX package provides a YAML parser and some functions to declare and define LaTeX definitions using YAML files.
+It uses the [`tinyyaml`](https://github.com/api7/lua-tinyyaml) parser.
diff --git a/Master/texmf-dist/doc/lualatex/yamlvars/YAMLvars.pdf b/Master/texmf-dist/doc/lualatex/yamlvars/YAMLvars.pdf
index 1d3b1ed2b7d..18fa3a43e3d 100644
--- a/Master/texmf-dist/doc/lualatex/yamlvars/YAMLvars.pdf
+++ b/Master/texmf-dist/doc/lualatex/yamlvars/YAMLvars.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/lualatex/yamlvars/YAMLvars.tex b/Master/texmf-dist/doc/lualatex/yamlvars/YAMLvars.tex
index e97b325df3b..38cc59dc488 100644
--- a/Master/texmf-dist/doc/lualatex/yamlvars/YAMLvars.tex
+++ b/Master/texmf-dist/doc/lualatex/yamlvars/YAMLvars.tex
@@ -1,6 +1,5 @@
% Kale Ewasiuk (kalekje@gmail.com)
-% 2021-09-24
-%
+% 2021-11-07
% Copyright (C) 2021 Kale Ewasiuk
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,16 +23,42 @@
% OR OTHER DEALINGS IN THE SOFTWARE.
-\documentclass{article}
+\documentclass[11pt,parskip=half]{scrartcl}
+\setlength{\parindent}{0ex}
+\newcommand{\llcmd}[1]{\leavevmode\llap{\texttt{\detokenize{#1}\ }}}
+\newcommand{\cmd}[1]{\texttt{\detokenize{#1}}}
+\newcommand{\qcmd}[1]{``\cmd{#1}''}
\usepackage{url}
+\usepackage{showexpl}
+\lstset{explpreset={justification=\raggedright,pos=r,wide=true}}
+\setlength\ResultBoxRule{0mm}
+\lstset{
+ language=[LaTeX]TeX,
+ basicstyle=\ttfamily\small,
+ commentstyle=\ttfamily\small\color{gray},
+ frame=none,
+ numbers=left,
+ numberstyle=\ttfamily\small\color{gray},
+ prebreak=\raisebox{0ex}[0ex][0ex]{\color{gray}\ensuremath{\hookleftarrow}},
+ extendedchars=true,
+ breaklines=true,
+ tabsize=4,
+}
+\addtokomafont{title}{\raggedright}
+\addtokomafont{author}{\raggedright}
+\addtokomafont{date}{\raggedright}
+\author{Kale Ewasiuk (\url{kalekje@gmail.com})}
+\usepackage[yyyymmdd]{datetime}\renewcommand{\dateseparator}{--}
+\date{\today}
+
+
+
\usepackage{YAMLvars}
-\setlength{\parindent}{0ex}
-\setlength{\parskip}{0.75em}
+\title{YAMLvars}
+\subtitle{a YAML variable parser for LuaLaTeX}
\begin{document}
-
-{\noindent\huge\bfseries YAMLvars \LARGE -- a YAML variable parser for LuaLaTeX}\\
- 2021-09-24, Kale Ewasiuk, \url{kalekje@gmail.com}
+\maketitle
YAMLvars is a LuaLaTeX-based package to help make definitions or produce LaTeX code using a YAML file.
This package might be useful for you if you want to batch create docummnts
@@ -163,6 +188,14 @@ end
YAMLvars.xfm['addmyfunction'] = myfunction
\end{verbatim}
+If you want to run some Lua code and write in your YAML file (weird idea, but maybe useful for one-off functions),
+you can do so by specifying a transform function with an \texttt{=} in it to make a lambda function.
+For example, a \texttt{xfm} equal to
+``\texttt{= '---'..x..'---'}''
+would surround your YAML variable's value with em-dashes.
+You can access the variable name with this lambda function with \texttt{v}.
+If you want to just execute code (instead of settings \texttt{x = }, use \texttt{/}).
+
\section{prc -- Processing Functions}
Like the transform functions, the processing function must accept \texttt{(var, val)}.
Only one processing function is applied to the final (var, val) after the transforms are done.