From 3832dde0b3e18bb635d9c7f0c5582e0c27e33849 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 23 Dec 2022 21:05:14 +0000 Subject: luakeys (23dec22) git-svn-id: svn://tug.org/texlive/trunk@65342 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/luatex/luakeys/luakeys-doc.pdf | Bin 395011 -> 398632 bytes .../texmf-dist/doc/luatex/luakeys/luakeys-doc.tex | 64 +++++++++++++++++++-- .../tex/luatex/luakeys/luakeys-debug.sty | 2 +- Master/texmf-dist/tex/luatex/luakeys/luakeys.lua | 12 +++- Master/texmf-dist/tex/luatex/luakeys/luakeys.sty | 2 +- 5 files changed, 71 insertions(+), 9 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.pdf b/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.pdf index a44a16094eb..ff012a46c63 100644 Binary files a/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.pdf and b/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.pdf differ diff --git a/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.tex b/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.tex index 83c708da941..90041ec5816 100644 --- a/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.tex +++ b/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.tex @@ -60,7 +60,7 @@ The default value of the option “\texttt{#1}” is: \href{https://github.com/Josef-Friedrich/luakeys} {github.com/Josef-Friedrich/luakeys}% } -\date{0.10.0 from 2022/12/16} +\date{0.11.0 from 2022/12/23} \maketitle @@ -273,8 +273,9 @@ It does the same as the Lua\LaTeX{} wrapper and loads the Lua module % Das Lua-Modul exportiert diese Funktionen und Tabellen: The Lua module exports this functions and tables: -\InputLua[firstline=3,lastline=13]{export.lua} +\InputLua[firstline=3,lastline=15]{export.lua} +\noindent % Diese Dokumentation stellt nur die öffentlichen Funktionen und % Tabellen vor. This documentation presents only the public functions and tables. @@ -333,6 +334,34 @@ The raw result of the Lpeg grammar parser. \\ % %% +\subsection{Function “\texttt{get_private_instance(): table}”} +\label{function:get-private-instance} + +% Über die Tabelle \lua{opts} können die Standardoptionen global +% geändert werden. +The default options can be changed globally via the \lua{opts} table +(\ref{table-opts}). +% Um zu verhindern, dass andere Module die Standardeinstellungen +% ändern, kann mit Hilfe der Funktion \lua{get_private_instance()} eine neue +% Instanz des Moduls \lua{luakeys} erzeugt werden. +To prevent another modules from changing the default settings, a new +instance of the \lua{luakeys} module can be created using the +\lua{get_private_instance()} function. + +\InputLua[firstline=3,lastline=4]{functions/get-private-instance.lua} + +\noindent +% Die Funktion \lua{require()} gibt standardmäßig beim mehrmaligen +% Aufruf immer die gleiche Tabelle zurück. +The \lua{require()} function always returns the same table +when called multiple times. + +\InputLua[firstline=14,lastline=17]{functions/get-private-instance.lua} + +%% +% +%% + \subsection{Function “\texttt{parse(kv_string, opts): result, unknown, raw}”} \label{parse} @@ -355,20 +384,37 @@ In plain \TeX: \subsection{Options to configure the \texttt{parse} function} \noindent -The \lua{parse} function can be called with an options table. This -options are supported: \catcode`_=12 +% Die Funktion \lua{parse} kann mit einer Optionstabelle aufgerufen +% werden. +The \lua{parse} function can be called with an options table. +% Diese Optionen werden unterstützt: +This options are supported: \catcode`_=12 \directlua{luakeys.print_names('opts')} \InputLua[firstline=5,lastline=94]{opts/all-opts.lua} +\subsection{Table “\texttt{opts}”} +\label{table-opts} + \noindent +% Die Optionen können auch global über die exportierte Tabelle +% \lua{opts} gesetzt werden: The options can also be set globally using the exported table -|opts|: +\lua{opts}: \InputLua[firstline=4,lastline=4]{opts/exported-default-opts.lua} \InputLua[firstline=10,lastline=11]{opts/exported-default-opts.lua} +\noindent +% Damit es zu keinen Wechselwirkungen mit anderen Paketen kommt, die auch +% |luakeys| verwenden und die Optionen global setzen, ist es anzuraten, +% die Funktion \lua{get_private_instance()} zum Laden das Paket verwenden. +To avoid interactions with other packages that also use |luakeys| and +set the options globally, it is recommended to use the +\lua{get_private_instance()} function +(\ref{function:get-private-instance}) to load the package. + %% % %% @@ -888,6 +934,8 @@ key-value pair is then stored under this key. \InputLua[firstline=4,lastline=16]{functions/define.lua} \noindent +% Bei verschachtelten Definitionen können nur die letzten beiden +% Möglichkeiten zur Angabe der Schlüsselnamen verwendet werden. For nested definitions, only the last two ways of specifying the key names can be used. @@ -2029,7 +2077,7 @@ An example of how to use the command in \LaTeX: “quotation_end”. * Extend the documentation about the option “format_keys”. } -\changes{0.10.0}{2022/12/16}{ +\changes{0.9.0}{2022/11/21}{ * The definition attibute “pick” accepts a new data type: “any”. * The attribute value “true” for the attribute “pick” is deprecated. * The attribute “pick” accepts now multiple data types specified in @@ -2042,6 +2090,10 @@ An example of how to use the command in \LaTeX: * Add new options to specify which strings are recognized as Boolean values. } +\changes{0.11.0}{2022/12/23}{ +* Add a new function called “get_private_instance()” to load a private + version of the luakeys module. +} \pagebreak \PrintChanges diff --git a/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty b/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty index 6d60271dd88..ceefd6d0e2b 100644 --- a/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty +++ b/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty @@ -17,6 +17,6 @@ % luakeys-debug.sty and luakeys-debug.tex. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luakeys-debug}[2022/12/16 0.10.0 Debug package for luakeys.] +\ProvidesPackage{luakeys-debug}[2022/12/23 0.11.0 Debug package for luakeys.] \input luakeys-debug.tex diff --git a/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua b/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua index 333b3573084..7e86d729cd7 100644 --- a/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua +++ b/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua @@ -1270,7 +1270,17 @@ local result_store = {} -- @section local export = { - version = { 0, 10, 0 }, + version = { 0, 11, 0 }, + + ---Get a new instance of the luakeys module. + --- + ---@return table # A new instance of the luakeys module. + get_private_instance = function() + package.loaded.luakeys = nil + local luakeys = require('luakeys') + package.loaded.luakeys = nil + return luakeys + end, namespace = namespace, diff --git a/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty b/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty index c76025c114b..8cb59cf5ef5 100644 --- a/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty +++ b/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty @@ -17,5 +17,5 @@ % luakeys-debug.sty and luakeys-debug.tex. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luakeys}[2022/12/16 0.10.0 Parsing key-value options using Lua.] +\ProvidesPackage{luakeys}[2022/12/23 0.11.0 Parsing key-value options using Lua.] \directlua{luakeys = require('luakeys')} -- cgit v1.2.3