diff options
author | Norbert Preining <norbert@preining.info> | 2022-12-24 03:01:20 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-12-24 03:01:20 +0000 |
commit | da0bd16b0ba9d42d044af47137003788f0b7f773 (patch) | |
tree | c7681ad6dfc80d15e6439d6e981c48046acee3f8 /macros/luatex/generic/luakeys | |
parent | b2b552bfe4933283e7d61d721bea40b0dd2bb9fb (diff) |
CTAN sync 202212240301
Diffstat (limited to 'macros/luatex/generic/luakeys')
-rw-r--r-- | macros/luatex/generic/luakeys/luakeys-debug.sty | 2 | ||||
-rw-r--r-- | macros/luatex/generic/luakeys/luakeys-doc.pdf | bin | 395011 -> 398632 bytes | |||
-rw-r--r-- | macros/luatex/generic/luakeys/luakeys-doc.tex | 64 | ||||
-rw-r--r-- | macros/luatex/generic/luakeys/luakeys.lua | 12 | ||||
-rw-r--r-- | macros/luatex/generic/luakeys/luakeys.sty | 2 |
5 files changed, 71 insertions, 9 deletions
diff --git a/macros/luatex/generic/luakeys/luakeys-debug.sty b/macros/luatex/generic/luakeys/luakeys-debug.sty index 6d60271dd8..ceefd6d0e2 100644 --- a/macros/luatex/generic/luakeys/luakeys-debug.sty +++ b/macros/luatex/generic/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/macros/luatex/generic/luakeys/luakeys-doc.pdf b/macros/luatex/generic/luakeys/luakeys-doc.pdf Binary files differindex a44a16094e..ff012a46c6 100644 --- a/macros/luatex/generic/luakeys/luakeys-doc.pdf +++ b/macros/luatex/generic/luakeys/luakeys-doc.pdf diff --git a/macros/luatex/generic/luakeys/luakeys-doc.tex b/macros/luatex/generic/luakeys/luakeys-doc.tex index 83c708da94..90041ec581 100644 --- a/macros/luatex/generic/luakeys/luakeys-doc.tex +++ b/macros/luatex/generic/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/macros/luatex/generic/luakeys/luakeys.lua b/macros/luatex/generic/luakeys/luakeys.lua index 333b357308..7e86d729cd 100644 --- a/macros/luatex/generic/luakeys/luakeys.lua +++ b/macros/luatex/generic/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/macros/luatex/generic/luakeys/luakeys.sty b/macros/luatex/generic/luakeys/luakeys.sty index c76025c114..8cb59cf5ef 100644 --- a/macros/luatex/generic/luakeys/luakeys.sty +++ b/macros/luatex/generic/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')} |