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 | |
parent | 926e0e5dbdcefe4dd025ae534fd87a5fbc50b826 (diff) |
yamlvars (23jul23)
git-svn-id: svn://tug.org/texlive/trunk@67715 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/lualatex/yamlvars/README.md | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/yamlvars/yamlvars.pdf | bin | 82561 -> 82984 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/yamlvars/yamlvars.tex | 12 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.lua | 13 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.sty | 27 |
5 files changed, 25 insertions, 31 deletions
diff --git a/Master/texmf-dist/doc/lualatex/yamlvars/README.md b/Master/texmf-dist/doc/lualatex/yamlvars/README.md index 031de6c53a7..509e5366c97 100644 --- a/Master/texmf-dist/doc/lualatex/yamlvars/README.md +++ b/Master/texmf-dist/doc/lualatex/yamlvars/README.md @@ -1,13 +1,13 @@ # YAMLvars -- parse a YAML document and create definitions in LaTeX This LuaLaTeX package provides a YAML parser and some functions to declare and define LaTeX definitions using YAML files. -It uses the [`markdown-tinyyaml`](https://github.com/api7/lua-tinyyaml) parser that is shipped with the [`markdown`](https://ctan.org/pkg/markdown) package. +It uses the [`tinyyaml`](https://ctan.org/pkg/lua-tinyyaml) parser. # License -Copyright (C) 2021-2022 Kale Ewasiuk +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 diff --git a/Master/texmf-dist/doc/lualatex/yamlvars/yamlvars.pdf b/Master/texmf-dist/doc/lualatex/yamlvars/yamlvars.pdf Binary files differindex a91095c8327..4719837d3c8 100644 --- a/Master/texmf-dist/doc/lualatex/yamlvars/yamlvars.pdf +++ b/Master/texmf-dist/doc/lualatex/yamlvars/yamlvars.pdf diff --git a/Master/texmf-dist/doc/lualatex/yamlvars/yamlvars.tex b/Master/texmf-dist/doc/lualatex/yamlvars/yamlvars.tex index cd6888cea83..552fc21988d 100644 --- a/Master/texmf-dist/doc/lualatex/yamlvars/yamlvars.tex +++ b/Master/texmf-dist/doc/lualatex/yamlvars/yamlvars.tex @@ -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 @@ -53,7 +53,6 @@ \date{\today} -\usepackage[pl,extrasglobals]{penlight} \usepackage[overwritedefs]{yamlvars} \title{YAMLvars} \subtitle{a YAML variable parser for LuaLaTeX} @@ -115,10 +114,9 @@ The YAML specification: \url{https://yaml.org/spec/}\\ Many of the ``transform'' and ``processing'' functions built-in to this package rely on other packages, like -\texttt{hyperref}, for example, but it is not loaded, and this package will only load -\cmd{penlight}, -\cmd{luacode}, -\cmd{xspace}, and +\texttt{hyperref}, or \texttt{xspace} for example, but they are not loaded, and this package will only load +\cmd{penlightplus}, +\cmd{luacode}, \cmd{luakeys}, and \cmd{etoolbox}. \section{Declaring variables} 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() } } |