Update 0.27 docs (#484)
* update doc/*/scripting/builtins/libinventory.md * add doc/*/scripting/builtins/libgfx-weather.md * update doc/*/scripting/builtins/libfile.md * update doc/*/item-properties & update doc/*/scripting/builtins/libinventory.md * add inventory.decrement docs * update doc/*/scripting/builtins/libinventory.md
This commit is contained in:
@@ -144,3 +144,23 @@ file.prefix(path: str) --> str
|
||||
```
|
||||
|
||||
Extracts the entry point (prefix) from the path. Example: `world:data/base/config.toml` -> `world`.
|
||||
|
||||
```lua
|
||||
file.parent(path: str) --> str
|
||||
```
|
||||
|
||||
Returns the path one level up. Example: `world:data/base/config.toml` -> `world:data/base`
|
||||
|
||||
```lua
|
||||
file.path(path: str) --> str
|
||||
```
|
||||
|
||||
Removes the entry point (prefix) from the path. Example: `world:data/base/config.toml` -> `data/base/config.toml`
|
||||
|
||||
```lua
|
||||
file.join(directory: str, path: str) --> str
|
||||
```
|
||||
|
||||
Joins the path. Example: `file.join("world:data", "base/config.toml)` -> `world:data/base/config.toml`.
|
||||
|
||||
You should use this function instead of concatenating with `/`, since `prefix:/path` is not valid.
|
||||
|
||||
Reference in New Issue
Block a user