diff options
Diffstat (limited to 'macros/luatex/generic/luakeys/README.md')
-rw-r--r-- | macros/luatex/generic/luakeys/README.md | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/macros/luatex/generic/luakeys/README.md b/macros/luatex/generic/luakeys/README.md index 2779de92e8..b4a0ddb8a8 100644 --- a/macros/luatex/generic/luakeys/README.md +++ b/macros/luatex/generic/luakeys/README.md @@ -14,7 +14,7 @@ mechanism should be pretty robust. ## License -Copyright 2021-2022 Josef Friedrich +Copyright 2021-2023 Josef Friedrich This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c @@ -48,11 +48,16 @@ local defs = { -- Only values listed in the array table are allowed. choices = { 'one', 'two', 'three' }, - -- Possible data types: boolean, dimension, integer, number, string + -- Possible data types: + -- any, boolean, dimension, integer, number, string, list data_type = 'string', + -- To provide a default value for each naked key individually. default = true, + -- Can serve as a comment. + description = 'Describe your key-value pair.', + -- The key belongs to a mutually exclusive group of keys. exclusive_group = 'name', @@ -64,11 +69,27 @@ local defs = { -- The name of the key, can be omitted name = 'key', + + -- Convert opposite (naked) keys + -- into a boolean value and store this boolean under a target key: + -- show -> opposite_keys = true + -- hide -> opposite_keys = false + -- Short form: opposite_keys = { 'show', 'hide' } opposite_keys = { [true] = 'show', [false] = 'hide' }, + + -- Pick a value by its data type: + -- 'any', 'string', 'number', 'dimension', 'integer', 'boolean'. + pick = false, -- ’false’ disables the picking. + + -- A function whose return value is passed to the key. process = function(value, input, result, unknown) return value end, + + -- To enforce that a key must be specified. required = true, + + -- To build nested key-value pair definitions. sub_keys = { key_level_2 = { } }, } } @@ -78,6 +99,9 @@ local defs = { ```lua local opts = { + -- Result table that is filled with each call of the parse function. + accumulated_result = accumulated_result, + -- Configure the delimiter that assigns a value to a key. assignment_operator = '=', @@ -176,9 +200,6 @@ local result = luakeys.parse('one,two,three', opts) [Lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) extension in Visual Studio Code. This extension understands the modified [EmmyLua annotations](https://github.com/sumneko/lua-language-server/wiki/Annotations). -The Lua source code documentation is generated with -[LDoc](https://stevedonovan.github.io/ldoc/manual/doc.md.html). - The Lua code is automatically formatted with the help of the [LuaFormatter](https://github.com/Koihik/LuaFormatter). @@ -212,7 +233,7 @@ This project uses [semantic versioning](https://semver.org). Update version in: -* luakeys-doc.tex +* documentation.tex * luakeys-debug.sty * luakeys.sty * luakeys.lua |