texlive[69566] Master/texmf-dist: lua-placeholders (23jan24)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 23 22:25:54 CET 2024


Revision: 69566
          https://tug.org/svn/texlive?view=revision&revision=69566
Author:   karl
Date:     2024-01-23 22:25:54 +0100 (Tue, 23 Jan 2024)
Log Message:
-----------
lua-placeholders (23jan24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-deps.bib
    trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-example/example.pdf
    trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.pdf
    trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.tex
    trunk/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-parser.lua
    trunk/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders.lua
    trunk/Master/texmf-dist/tex/lualatex/lua-placeholders/lua-placeholders.sty

Modified: trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-deps.bib
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-deps.bib	2024-01-23 21:25:41 UTC (rev 69565)
+++ trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-deps.bib	2024-01-23 21:25:54 UTC (rev 69566)
@@ -1,4 +1,10 @@
 
+ at 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},

Modified: trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-example/example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.tex	2024-01-23 21:25:41 UTC (rev 69565)
+++ trunk/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.tex	2024-01-23 21:25:54 UTC (rev 69566)
@@ -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}

Modified: trunk/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-parser.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-parser.lua	2024-01-23 21:25:41 UTC (rev 69565)
+++ trunk/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-parser.lua	2024-01-23 21:25:54 UTC (rev 69566)
@@ -22,6 +22,12 @@
 
 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 @@
                 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 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 @@
     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

Modified: trunk/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders.lua	2024-01-23 21:25:41 UTC (rev 69565)
+++ trunk/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders.lua	2024-01-23 21:25:54 UTC (rev 69566)
@@ -23,8 +23,8 @@
 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'

Modified: trunk/Master/texmf-dist/tex/lualatex/lua-placeholders/lua-placeholders.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/lua-placeholders/lua-placeholders.sty	2024-01-23 21:25:41 UTC (rev 69565)
+++ trunk/Master/texmf-dist/tex/lualatex/lua-placeholders/lua-placeholders.sty	2024-01-23 21:25:54 UTC (rev 69566)
@@ -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}



More information about the tex-live-commits mailing list.