From d47319526c20d88f14e21a8216fd01ea97c61b25 Mon Sep 17 00:00:00 2001 From: YuKun Liu Date: Thu, 22 Sep 2022 08:32:57 -0700 Subject: [PATCH] docs: commit new document --- docs/src/SUMMARY.md | 4 +++- docs/src/plugin/interface/dirs.md | 35 +++++++++++++++++++++++++++++++ docs/src/plugin/interface/os.md | 11 ++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 docs/src/plugin/interface/dirs.md create mode 100644 docs/src/plugin/interface/os.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 3a260d75b..18ae0f5aa 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -10,4 +10,6 @@ - [Clean](./cmd/clean.md) - [Translate](./cmd/translate.md) - [Plugin Development](./plugin/README.md) - - [API.Command](./plugin/interface/command.md) \ No newline at end of file + - [API.Command](./plugin/interface/command.md) + - [API.OS](./plugin/interface/os.md) + - [API.Directories](./plugin/interface/dirs.md) \ No newline at end of file diff --git a/docs/src/plugin/interface/dirs.md b/docs/src/plugin/interface/dirs.md new file mode 100644 index 000000000..4173c922f --- /dev/null +++ b/docs/src/plugin/interface/dirs.md @@ -0,0 +1,35 @@ +# Dirs Functions + +> you can use Dirs functions to get some directory path + + +### plugin_dir() -> string + +You can get current plugin **root** directory path + +```lua +local path = plugin.dirs.plugin_dir() +-- example: ~/Development/DioxusCli/plugin/test-plugin/ +``` + +### bin_dir() -> string + +You can get plugin **bin** direcotry path + +Sometime you need install some binary file like `tailwind-cli` & `sass-cli` to help your plugin work, then you should put binary file in this directory. + +```lua +local path = plugin.dirs.bin_dir() +-- example: ~/Development/DioxusCli/plugin/test-plugin/bin/ +``` + +### temp_dir() -> string + +You can get plugin **temp** direcotry path + +Just put some temporary file in this directory. + +```lua +local path = plugin.dirs.bin_dir() +-- example: ~/Development/DioxusCli/plugin/test-plugin/temp/ +``` \ No newline at end of file diff --git a/docs/src/plugin/interface/os.md b/docs/src/plugin/interface/os.md new file mode 100644 index 000000000..72a17c336 --- /dev/null +++ b/docs/src/plugin/interface/os.md @@ -0,0 +1,11 @@ +# OS Functions + +> you can use OS functions to get some system information + +### current_platform() -> string ("windows" | "macos" | "linux") + +This function can help you get system & platform type: + +```lua +local platform = plugin.os.current_platform() +``` \ No newline at end of file