mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 22:50:19 +00:00
docs: add path docs
This commit is contained in:
parent
e2852a60d1
commit
9ee572ad26
2 changed files with 37 additions and 1 deletions
|
@ -14,4 +14,5 @@
|
|||
- [API.Command](./plugin/interface/command.md)
|
||||
- [API.OS](./plugin/interface/os.md)
|
||||
- [API.Directories](./plugin/interface/dirs.md)
|
||||
- [API.Network](./plugin/interface/network.md)
|
||||
- [API.Network](./plugin/interface/network.md)
|
||||
- [API.Path](./plugin/interface/path.md)
|
35
docs/src/plugin/interface/path.md
Normal file
35
docs/src/plugin/interface/path.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Path Functions
|
||||
|
||||
> you can use path functions to operate valid path string
|
||||
|
||||
### join(path: string, extra: string) -> string
|
||||
|
||||
This function can help you extend a path, you can extend any path, dirname or filename.
|
||||
|
||||
```lua
|
||||
local current_path = "~/hello/dioxus"
|
||||
local new_path = plugin.path.join(current_path, "world")
|
||||
-- new_path = "~/hello/dioxus/world"
|
||||
```
|
||||
|
||||
### parent(path: string) -> string
|
||||
|
||||
This function will return `path` parent-path string, back to the parent.
|
||||
|
||||
```lua
|
||||
local current_path = "~/hello/dioxus"
|
||||
local new_path = plugin.path.parent(current_path)
|
||||
-- new_path = "~/hello/"
|
||||
```
|
||||
|
||||
### exists(path: string) -> boolean
|
||||
|
||||
This function can check some path (dir & file) is exists.
|
||||
|
||||
### is_file(path: string) -> boolean
|
||||
|
||||
This function can check some path is a exist file.
|
||||
|
||||
### is_dir(path: string) -> boolean
|
||||
|
||||
This function can check some path is a exist dir.
|
Loading…
Reference in a new issue