texlive[70055] branches/branch2023.final/Master/texmf-dist:

commits+karl at tug.org commits+karl at tug.org
Wed Feb 21 22:18:57 CET 2024


Revision: 70055
          https://tug.org/svn/texlive?view=revision&revision=70055
Author:   karl
Date:     2024-02-21 22:18:57 +0100 (Wed, 21 Feb 2024)
Log Message:
-----------
lua-placeholders (branch) (21feb24)

Modified Paths:
--------------
    branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/README.md
    branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-example/example.pdf
    branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-example/example.tex
    branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.pdf
    branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.tex
    branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-parser.lua
    branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-types.lua
    branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders.lua
    branches/branch2023.final/Master/texmf-dist/tex/lualatex/lua-placeholders/lua-placeholders.sty

Modified: branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/README.md
===================================================================
--- branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/README.md	2024-02-21 21:18:36 UTC (rev 70054)
+++ branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/README.md	2024-02-21 21:18:57 UTC (rev 70055)
@@ -1,4 +1,5 @@
 # Lua(TeX) Placeholders
+![CTAN Version](https://img.shields.io/ctan/v/lua-placeholders)
 
 A LaTeX package for specifying and inserting document placeholders with JSON or YAML formats.
 

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

Modified: branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-example/example.tex
===================================================================
--- branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-example/example.tex	2024-02-21 21:18:36 UTC (rev 70054)
+++ branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-example/example.tex	2024-02-21 21:18:57 UTC (rev 70055)
@@ -19,7 +19,7 @@
 
 \documentclass{article}
 \usepackage{gitinfo-lua}
-\usepackage{../../tex/lua-placeholders}
+\usepackage{lua-placeholders}
 \usepackage{listings}
 \usepackage{amsmath}
 \usepackage{calc}

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

Modified: branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.tex
===================================================================
--- branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.tex	2024-02-21 21:18:36 UTC (rev 70054)
+++ branches/branch2023.final/Master/texmf-dist/doc/lualatex/lua-placeholders/lua-placeholders-manual.tex	2024-02-21 21:18:57 UTC (rev 70055)
@@ -215,7 +215,7 @@
 
     \clearpage
 
-    \section{Changelog}
+    \section{Change Log}
     \newcommand\commitline[3]{\item #1\ifx&#3&%
     \else\\[1em]
     #3\fi\\\hspace*{1em} — \printdate{#2}}

Modified: branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-parser.lua
===================================================================
--- branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-parser.lua	2024-02-21 21:18:36 UTC (rev 70054)
+++ branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-parser.lua	2024-02-21 21:18:57 UTC (rev 70055)
@@ -32,7 +32,7 @@
 local current_path = os.getenv('LUA_PATH')
 if current_path then
     texio.write_nl('Info: LUA path setup up correctly. Great job!')
-else
+elseif not tiny_found then
     -- Set the LUA_PATH and LUA_CPATH using 'luarocks -lua-version <LuaLaTeX version> path'
     texio.write_nl('Warning: No LUA_PATH set. Looking for LuaRocks installation...')
     local handle = io.popen('luarocks --lua-version ' .. LUA_VERSION .. ' path')
@@ -60,6 +60,8 @@
     else
         tex.error('Error: could not open a shell. Is shell-escape turned on?')
     end
+else
+    texio.write_nl('Warning: no LUA_PATH set.')
 end
 texio.write_nl('\n')
 

Modified: branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-types.lua
===================================================================
--- branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-types.lua	2024-02-21 21:18:36 UTC (rev 70054)
+++ branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders-types.lua	2024-02-21 21:18:57 UTC (rev 70055)
@@ -104,7 +104,8 @@
 function str_param:new(key, _o)
     local o = {
         key = key,
-        placeholder = _o.placeholder
+        placeholder = _o.placeholder,
+        default = _o.default
     }
     setmetatable(o, self)
     self.__index = self
@@ -111,6 +112,14 @@
     return o
 end
 
+function str_param:val()
+    local value = self:raw_val()
+    if value then
+        local formatted, _ = string.gsub(value, '\n', ' ')
+        return formatted
+    end
+end
+
 number_param = base_param:new{
     type = 'number'
 }
@@ -127,7 +136,7 @@
 end
 
 function number_param:raw_val()
-    if self.value or self.default then
+    if self.value ~= nil or self.default ~= nil then
         return self.value or self.default
     end
 end
@@ -134,7 +143,7 @@
 
 function number_param:val()
     local val = self:raw_val()
-    if val then
+    if val ~= nil then
         if token.is_defined('numprint') then
             return '\\numprint{' .. val .. '}'
         else

Modified: branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders.lua
===================================================================
--- branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders.lua	2024-02-21 21:18:36 UTC (rev 70054)
+++ branches/branch2023.final/Master/texmf-dist/scripts/lua-placeholders/lua-placeholders.lua	2024-02-21 21:18:57 UTC (rev 70055)
@@ -23,9 +23,9 @@
 end
 
 modules.lua_placeholders = {
-    version = "1.0.1",
-    date = "2024/02/12",
-    comment = 'Extended LaTeX Parameter Interface — for specifying and inserting document parameters',
+    version = "1.0.2",
+    date = "2024/02/21",
+    comment = 'Lua Placeholders — for specifying and inserting document parameters',
     author = 'Erik Nijenhuis',
     license = 'free'
 }
@@ -200,7 +200,11 @@
                 texio.write_nl("Warning: no values set for " .. param.key)
                 local format = row_content
                 for col_key, col in pairs(param.columns) do
-                    format = format:gsub('\\' .. col_key, '{\\paramplaceholder{' .. (col.placeholder or col_key) .. '}}')
+                    if col.default ~= nil then
+                        format = format:gsub('\\' .. col_key, col:val())
+                    else
+                        format = format:gsub('\\' .. col_key, '{\\paramplaceholder{' .. (col.placeholder or col_key) .. '}}')
+                    end
                 end
                 tex.print(format)
             else

Modified: branches/branch2023.final/Master/texmf-dist/tex/lualatex/lua-placeholders/lua-placeholders.sty
===================================================================
--- branches/branch2023.final/Master/texmf-dist/tex/lualatex/lua-placeholders/lua-placeholders.sty	2024-02-21 21:18:36 UTC (rev 70054)
+++ branches/branch2023.final/Master/texmf-dist/tex/lualatex/lua-placeholders/lua-placeholders.sty	2024-02-21 21:18:57 UTC (rev 70055)
@@ -19,7 +19,7 @@
 % lua-placeholders-parser.lua and lua-placeholders-types.lua
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lua-placeholders}[2024/02/12 1.0.1 Extended LaTeX Paramter Interface Package]
+\ProvidesPackage{lua-placeholders}[2024/02/21 1.0.2 Lua Placeholders Package]
 
 \RequirePackage{ifthen}
 \RequirePackage{luapackageloader}



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