From 19d9014279bfffd78b42e162e4bbc3f43f431e66 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sun, 22 Dec 2024 22:11:07 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20Docs:=20=E6=B7=BB=E5=8A=A0=20localstor?= =?UTF-8?q?e=20=E6=8F=92=E4=BB=B6=E9=85=8D=E7=BD=AE=20(#3197)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/docs/best-practice/data-storing.md | 42 +++++++++ .../best-practice/data-storing.md | 94 +++++++++++++++++++ .../best-practice/data-storing.md | 94 +++++++++++++++++++ .../best-practice/data-storing.md | 42 +++++++++ .../best-practice/data-storing.md | 42 +++++++++ 5 files changed, 314 insertions(+) diff --git a/website/docs/best-practice/data-storing.md b/website/docs/best-practice/data-storing.md index d9f3a8c5..95ad7970 100644 --- a/website/docs/best-practice/data-storing.md +++ b/website/docs/best-practice/data-storing.md @@ -111,3 +111,45 @@ LOCALSTORE_DATA_DIR=/tmp/data ```dotenv LOCALSTORE_CONFIG_DIR=/tmp/config ``` + +### localstore_plugin_cache_dir + +自定义插件缓存目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_CACHE_DIR=' +{ + "plugin_id": "/tmp/plugin_cache" +} +' +``` + +### localstore_plugin_data_dir + +自定义插件数据目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_DATA_DIR=' +{ + "plugin_id": "/tmp/plugin_data" +} +' +``` + +### localstore_plugin_config_dir + +自定义插件配置目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_CONFIG_DIR=' +{ + "plugin_id": "/tmp/plugin_config" +} +' +``` diff --git a/website/versioned_docs/version-2.3.1/best-practice/data-storing.md b/website/versioned_docs/version-2.3.1/best-practice/data-storing.md index 0ff78a6d..ffa4f61a 100644 --- a/website/versioned_docs/version-2.3.1/best-practice/data-storing.md +++ b/website/versioned_docs/version-2.3.1/best-practice/data-storing.md @@ -59,3 +59,97 @@ data_file.write_text("Hello World!") # 读取文件内容 data = data_file.read_text() ``` + +:::note 提示 + +对于嵌套插件,子插件的存储目录将位于父插件存储目录下。 + +::: + +## 配置项 + +### localstore_cache_dir + +自定义缓存目录 + +默认值: + +- macOS: `~/Library/Caches/` +- Unix: `~/.cache/` (XDG default) +- Windows: `C:\Users\\AppData\Local\\Cache` + +```dotenv +LOCALSTORE_CACHE_DIR=/tmp/cache +``` + +### localstore_data_dir + +自定义数据目录 + +默认值: + +- macOS: `~/Library/Application Support/` +- Unix: `~/.local/share/` or in $XDG_DATA_HOME, if defined +- Win XP (not roaming): `C:\Documents and Settings\\Application Data\` +- Win 7 (not roaming): `C:\Users\\AppData\Local\` + +```dotenv +LOCALSTORE_DATA_DIR=/tmp/data +``` + +### localstore_config_dir + +自定义配置目录 + +默认值: + +- macOS: same as user_data_dir +- Unix: `~/.config/` +- Win XP (roaming): `C:\Documents and Settings\\Local Settings\Application Data\` +- Win 7 (roaming): `C:\Users\\AppData\Roaming\` + +```dotenv +LOCALSTORE_CONFIG_DIR=/tmp/config +``` + +### localstore_plugin_cache_dir + +自定义插件缓存目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_CACHE_DIR=' +{ + "plugin_id": "/tmp/plugin_cache" +} +' +``` + +### localstore_plugin_data_dir + +自定义插件数据目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_DATA_DIR=' +{ + "plugin_id": "/tmp/plugin_data" +} +' +``` + +### localstore_plugin_config_dir + +自定义插件配置目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_CONFIG_DIR=' +{ + "plugin_id": "/tmp/plugin_config" +} +' +``` diff --git a/website/versioned_docs/version-2.3.2/best-practice/data-storing.md b/website/versioned_docs/version-2.3.2/best-practice/data-storing.md index 0ff78a6d..ffa4f61a 100644 --- a/website/versioned_docs/version-2.3.2/best-practice/data-storing.md +++ b/website/versioned_docs/version-2.3.2/best-practice/data-storing.md @@ -59,3 +59,97 @@ data_file.write_text("Hello World!") # 读取文件内容 data = data_file.read_text() ``` + +:::note 提示 + +对于嵌套插件,子插件的存储目录将位于父插件存储目录下。 + +::: + +## 配置项 + +### localstore_cache_dir + +自定义缓存目录 + +默认值: + +- macOS: `~/Library/Caches/` +- Unix: `~/.cache/` (XDG default) +- Windows: `C:\Users\\AppData\Local\\Cache` + +```dotenv +LOCALSTORE_CACHE_DIR=/tmp/cache +``` + +### localstore_data_dir + +自定义数据目录 + +默认值: + +- macOS: `~/Library/Application Support/` +- Unix: `~/.local/share/` or in $XDG_DATA_HOME, if defined +- Win XP (not roaming): `C:\Documents and Settings\\Application Data\` +- Win 7 (not roaming): `C:\Users\\AppData\Local\` + +```dotenv +LOCALSTORE_DATA_DIR=/tmp/data +``` + +### localstore_config_dir + +自定义配置目录 + +默认值: + +- macOS: same as user_data_dir +- Unix: `~/.config/` +- Win XP (roaming): `C:\Documents and Settings\\Local Settings\Application Data\` +- Win 7 (roaming): `C:\Users\\AppData\Roaming\` + +```dotenv +LOCALSTORE_CONFIG_DIR=/tmp/config +``` + +### localstore_plugin_cache_dir + +自定义插件缓存目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_CACHE_DIR=' +{ + "plugin_id": "/tmp/plugin_cache" +} +' +``` + +### localstore_plugin_data_dir + +自定义插件数据目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_DATA_DIR=' +{ + "plugin_id": "/tmp/plugin_data" +} +' +``` + +### localstore_plugin_config_dir + +自定义插件配置目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_CONFIG_DIR=' +{ + "plugin_id": "/tmp/plugin_config" +} +' +``` diff --git a/website/versioned_docs/version-2.3.3/best-practice/data-storing.md b/website/versioned_docs/version-2.3.3/best-practice/data-storing.md index d9f3a8c5..95ad7970 100644 --- a/website/versioned_docs/version-2.3.3/best-practice/data-storing.md +++ b/website/versioned_docs/version-2.3.3/best-practice/data-storing.md @@ -111,3 +111,45 @@ LOCALSTORE_DATA_DIR=/tmp/data ```dotenv LOCALSTORE_CONFIG_DIR=/tmp/config ``` + +### localstore_plugin_cache_dir + +自定义插件缓存目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_CACHE_DIR=' +{ + "plugin_id": "/tmp/plugin_cache" +} +' +``` + +### localstore_plugin_data_dir + +自定义插件数据目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_DATA_DIR=' +{ + "plugin_id": "/tmp/plugin_data" +} +' +``` + +### localstore_plugin_config_dir + +自定义插件配置目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_CONFIG_DIR=' +{ + "plugin_id": "/tmp/plugin_config" +} +' +``` diff --git a/website/versioned_docs/version-2.4.0/best-practice/data-storing.md b/website/versioned_docs/version-2.4.0/best-practice/data-storing.md index d9f3a8c5..95ad7970 100644 --- a/website/versioned_docs/version-2.4.0/best-practice/data-storing.md +++ b/website/versioned_docs/version-2.4.0/best-practice/data-storing.md @@ -111,3 +111,45 @@ LOCALSTORE_DATA_DIR=/tmp/data ```dotenv LOCALSTORE_CONFIG_DIR=/tmp/config ``` + +### localstore_plugin_cache_dir + +自定义插件缓存目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_CACHE_DIR=' +{ + "plugin_id": "/tmp/plugin_cache" +} +' +``` + +### localstore_plugin_data_dir + +自定义插件数据目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_DATA_DIR=' +{ + "plugin_id": "/tmp/plugin_data" +} +' +``` + +### localstore_plugin_config_dir + +自定义插件配置目录 + +默认值:`{}` + +```dotenv +LOCALSTORE_PLUGIN_CONFIG_DIR=' +{ + "plugin_id": "/tmp/plugin_config" +} +' +```