diff options
author | Karl Berry <karl@freefriends.org> | 2023-07-23 20:46:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-07-23 20:46:46 +0000 |
commit | f877d675254b93251f32484b55e086b9bda798cf (patch) | |
tree | da6b2d173250778cd628aa76c20c40731faf1382 /Master/texmf-dist/tex | |
parent | 926e0e5dbdcefe4dd025ae534fd87a5fbc50b826 (diff) |
yamlvars (23jul23)
git-svn-id: svn://tug.org/texlive/trunk@67715 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.lua | 13 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.sty | 27 |
2 files changed, 18 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.lua b/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.lua index 1d0da9a3126..479880a3e82 100644 --- a/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.lua +++ b/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.lua @@ -1,6 +1,6 @@ --% Kale Ewasiuk (kalekje@gmail.com) ---% 2023-07-18 ---% Copyright (C) 2021-2022 Kale Ewasiuk +--% 2023-07-22 +--% Copyright (C) 2021-2023 Kale Ewasiuk --% --% Permission is hereby granted, free of charge, to any person obtaining a copy --% of this software and associated documentation files (the "Software"), to deal @@ -28,12 +28,9 @@ YAMLvars = {} -- self table YAMLvars.yaml = require'tinyyaml' -- note: YAMLvars.sty will have checked existence of this already -local luakeys = require'luakeys'() -- note: YAMLvars.sty will have checked existence of this already +YAMLvars.luakeys = require'luakeys'() -- note: YAMLvars.sty will have checked existence of this already -local pl = _G['penlight'] or _G['pl'] -- penlight for this namespace is pl -if (__PL_EXTRAS__ == nil) or (__PENLIGHT__ == nil) then - tex.sprint('\\PackageError{yamlvars}{penlight package with extras (or extrasnoglobals) option must be loaded before this package}{}') -end +local pl = penlight -- UI tables to extend functionality YAMLvars.xfm = {} @@ -75,7 +72,7 @@ function YAMLvars.updatesettskv(kv, res, def) YAMLvars.setts2default() end - local kv = luakeys.parse(kv) + local kv = YAMLvars.luakeys.parse(kv) if type(kv.xfm) == 'string' then kv.xfm = pl.stringx.split(kv.xfm) end diff --git a/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.sty b/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.sty index 20ea6d33d18..733ee80b69d 100644 --- a/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.sty +++ b/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.sty @@ -1,6 +1,6 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2023-07-18 -% Copyright (C) 2021-2022 Kale Ewasiuk +% 2023-07-22 +% Copyright (C) 2021-2023 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy % of this software and associated documentation files (the "Software"), to deal @@ -25,13 +25,12 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{yamlvars}[2023-07-18] +\ProvidesPackage{yamlvars}[2023-07-22] \RequirePackage{luacode} -\RequirePackage{xspace} \RequirePackage{etoolbox} \RequirePackage{luakeys} -\RequirePackage{penlight} % no option passed here, but extras must be used, error will be thrown if not +\RequirePackage{penlightplus} % no option passed here, but extras must be used, error will be thrown if not %\IfFileExists{tinyyaml.lua}{}{\PackageError{yamlvars}{This package requires installation of the 'tinyyaml' package, please install it and try again}{}} @@ -94,19 +93,19 @@ YAMLvars.xfmDefault = {'lb2nl','addxspace'} }} -\newenvironment{declareYAMLvars}{\luadirect{_G[__PENLIGHT__].tex.startrecording()}}{\luadirect{_G[__PENLIGHT__].tex.stoprecording()} - \luadirect{YAMLvars.declareYAMLvarsStr(_G[__PENLIGHT__].tex.recordedbuf)} +\newenvironment{declareYAMLvars}{\luadirect{penlight.tex.startrecording()}}{\luadirect{penlight.tex.stoprecording()} + \luadirect{YAMLvars.declareYAMLvarsStr(penlight.tex.recordedbuf)} } \NewDocumentEnvironment{parseYAMLvars}{}% {\luadirect{ - _G[__PENLIGHT__].tex.startrecording() + penlight.tex.startrecording() }}% {\luadirect{ - _G[__PENLIGHT__].tex.stoprecording() + penlight.tex.stoprecording() }} -\AfterEndEnvironment{parseYAMLvars}{\luadirect{YAMLvars.parseYAMLvarsStr(_G[__PENLIGHT__].tex.recordedbuf)}} +\AfterEndEnvironment{parseYAMLvars}{\luadirect{YAMLvars.parseYAMLvarsStr(penlight.tex.recordedbuf)}} % necessary hack to get rohead and lohead to work.. % .. https://tex.stackexchange.com/questions/637018/setting-koma-heading-within-lua/637021?noredirect=1#comment1587387_637021 @@ -116,10 +115,10 @@ YAMLvars.xfmDefault = {'lb2nl','addxspace'} -\newenvironment{parseYAMLpdfdata}{\luadirect{_G[__PENLIGHT__].tex.startrecording()}}{ - \luadirect{_G[__PENLIGHT__].tex.stoprecording() - YAMLvars.yaml2PDFmetadata(_G[__PENLIGHT__].tex.recordedbuf) - _G[__PENLIGHT__].tex.writePDFmetadata() +\newenvironment{parseYAMLpdfdata}{\luadirect{penlight.tex.startrecording()}}{ + \luadirect{penlight.tex.stoprecording() + YAMLvars.yaml2PDFmetadata(penlight.tex.recordedbuf) + penlight.tex.writePDFmetadata() } } |