diff --git a/src/content/docs/features/persisted-scope.mdx b/src/content/docs/features/persisted-scope.mdx index 5694535c65..6a544d8d1f 100644 --- a/src/content/docs/features/persisted-scope.mdx +++ b/src/content/docs/features/persisted-scope.mdx @@ -3,12 +3,50 @@ title: Persisted Scope description: Persist runtime scope changes on the filesystem. --- -import Stub from '@components/Stub.astro'; import PluginLinks from '@components/PluginLinks.astro'; +import { Tabs, TabItem } from '@astrojs/starlight/components'; +import CommandTabs from '@components/CommandTabs.astro'; - - Based on - https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/persisted-scope - +Save filesystem and asset scopes and restore them when the app is reopened. + +## Supported Platforms + +- Windows +- Linux +- macOS + +## Setup + +_This plugin requires a Rust version of at least **1.75**_ + +Install the persisted-scope plugin to get started. + +:::note +Currently manual install is required for setting up persisted-scope plugin. +::: + +1. Install the Core plugin by adding the following to your `Cargo.toml` file: + +```toml title="src-tauri/Cargo.toml" +[dependencies] +tauri-plugin-persisted-scope = "2.0.0-beta" +# alternatively with Git: +tauri-plugin-persisted-scope = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } +``` + +2. Modify `lib.rs` to initialize the plugin: + +```rust title="src-tauri/src/lib.rs" {3} +fn run() { + tauri::Builder::default() + .plugin(tauri_plugin_persisted_scope::init()) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} +``` + +## Usage + +After setup the plugin will automatically save and restore filesystem and asset scopes. \ No newline at end of file