From 9ac36d5c5a6c2f892954c36f78b9aedc62c15c68 Mon Sep 17 00:00:00 2001 From: DK Liao Date: Tue, 5 Mar 2024 11:43:32 +0800 Subject: [PATCH 1/2] Update persisted-scope.mdx --- src/content/docs/features/persisted-scope.mdx | 73 +++++++++++++++++-- 1 file changed, 68 insertions(+), 5 deletions(-) diff --git a/src/content/docs/features/persisted-scope.mdx b/src/content/docs/features/persisted-scope.mdx index 5694535c65..9d3b0364e8 100644 --- a/src/content/docs/features/persisted-scope.mdx +++ b/src/content/docs/features/persisted-scope.mdx @@ -3,12 +3,75 @@ 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 +- Android? +- iOS? + +## Setup + +_This plugin requires a Rust version of at least **1.75**_ + +Install the persisted-scope plugin to get started. + + + + +Use your project's package manager to add the dependency: + +{' '} + + + + + + +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/main.rs" {3} +fn main() { + tauri::Builder::default() + .plugin(tauri_plugin_persisted_scope::init()) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} +``` + +3. Install the JavaScript Guest bindings using your preferred JavaScript package manager: + + + + + +## Usage + +After setup the plugin will automatically save and restore filesystem and asset scopes. \ No newline at end of file From e0ad14fedd54350edf9c40c7586cc8412192f4bc Mon Sep 17 00:00:00 2001 From: DK Liao Date: Wed, 6 Mar 2024 18:49:10 +0800 Subject: [PATCH 2/2] Update persisted-scope.mdx --- src/content/docs/features/persisted-scope.mdx | 35 +++---------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/src/content/docs/features/persisted-scope.mdx b/src/content/docs/features/persisted-scope.mdx index 9d3b0364e8..6a544d8d1f 100644 --- a/src/content/docs/features/persisted-scope.mdx +++ b/src/content/docs/features/persisted-scope.mdx @@ -16,8 +16,6 @@ Save filesystem and asset scopes and restore them when the app is reopened. - Windows - Linux - macOS -- Android? -- iOS? ## Setup @@ -25,22 +23,9 @@ _This plugin requires a Rust version of at least **1.75**_ Install the persisted-scope plugin to get started. - - - -Use your project's package manager to add the dependency: - -{' '} - - - - - +:::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: @@ -53,8 +38,8 @@ tauri-plugin-persisted-scope = { git = "https://github.com/tauri-apps/plugins-wo 2. Modify `lib.rs` to initialize the plugin: -```rust title="src-tauri/src/main.rs" {3} -fn main() { +```rust title="src-tauri/src/lib.rs" {3} +fn run() { tauri::Builder::default() .plugin(tauri_plugin_persisted_scope::init()) .run(tauri::generate_context!()) @@ -62,16 +47,6 @@ fn main() { } ``` -3. Install the JavaScript Guest bindings using your preferred JavaScript package manager: - - - - - ## Usage After setup the plugin will automatically save and restore filesystem and asset scopes. \ No newline at end of file