diff options
Diffstat (limited to 'macros/luatex/generic/luakeys/luakeys-doc.tex')
-rw-r--r-- | macros/luatex/generic/luakeys/luakeys-doc.tex | 64 |
1 files changed, 58 insertions, 6 deletions
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 |