Skip to content

Commit c7fa068

Browse files
chore(docs): auto-generate docs (#17)
Co-authored-by: haithium <128622475+haithium@users.noreply.github.com>
1 parent a409e5c commit c7fa068

4 files changed

Lines changed: 512 additions & 0 deletions

File tree

docs/src/modules/fs.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
description: "Filesystem I/O and metadata operations."
3+
---
4+
5+
# `fs`
6+
7+
Filesystem I/O and metadata operations.
8+
9+
## Usage
10+
11+
```lua
12+
fs = require "mods.fs"
13+
14+
fs.mkdir("tmp/cache/app", true)
15+
```
16+
17+
## Functions
18+
19+
| Function | Description |
20+
| ---------- | -------------------------------------------------- |
21+
| `getcwd` | Alias of `lfs.currentdir` |
22+
| `isblock` | Alias of [`mods.is.block`](/modules/is#fn-block) |
23+
| `ischar` | Alias of [`mods.is.char`](/modules/is#fn-char) |
24+
| `isdevice` | Alias of [`mods.is.device`](/modules/is#fn-device) |
25+
| `isdir` | Alias of [`mods.is.dir`](/modules/is#fn-dir) |
26+
| `isfifo` | Alias of [`mods.is.fifo`](/modules/is#fn-fifo) |
27+
| `isfile` | Alias of [`mods.is.file`](/modules/is#fn-file) |
28+
| `islink` | Alias of [`mods.is.link`](/modules/is#fn-link) |
29+
| `issocket` | Alias of [`mods.is.socket`](/modules/is#fn-socket) |
30+
| `lstat` | Alias of `lfs.symlinkattributes` |
31+
| `rmdir` | Alias of `lfs.rmdir` |
32+
| `stat` | Alias of `lfs.attributes` |

docs/src/modules/ntpath.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
description: "Lexical path operations for Windows/NT-style paths."
3+
---
4+
5+
# `ntpath`
6+
7+
Lexical path operations for Windows/NT-style paths.
8+
9+
> 💡Python `ntpath`-style behavior, ported to Lua.
10+
11+
## Usage
12+
13+
```lua
14+
ntpath = require "mods.ntpath"
15+
16+
print(ntpath.join([[C:\]], "Users", "me")) --> "C:\Users\me"
17+
print(ntpath.normcase([[A/B\C]])) --> [[a\b\c]]
18+
print(ntpath.splitdrive([[C:\Users\me]])) --> "C:", [[\Users\me]]
19+
print(ntpath.isreserved([[C:\Temp\CON.txt]])) --> true
20+
```
21+
22+
> ✨ Same API as [`mods.path`](/modules/path), but with Windows/NT path
23+
> semantics.
24+
25+
## Functions
26+
27+
<a id="fn-ismount"></a>
28+
29+
### `ismount(path)`
30+
31+
Return `true` when `path` points to a mount root.
32+
33+
**Parameters**:
34+
35+
- `path` (`string`): Path to inspect.
36+
37+
**Return**:
38+
39+
- `value` (`boolean`): `true` if the path resolves to a mount root.
40+
41+
**Example**:
42+
43+
```lua
44+
ntpath.ismount([[C:\]]) --> true
45+
```
46+
47+
<a id="fn-isreserved"></a>
48+
49+
### `isreserved(path)`
50+
51+
Return `true` when `path` contains a reserved NT filename.
52+
53+
**Parameters**:
54+
55+
- `path` (`string`): Path to inspect.
56+
57+
**Return**:
58+
59+
- `value` (`boolean`): `true` if any component is NT-reserved.
60+
61+
**Example**:
62+
63+
```lua
64+
ntpath.isreserved([[a\CON.txt]]) --> true
65+
```

0 commit comments

Comments
 (0)