diff options
author | Norbert Preining <norbert@preining.info> | 2024-01-24 03:01:03 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-01-24 03:01:03 +0000 |
commit | 30e494c68ef358eeb09d53920dd0658dc9238f51 (patch) | |
tree | 6126efb698a9eece711552040e1057a38a1d9554 /macros/luatex/latex/lua-placeholders | |
parent | 208ecf90e1d5a239ff2a8cd506c077d194d348c0 (diff) |
CTAN sync 202401240301
Diffstat (limited to 'macros/luatex/latex/lua-placeholders')
-rw-r--r-- | macros/luatex/latex/lua-placeholders/doc/lua-placeholders-deps.bib | 6 | ||||
-rw-r--r-- | macros/luatex/latex/lua-placeholders/doc/lua-placeholders-example/example.pdf | bin | 67505 -> 67759 bytes | |||
-rw-r--r-- | macros/luatex/latex/lua-placeholders/doc/lua-placeholders-manual.pdf | bin | 256425 -> 257529 bytes | |||
-rw-r--r-- | macros/luatex/latex/lua-placeholders/doc/lua-placeholders-manual.tex | 12 | ||||
-rw-r--r-- | macros/luatex/latex/lua-placeholders/scripts/lua-placeholders-parser.lua | 21 | ||||
-rw-r--r-- | macros/luatex/latex/lua-placeholders/scripts/lua-placeholders.lua | 4 | ||||
-rw-r--r-- | macros/luatex/latex/lua-placeholders/tex/lua-placeholders.sty | 2 |
7 files changed, 31 insertions, 14 deletions
diff --git a/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-deps.bib b/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-deps.bib index 2e80c1b269..c5ecf4484c 100644 --- a/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-deps.bib +++ b/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-deps.bib @@ -1,4 +1,10 @@ +@misc{tiny, + title = {lua-tinyyaml}, + note = {Accessed: 23 January, 2024}, + howpublished = {\url{https://ctan.org/pkg/lua-tinyyaml} and \url{https://github.com/api7/lua-tinyyaml}}, +} + @misc{lyaml, title = {lyaml}, author = {Andrew Danforth}, diff --git a/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-example/example.pdf b/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-example/example.pdf Binary files differindex fcdf27afab..1b9ff4a52f 100644 --- a/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-example/example.pdf +++ b/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-example/example.pdf diff --git a/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-manual.pdf b/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-manual.pdf Binary files differindex 499978dbf0..b9bb4a0238 100644 --- a/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-manual.pdf +++ b/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-manual.pdf diff --git a/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-manual.tex b/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-manual.tex index 776ad3af5d..c618146637 100644 --- a/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-manual.tex +++ b/macros/luatex/latex/lua-placeholders/doc/lua-placeholders-manual.tex @@ -13,9 +13,10 @@ % % The Current Maintainer of this work is E. Nijenhuis. % -% This work consists of the files lua-placeholders.sty lua-placeholders-manual.pdf -% lua-placeholders.lua lua-placeholders-common.lua lua-placeholders-namespace.lua lua-placeholders-parser.lua -% and lua-placeholders-types.lua +% This work consists of the files lua-placeholders.sty +% lua-placeholders-manual.pdf lua-placeholders.lua +% lua-placeholders-common.lua lua-placeholders-namespace.lua +% lua-placeholders-parser.lua and lua-placeholders-types.lua \documentclass{ltxdoc} \usepackage[english]{babel} @@ -84,7 +85,6 @@ \begin{enumerate}[align=left] \item The package only works with Lua\LaTeX{}. \item In order for the files to be loaded, commandline option `\texttt{--shell-escape}' is required. - \item For YAML support, there needs to be a Lua setup with certain dependencies, which can be quite hard to setup on some systems. \end{enumerate} \subsection{Prerequisites} @@ -94,7 +94,7 @@ This also includes the \texttt{libYAML}\cite{libYAML} platform dependent library and optionally LuaRocks for installing \texttt{lyaml}. Another requirement is Lua, which version meets the Lua version used by Lua\TeX{}. If no \texttt{LUA\_PATH} is set, and you use LuaRocks, this package tries to call the LuaRocks executable to find the \texttt{LUA\_PATH}. - If \texttt{lyaml} can't be loaded, this package will fall back on accepting JSON files only. + If \texttt{lyaml} can't be loaded, this package will first try to fall back with \texttt{lua-tinyyaml}\cite{tiny} for lesser YAML support and secondly fall back on accepting JSON files only. \clearpage \section{Usage} @@ -210,7 +210,7 @@ The source file \texttt{example.tex} is a perfect demonstration of all macros in action. It shows perfectly what happens when there's a \meta{payload} file loaded and when not. - The result of this example \attachfile[icon=Paperclip,description={ELPI Example v\gitversion}]{lua-placeholders-example/example.pdf} is attached in the digital version of this document. + The result of this example \attachfile[icon=Paperclip,description={Lua Parameters Example v\gitversion}]{lua-placeholders-example/example.pdf} is attached in the digital version of this document. \lstinputlisting[language={[LaTeX]TeX},frame=single,caption={\ttfamily example.tex},captionpos=t,numbers=left,keywordsprefix={\\},firstnumber=20,firstline=20,columns=fullflexible]{lua-placeholders-example/example.tex} \end{document} diff --git a/macros/luatex/latex/lua-placeholders/scripts/lua-placeholders-parser.lua b/macros/luatex/latex/lua-placeholders/scripts/lua-placeholders-parser.lua index 1fa43227a4..3583c09a28 100644 --- a/macros/luatex/latex/lua-placeholders/scripts/lua-placeholders-parser.lua +++ b/macros/luatex/latex/lua-placeholders/scripts/lua-placeholders-parser.lua @@ -22,6 +22,12 @@ local LUA_VERSION = string.sub(_VERSION, 5, -1) yaml_supported = false +-- Check for tiny yaml as YAML fallback option +local tiny_found, tiny = pcall(require,'tinyyaml') +if tiny_found then + texio.write_nl('Found fallback support for YAML (tiny yaml)') +end + -- Check if LUA_PATH is set local current_path = os.getenv('LUA_PATH') if current_path then @@ -44,6 +50,9 @@ else texio.write_nl('Info: Setting LUA_CPATH from LuaRocks', lua_cpath) package.cpath = lua_cpath end + elseif tiny_found then + texio.write_nl('Warning: could\'t find LuaRocks installation') + texio.write_nl('Info: falling back to tiny yaml implementation') else texio.write_nl('Error: couldn\'t find LuaRocks installation') texio.write_nl("Info: LUA PATH:\n\t" .. string.gsub(package.path, ';', '\n\t') .. '\n\n') @@ -59,12 +68,12 @@ require('lualibs') -- Require YAML configuration files -- Make sure to have the apt package lua-yaml installed -local status, yaml = pcall(require, 'lyaml') -if status then +local lyaml_found, lyaml = pcall(require, 'lyaml') +if lyaml_found or tiny_found then yaml_supported = true else texio.write_nl('Warning: No YAML support.') - texio.write_nl(yaml) + texio.write_nl(lyaml) texio.write_nl('Info: Falling back to JSON.') end @@ -79,8 +88,10 @@ return function(filename) if ext == 'json' then return utilities.json.tolua(raw) else - if yaml_supported then - return yaml.load(raw) + if lyaml_found then + return lyaml.load(raw) + elseif tiny_found then + return tiny.parse(raw) else tex.error('Error: no YAML support!') end diff --git a/macros/luatex/latex/lua-placeholders/scripts/lua-placeholders.lua b/macros/luatex/latex/lua-placeholders/scripts/lua-placeholders.lua index 255b4d1f26..181676679c 100644 --- a/macros/luatex/latex/lua-placeholders/scripts/lua-placeholders.lua +++ b/macros/luatex/latex/lua-placeholders/scripts/lua-placeholders.lua @@ -23,8 +23,8 @@ if not modules then end modules.lua_placeholders = { - version = "0.1.0", - date = "2024/01/12", + version = "1.0.0", + date = "2024/01/23", comment = 'Extended LaTeX Parameter Interface — for specifying and inserting document parameters', author = 'Erik Nijenhuis', license = 'free' diff --git a/macros/luatex/latex/lua-placeholders/tex/lua-placeholders.sty b/macros/luatex/latex/lua-placeholders/tex/lua-placeholders.sty index 9a2c247962..e11b950f5a 100644 --- a/macros/luatex/latex/lua-placeholders/tex/lua-placeholders.sty +++ b/macros/luatex/latex/lua-placeholders/tex/lua-placeholders.sty @@ -19,7 +19,7 @@ % lua-placeholders-parser.lua and lua-placeholders-types.lua \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lua-placeholders}[2024/01/12 Extended LaTeX Paramter Interface Package] +\ProvidesPackage{lua-placeholders}[2024/01/23 1.0.0 Extended LaTeX Paramter Interface Package] \RequirePackage{ifthen} \RequirePackage{luapackageloader} |