summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/yamlvars/yamlvars.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/latex/yamlvars/yamlvars.tex')
-rw-r--r--macros/luatex/latex/yamlvars/yamlvars.tex35
1 files changed, 27 insertions, 8 deletions
diff --git a/macros/luatex/latex/yamlvars/yamlvars.tex b/macros/luatex/latex/yamlvars/yamlvars.tex
index 552fc21988..93e690d896 100644
--- a/macros/luatex/latex/yamlvars/yamlvars.tex
+++ b/macros/luatex/latex/yamlvars/yamlvars.tex
@@ -1,5 +1,5 @@
% Kale Ewasiuk (kalekje@gmail.com)
-% 2023-07-22
+% 2023-11-25
% Copyright (C) 2021-2023 Kale Ewasiuk
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -54,6 +54,7 @@
\usepackage[overwritedefs]{yamlvars}
+\yamlvarsdebugon
\title{YAMLvars}
\subtitle{a YAML variable parser for LuaLaTeX}
@@ -80,13 +81,6 @@ or just find it easier to read document metadata from a YAML file compared to th
standard title, author, etc. commands.
\section{Package Options}
-\leavevmode\llap{\texttt{useyv}\ \ \ }By default, when you specify a YAML variable, it will be defined using \texttt{gdef}
-(only if it wasn't defined previously).
-If you use this setting, unless otherwise specified, YAML variables will be accessible under
-the \texttt{\textbackslash yv\{<var>\}} command.
-This also allows numbers and symbols in the variable names.
-Note that internally, the variables are stored in the command sequence
-\texttt{yv--<var>}.
\leavevmode\llap{\texttt{parseCLI}\ \ \ }If this option is enabled, any arguments passed to your lualatex compile
command that end in ``.yaml'' will be used, separated by a space.
@@ -105,6 +99,14 @@ will br thrown if the name exists. Alternatively, you can use the commands \cmd{
\llcmd{overwritedefs}Danger! This will allow you to \cmd{gdef} commands with YAML. Caution should be taken to not set definitions like \cmd{begin}, \cmd{section}, etc.
+\leavevmode\llap{\texttt{useyv}\ \ \ }By default, when you specify a YAML variable, it will be defined using \texttt{gdef}
+(only if it wasn't defined previously).
+If you use this setting, unless otherwise specified, YAML variables will be accessible under
+the \texttt{\textbackslash yv\{<var>\}} command.
+This also allows numbers and symbols in the variable names.
+Note that internally, the variables are stored in the command sequence
+\texttt{yv--<var>}. This option is currently under repair and will not work properly in this version.
+
\section{Dependencies}
\llcmd{Note:}This package requires the \cmd{tinyyaml} package, available on CTAN.
@@ -119,6 +121,23 @@ like
\cmd{luacode}, \cmd{luakeys}, and
\cmd{etoolbox}.
+\section{Settings}
+\cmd{\setdefYAMLvars{kv}} changes the default settings of key-vals.\\
+\cmd{\setYAMLvars*{kv}} changes the current settings from key-vals. Use \cmd{*} if you want to first restore to defaults.
+
+ The \cmd{YAMLvars.setts} lua table contains the settings, which are:\\
+\cmd{parseopts} table passed to YAML parser options (default is \cmd{{timestamps=false}}) \\
+\cmd{decstr} in the declaration YAML text, if a value is a string, how should it be treated (\cmd{xfm, dft, or prc}) \\
+\cmd{undeclared} boolean for allowing parsing of undeclared vars \\
+\cmd{overwrite} boolean for allowing overwriting of previous definitions \\
+\cmd{lowercase} boolean for auto-changing vars to lowercase \\
+\cmd{prcstring} boolean for auto-converting final value before processing (sometimes) numbers can have odd effects \\
+%\cmd{tabmidrule} type of rule for tabu \\
+\cmd{xfm} default xfm function(s) if none passed to declared key, separated by space \\
+\cmd{prc} default prc function if none passed to declared key \\
+\cmd{dft} default dft function if none passed to declared key \\
+
+
\section{Declaring variables}
A declaration file can either be parsed with the command \texttt{declareYAMLvarsFile} command,
or, if you want to do it \LaTeX, you can put the YAML code in the \texttt{declareYAMLvars} environment.