summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/yamlvars/yamlvars.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/latex/yamlvars/yamlvars.sty')
-rw-r--r--macros/luatex/latex/yamlvars/yamlvars.sty15
1 files changed, 9 insertions, 6 deletions
diff --git a/macros/luatex/latex/yamlvars/yamlvars.sty b/macros/luatex/latex/yamlvars/yamlvars.sty
index 733ee80b69..bd0643ec57 100644
--- a/macros/luatex/latex/yamlvars/yamlvars.sty
+++ b/macros/luatex/latex/yamlvars/yamlvars.sty
@@ -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
@@ -25,7 +25,7 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{yamlvars}[2023-07-22]
+\ProvidesPackage{yamlvars}[2023-11-25]
\RequirePackage{luacode}
\RequirePackage{etoolbox}
@@ -38,7 +38,9 @@
\luadirect{YAMLvars = require('YAMLvars')}
\DeclareOption{useyv}{
- \gdef\yv#1{\csname yv--#1\endcsname}
+ \newcommand\yv{}
+ \gdef\yv#1{\csname yv--#1\endcsname} % todo not working... why??
+% \NewDocumentCommand{\yv}{m}{\luadirect{tex.sprint(tostring(token.get_macro('yv--'..\luastring{#1})))}}
\luadirect{YAMLvars.setts.prc = 'yvdef'}
\luadirect{YAMLvars.settsdefault.prc = 'yvdef'}
}
@@ -58,7 +60,8 @@
-%% todo delete below
+\newcommand{\yamlvarsdebugon}{\luadirect{YAMLvars.debug = true}}
+\newcommand{\yamlvarsdebugoff}{\luadirect{YAMLvars.debug = false}}
\newcommand{\lowercasevarYVon}{\luadirect{YAMLvars.lowvasevarall = true}}
\newcommand{\lowercasevarYVoff}{\luadirect{YAMLvars.lowvasevarall = false}}
\newcommand{\AllowUndeclaredYV}{\luadirect{YAMLvars.setts.undeclared = true}}
@@ -130,8 +133,8 @@ YAMLvars.xfmDefault = {'lb2nl','addxspace'}
}}
\NewDocumentCommand{\setdefYAMLvars}{ m }{\luadirect{
- YAMLvars.updatesettskv(pl.tex._xFalse, \luastring{#1}, true)
-}}
+ YAMLvars.updatesettskv(\luastring{#1}, pl.tex._xFalse, true)
+}} % set the default settings
% \IfBooleanTF{#1}{\luadirect{YAMLvars.setts = pl.tablex.deepcopy(YAMLvars.settsdefault)}}{} % if * return to default first
% \luadirect{pl.tablex.update(YAMLvars.setts, luakeys.parse(\luastring{#2}))}