Skip to content

Commit d0b80d0

Browse files
chore(docs): auto-generate docs (#16)
* chore(docs): auto-generate docs * Delete docs/src/modules/ntpath.md * Delete docs/src/modules/path.md * Delete docs/src/modules/posixpath.md --------- Co-authored-by: haithium <128622475+haithium@users.noreply.github.com>
1 parent 633f3e6 commit d0b80d0

13 files changed

Lines changed: 96 additions & 85 deletions

File tree

docs/src/modules/is.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
desc: "Type predicates for Lua values and filesystem path kinds."
2+
description: "Type predicates for Lua values and filesystem path types."
33
---
44

55
# `is`
66

7-
Type predicates for Lua values and filesystem path kinds.
7+
Type predicates for Lua values and filesystem path types.
88

99
## Usage
1010

@@ -65,16 +65,16 @@ is("hello", "STRING") --> true
6565

6666
**Path Checks**:
6767

68-
| Function | Description |
69-
| ------------------------- | ------------------------------------------------------- |
70-
| [`block(v)`](#fn-block) | Returns `true` when `v` is a block device path. |
71-
| [`char(v)`](#fn-char) | Returns `true` when `v` is a char device path. |
72-
| [`device(v)`](#fn-device) | Returns `true` when `v` is a block or char device path. |
73-
| [`dir(v)`](#fn-dir) | Returns `true` when `v` is a directory path. |
74-
| [`fifo(v)`](#fn-fifo) | Returns `true` when `v` is a FIFO path. |
75-
| [`file(v)`](#fn-file) | Returns `true` when `v` is a file path. |
76-
| [`link(v)`](#fn-link) | Returns `true` when `v` is a symlink path. |
77-
| [`socket(v)`](#fn-socket) | Returns `true` when `v` is a socket path. |
68+
| Function | Description |
69+
| ------------------------- | ------------------------------------------------------------ |
70+
| [`block(v)`](#fn-block) | Returns `true` when `v` is a block device path. |
71+
| [`char(v)`](#fn-char) | Returns `true` when `v` is a character device path. |
72+
| [`device(v)`](#fn-device) | Returns `true` when `v` is a block or character device path. |
73+
| [`dir(v)`](#fn-dir) | Returns `true` when `v` is a directory path. |
74+
| [`fifo(v)`](#fn-fifo) | Returns `true` when `v` is a FIFO path. |
75+
| [`file(v)`](#fn-file) | Returns `true` when `v` is a file path. |
76+
| [`link(v)`](#fn-link) | Returns `true` when `v` is a symlink path. |
77+
| [`socket(v)`](#fn-socket) | Returns `true` when `v` is a socket path. |
7878

7979
### Type Checks
8080

@@ -362,13 +362,13 @@ is.truthy("non-empty")
362362

363363
### Path Checks
364364

365-
Filesystem path kind checks.
365+
Filesystem path type checks.
366366

367367
> [!IMPORTANT]
368368
>
369369
> Path checks require **LuaFileSystem**
370-
> ([`lfs`](https://github.com/lunarmodules/luafilesystem)) and raise an error it
371-
> is not installed. <a id="fn-block"></a>
370+
> ([`lfs`](https://github.com/lunarmodules/luafilesystem)) and raise an error if
371+
> it is not installed. <a id="fn-block"></a>
372372
373373
#### `block(v)`
374374

@@ -392,7 +392,7 @@ is.block("/dev/sda")
392392

393393
#### `char(v)`
394394

395-
Returns `true` when `v` is a char device path.
395+
Returns `true` when `v` is a character device path.
396396

397397
**Parameters**:
398398

@@ -412,7 +412,7 @@ is.char("/dev/null")
412412

413413
#### `device(v)`
414414

415-
Returns `true` when `v` is a block or char device path.
415+
Returns `true` when `v` is a block or character device path.
416416

417417
**Parameters**:
418418

docs/src/modules/keyword.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
desc: "Lua keyword helpers."
2+
description: "Lua keyword helpers."
33
---
44

55
# `keyword`
@@ -17,13 +17,13 @@ kw.isidentifier("hello_world") --> true
1717

1818
## Functions
1919

20-
| Function | Description |
21-
| ----------------------------------------------------- | ----------------------------------------------------------------------------------- |
22-
| [`iskeyword(v)`](#fn-iskeyword) | Return `true` when `v` is a reserved Lua keyword. |
23-
| [`isidentifier(v)`](#fn-isidentifier) | Return `true` when `v` is a valid non-keyword Lua identifier. |
24-
| [`kwlist()`](#fn-kwlist) | Return Lua keywords as a [`mods.List`](https://luamod.github.io/mods/modules/list). |
25-
| [`kwset()`](#fn-kwset) | Return Lua keywords as a [`mods.Set`](https://luamod.github.io/mods/modules/set). |
26-
| [`normalize_identifier(s)`](#fn-normalize-identifier) | Normalize an input into a safe Lua identifier. |
20+
| Function | Description |
21+
| ----------------------------------------------------- | ------------------------------------------------------------- |
22+
| [`iskeyword(v)`](#fn-iskeyword) | Return `true` when `v` is a reserved Lua keyword. |
23+
| [`isidentifier(v)`](#fn-isidentifier) | Return `true` when `v` is a valid non-keyword Lua identifier. |
24+
| [`kwlist()`](#fn-kwlist) | Return Lua keywords as a [`mods.List`](/modules/list). |
25+
| [`kwset()`](#fn-kwset) | Return Lua keywords as a [`mods.Set`](/modules/set). |
26+
| [`normalize_identifier(s)`](#fn-normalize-identifier) | Normalize an input into a safe Lua identifier. |
2727

2828
<a id="fn-iskeyword"></a>
2929

@@ -71,8 +71,7 @@ kw.isidentifier("local") --> false
7171

7272
### `kwlist()`
7373

74-
Return Lua keywords as a
75-
[`mods.List`](https://luamod.github.io/mods/modules/list).
74+
Return Lua keywords as a [`mods.List`](/modules/list).
7675

7776
**Return**:
7877

@@ -88,8 +87,7 @@ kw.kwlist():contains("and") --> true
8887

8988
### `kwset()`
9089

91-
Return Lua keywords as a
92-
[`mods.Set`](https://luamod.github.io/mods/modules/set).
90+
Return Lua keywords as a [`mods.Set`](/modules/set).
9391

9492
**Return**:
9593

docs/src/modules/list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
desc:
2+
description:
33
"A list class providing common operations to create, modify, and query
44
sequences of values."
55
---

docs/src/modules/operator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
desc: "Operator helpers as functions."
2+
description: "Operator helpers as functions."
33
---
44

55
# `operator`

docs/src/modules/repr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
desc: "Render any Lua value as a readable string."
2+
description: "Render any Lua value as a readable string."
33
---
44

55
# `repr`

docs/src/modules/runtime.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
desc: "Exposes Lua runtime metadata and version compatibility flags."
2+
description: "Exposes Lua runtime metadata and version compatibility flags."
33
---
44

55
# `runtime`
@@ -25,6 +25,7 @@ print(runtime.is_lua54) --> true | false
2525
| [`minor`](#minor) | Minor version number parsed from `version`. |
2626
| [`version_num`](#version-num) | Numeric version encoded as `major * 100 + minor`. |
2727
| [`is_luajit`](#is-luajit) | True when running under LuaJIT. |
28+
| [`is_windows`](#is-windows) | True when running on a Windows host. |
2829
| [`is_lua51`](#is-lua51) | True only on Lua 5.1 runtimes. |
2930
| [`is_lua52`](#is-lua52) | True only on Lua 5.2 runtimes. |
3031
| [`is_lua53`](#is-lua53) | True only on Lua 5.3 runtimes. |
@@ -70,6 +71,14 @@ True when running under LuaJIT.
7071
print(runtime.is_luajit) --> true | false
7172
```
7273

74+
### `is_windows`
75+
76+
True when running on a Windows host.
77+
78+
```lua
79+
print(runtime.is_windows) --> true | false
80+
```
81+
7382
### `is_lua51`
7483

7584
True only on Lua 5.1 runtimes.

docs/src/modules/set.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
desc:
2+
description:
33
"A set class providing common operations to create, modify, and query
44
collections of unique values."
55
---

docs/src/modules/str.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
desc: "String utility helpers modeled after Python's `str`."
2+
description: "String utility helpers modeled after Python's `str`."
33
---
44

55
# `str`
@@ -247,8 +247,7 @@ s = format_map("hi {name}", { name = "bob" }) --> "hi bob"
247247
> [!NOTE]
248248
>
249249
> `format_map` is a lightweight `{key}` replacement helper. For richer
250-
> templating, use
251-
> [`mods.template`](https://luamod.github.io/mods/modules/template).
250+
> templating, use [`mods.template`](/modules/template).
252251
253252
### Predicates
254253

docs/src/modules/stringcase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
desc: "String case conversion helpers."
2+
description: "String case conversion helpers."
33
---
44

55
# `stringcase`

docs/src/modules/tbl.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
desc: "Utility functions for working with Lua tables."
2+
description: "Utility functions for working with Lua tables."
33
---
44

55
# `tbl`
@@ -39,7 +39,6 @@ print(tbl.count({ a = 1, b = 2 })) --> 2
3939
| [`same(a, b)`](#fn-same) | Return `true` if two tables have the same keys and equal values. |
4040
| [`find_if(t, pred)`](#fn-find-if) | Find first value and key matching predicate. |
4141
| [`get(t, ...)`](#fn-get) | Safely get nested value by keys. |
42-
| [`keypath(...)`](#fn-keypath) | Format a key chain as a Lua-like table access path. |
4342

4443
**Transforms**:
4544

@@ -263,29 +262,6 @@ v2 = get(t) --> { a = { b = { c = 1 } } }
263262
>
264263
> If no keys are provided, returns the input table.
265264
266-
<a id="fn-keypath"></a>
267-
268-
#### `keypath(...)`
269-
270-
Format a key chain as a Lua-like table access path.
271-
272-
**Parameters**:
273-
274-
- `...` (`any`): Additional arguments.
275-
276-
**Return**:
277-
278-
- `path` (`string`): Rendered key path.
279-
280-
**Example**:
281-
282-
```lua
283-
p1 = keypath("t", "a", "b", "c") --> "t.a.b.c"
284-
p2 = keypath("ctx", "users", 1, "name") --> "ctx.users[1].name"
285-
p3 = keypath("ctx", "invalid-key") --> 'ctx["invalid-key"]'
286-
p4 = keypath() --> ""
287-
```
288-
289265
### Transforms
290266

291267
Table transformation and conversion utilities. <a id="fn-invert"></a>

0 commit comments

Comments
 (0)