From 73a6e37c424ed6203053c24c644764b47200a1b6 Mon Sep 17 00:00:00 2001 From: haithium <128622475+haithium@users.noreply.github.com> Date: Tue, 24 Feb 2026 00:04:50 +0000 Subject: [PATCH] chore(docs): auto-generate docs --- docs/src/modules/is.md | 6 ++++-- docs/src/modules/list.md | 26 +++++++++++++++++++------- docs/src/modules/str.md | 26 ++++++++++++++++++-------- docs/src/modules/tbl.md | 14 ++++++++++---- docs/src/modules/utils.md | 6 ++++-- 5 files changed, 55 insertions(+), 23 deletions(-) diff --git a/docs/src/modules/is.md b/docs/src/modules/is.md index cfd5dd7..5e5f8ea 100644 --- a/docs/src/modules/is.md +++ b/docs/src/modules/is.md @@ -16,8 +16,10 @@ ok = is("hello", "string") --> true ok = is.table({}) --> true ``` -> [!NOTE] Function names exist in both lowercase and capitalized forms, and `is` -> is also callable as `is(v, tp)`. +> [!NOTE] +> +> Function names exist in both lowercase and capitalized forms, and `is` is also +> callable as `is(v, tp)`. > > ```lua > is.table({}) --> true diff --git a/docs/src/modules/list.md b/docs/src/modules/list.md index c02d2a5..54c68dc 100644 --- a/docs/src/modules/list.md +++ b/docs/src/modules/list.md @@ -108,7 +108,9 @@ is_even = function(v) return v % 2 == 0 end ok = List({ 2, 4 }):all(is_even) --> true ``` -> [!NOTE] Empty lists return `true`. +> [!NOTE] +> +> Empty lists return `true`. #### `any` @@ -275,8 +277,10 @@ Return the number of elements in the list. n = List({ "a", "b", "c" }):len() --> 3 ``` -> [!NOTE] Uses Lua's `#` operator, so length is reliable for contiguous -> array-like lists. +> [!NOTE] +> +> Uses Lua's `#` operator, so length is reliable for contiguous array-like +> lists. ### Access @@ -363,7 +367,9 @@ i = List({ "a", "b", "a", "c" }):intersection({ "a", "c" }) --> { "a", "a", "c" } ``` -> [!NOTE] Order is preserved from the original list. +> [!NOTE] +> +> Order is preserved from the original list. #### `invert` @@ -421,7 +427,9 @@ Convert the list to a set. s = List({ "a", "b", "a" }):toset() --> { a = true, b = true } ``` -> [!NOTE] Order is preserved from the original list. +> [!NOTE] +> +> Order is preserved from the original list. #### `slice` @@ -431,7 +439,9 @@ Return a new list containing items from i to j (inclusive). t = List({ "a", "b", "c", "d" }):slice(2, 3) --> { "b", "c" } ``` -> [!NOTE] Supports negative indices (-1 is last element). +> [!NOTE] +> +> Supports negative indices (-1 is last element). #### `take` @@ -457,4 +467,6 @@ Zip two lists into a list of 2-element tables. z = List({ "a", "b" }):zip({ 1, 2 }) --> { {"a",1}, {"b",2} } ``` -> [!NOTE] Length is the minimum of both lists. +> [!NOTE] +> +> Length is the minimum of both lists. diff --git a/docs/src/modules/str.md b/docs/src/modules/str.md index 7ed035d..987bbbc 100644 --- a/docs/src/modules/str.md +++ b/docs/src/modules/str.md @@ -130,7 +130,9 @@ n = count("abcd", "") Return true if string ends with suffix. -> [!NOTE] If suffix is a list, returns `true` when any suffix matches. +> [!NOTE] +> +> If suffix is a list, returns `true` when any suffix matches. ```lua ok = endswith("hello.lua", ".lua") @@ -175,8 +177,9 @@ ok = isalnum("abc123") --result: true ``` -> [!NOTE] Lua letters are ASCII by default, so non-ASCII letters are not -> alphanumeric. +> [!NOTE] +> +> Lua letters are ASCII by default, so non-ASCII letters are not alphanumeric. > > ```lua > isalnum("á1")` --> `false` @@ -191,8 +194,9 @@ ok = isalpha("abc") --result: true ``` -> [!NOTE] Lua letters are ASCII by default, so non-ASCII letters are not -> alphabetic. +> [!NOTE] +> +> Lua letters are ASCII by default, so non-ASCII letters are not alphabetic. > > ```lua > isalpha("á")` --> `false` @@ -207,7 +211,9 @@ ok = isascii("hello") --result: true ``` -> [!NOTE] The empty string returns `true`. +> [!NOTE] +> +> The empty string returns `true`. #### `isdecimal` @@ -270,7 +276,9 @@ ok = isprintable("abc!") --result: true ``` -> [!NOTE] The empty string returns `true`. +> [!NOTE] +> +> The empty string returns `true`. #### `isspace` @@ -472,7 +480,9 @@ s = swapcase("AbC") Return true if string starts with prefix. -> [!NOTE] If prefix is a list, returns `true` when any prefix matches. +> [!NOTE] +> +> If prefix is a list, returns `true` when any prefix matches. ```lua ok = startswith("hello.lua", "he") diff --git a/docs/src/modules/tbl.md b/docs/src/modules/tbl.md index a9f3ddf..fb53980 100644 --- a/docs/src/modules/tbl.md +++ b/docs/src/modules/tbl.md @@ -88,8 +88,10 @@ t = copy({ a = 1, b = 2 }) --> { a = 1, b = 2 } Create a deep copy of a value. -> [!NOTE] If `v` is a table, all nested tables are copied recursively; other -> types are returned as-is. +> [!NOTE] +> +> If `v` is a table, all nested tables are copied recursively; other types are +> returned as-is. ```lua t = deepcopy({ a = { b = 1 } }) --> { a = { b = 1 } } @@ -138,7 +140,9 @@ v1 = get(t, "a", "b", "c") --> 1 v2 = get(t) --> { a = { b = { c = 1 } } } ``` -> [!NOTE] If no keys are provided, returns the input table. +> [!NOTE] +> +> If no keys are provided, returns the input table. ### Transforms @@ -182,7 +186,9 @@ end) --> { a = 10, b = 20 } Return a new table by mapping each key-value pair. -> [!NOTE] Output keeps original keys; only values are transformed by `fn`. +> [!NOTE] +> +> Output keeps original keys; only values are transformed by `fn`. ```lua t = pairmap({ a = 1, b = 2 }, function(k, v) diff --git a/docs/src/modules/utils.md b/docs/src/modules/utils.md index 7ce1af2..8ff5de7 100644 --- a/docs/src/modules/utils.md +++ b/docs/src/modules/utils.md @@ -29,8 +29,10 @@ print(utils.quote('say "hi" and \\'bye\\'')) -- "say \"hi\" and 'bye'" Render any Lua value as a string. -> [!NOTE] Uses [`inspect`](https://github.com/kikito/inspect.lua) when -> available, otherwise falls back to +> [!NOTE] +> +> Uses [`inspect`](https://github.com/kikito/inspect.lua) when available, +> otherwise falls back to > [`mods.repr`](https://luamod.github.io/mods/modules/repr). ```lua