Skip to content

Commit 06864f7

Browse files
authored
feat: Steps component to ordered lists in /features directory (tauri-apps#2065)
1 parent fcba02d commit 06864f7

18 files changed

+617
-569
lines changed

src/content/docs/features/autostart.mdx

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Automatically launch your app at system startup.
44
---
55

66
import PluginLinks from '@components/PluginLinks.astro';
7-
import { Tabs, TabItem } from '@astrojs/starlight/components';
7+
import { Tabs, TabItem, Steps } from '@astrojs/starlight/components';
88
import CommandTabs from '@components/CommandTabs.astro';
99

1010
<PluginLinks plugin="autostart" />
@@ -24,44 +24,47 @@ Install the autostart plugin to get started.
2424
<Tabs>
2525
<TabItem label="Automatic">
2626

27-
Use your project's package manager to add the dependency:
27+
Use your project's package manager to add the dependency:
2828

29-
{' '}
29+
{' '}
3030

31-
<CommandTabs
32-
npm="npm run tauri add autostart"
33-
yarn="yarn run tauri add autostart"
34-
pnpm="pnpm tauri add autostart"
35-
cargo="cargo tauri add autostart"
36-
/>
31+
<CommandTabs
32+
npm="npm run tauri add autostart"
33+
yarn="yarn run tauri add autostart"
34+
pnpm="pnpm tauri add autostart"
35+
cargo="cargo tauri add autostart"
36+
/>
3737

3838
</TabItem>
39-
<TabItem label="Manual">
39+
<TabItem label="Manual">
40+
<Steps>
4041

41-
1. Run `cargo add tauri-plugin-autostart` to add the plugin to the project's dependencies in `Cargo.toml`.
42+
1. Run `cargo add tauri-plugin-autostart` to add the plugin to the project's dependencies in `Cargo.toml`.
4243

43-
2. Modify `lib.rs` to initialize the plugin:
44+
2. Modify `lib.rs` to initialize the plugin:
4445

45-
```rust title="lib.rs" ins={1, 6}
46-
use tauri_plugin_autostart::MacosLauncher;
46+
```rust title="lib.rs" ins={1, 6}
47+
use tauri_plugin_autostart::MacosLauncher;
4748

48-
#[cfg_attr(mobile, tauri::mobile_entry_point)]
49-
fn run() {
50-
tauri::Builder::default()
51-
.plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, Some(vec!["--flag1", "--flag2"]) /* arbitrary number of args to pass to your app */))
52-
.run(tauri::generate_context!())
53-
.expect("error while running tauri application");
54-
}
55-
```
49+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
50+
fn run() {
51+
tauri::Builder::default()
52+
.plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, Some(vec!["--flag1", "--flag2"]) /* arbitrary number of args to pass to your app */))
53+
.run(tauri::generate_context!())
54+
.expect("error while running tauri application");
55+
}
56+
```
5657

57-
3. You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
58+
3. You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
5859

59-
<CommandTabs
60-
npm="npm install @tauri-apps/plugin-autostart"
61-
yarn="yarn add @tauri-apps/plugin-autostart"
62-
pnpm="pnpm add @tauri-apps/plugin-autostart"
63-
/>
64-
</TabItem>
60+
<CommandTabs
61+
npm="npm install @tauri-apps/plugin-autostart"
62+
yarn="yarn add @tauri-apps/plugin-autostart"
63+
pnpm="pnpm add @tauri-apps/plugin-autostart"
64+
/>
65+
66+
</Steps>
67+
</TabItem>
6568
</Tabs>
6669

6770
## Usage

src/content/docs/features/barcode-scanner.mdx

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar:
88
---
99

1010
import PluginLinks from '@components/PluginLinks.astro';
11-
import { Tabs, TabItem } from '@astrojs/starlight/components';
11+
import { Tabs, TabItem, Steps } from '@astrojs/starlight/components';
1212
import CommandTabs from '@components/CommandTabs.astro';
1313

1414
<PluginLinks plugin="barcode-scanner" />
@@ -29,41 +29,44 @@ Install the barcode-scanner plugin to get started.
2929
<Tabs>
3030
<TabItem label="Automatic">
3131

32-
Use your project's package manager to add the dependency:
32+
Use your project's package manager to add the dependency:
3333

34-
{' '}
35-
36-
<CommandTabs
37-
npm="npm run tauri add barcode-scanner"
38-
yarn="yarn run tauri add barcode-scanner"
39-
pnpm="pnpm tauri add barcode-scanner"
40-
cargo="cargo tauri add barcode-scanner"
41-
/>
34+
{' '}
4235

36+
<CommandTabs
37+
npm="npm run tauri add barcode-scanner"
38+
yarn="yarn run tauri add barcode-scanner"
39+
pnpm="pnpm tauri add barcode-scanner"
40+
cargo="cargo tauri add barcode-scanner"
41+
/>
42+
4343
</TabItem>
4444
<TabItem label="Manual">
45+
<Steps>
4546

46-
1. Run `cargo add tauri-plugin-barcode-scanner` to add the plugin to the project's dependencies in `Cargo.toml`.
47+
1. Run `cargo add tauri-plugin-barcode-scanner` to add the plugin to the project's dependencies in `Cargo.toml`.
4748

48-
2. Modify `lib.rs` to initialize the plugin:
49+
2. Modify `lib.rs` to initialize the plugin:
4950

50-
```rust title="lib.rs" ins={4}
51-
#[cfg_attr(mobile, tauri::mobile_entry_point)]
52-
fn run() {
53-
tauri::Builder::default()
54-
.plugin(tauri_plugin_barcode_scanner::init())
55-
.run(tauri::generate_context!())
56-
.expect("error while running tauri application");
57-
}
58-
```
51+
```rust title="lib.rs" ins={4}
52+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
53+
fn run() {
54+
tauri::Builder::default()
55+
.plugin(tauri_plugin_barcode_scanner::init())
56+
.run(tauri::generate_context!())
57+
.expect("error while running tauri application");
58+
}
59+
```
60+
61+
3. Install the JavaScript Guest bindings using your preferred JavaScript package manager:
5962

60-
3. Install the JavaScript Guest bindings using your preferred JavaScript package manager:
63+
<CommandTabs
64+
npm="npm install @tauri-apps/plugin-barcode-scanner"
65+
yarn="yarn add @tauri-apps/plugin-barcode-scanner"
66+
pnpm="pnpm add @tauri-apps/plugin-barcode-scanner"
67+
/>
6168

62-
<CommandTabs
63-
npm="npm install @tauri-apps/plugin-barcode-scanner"
64-
yarn="yarn add @tauri-apps/plugin-barcode-scanner"
65-
pnpm="pnpm add @tauri-apps/plugin-barcode-scanner"
66-
/>
69+
</Steps>
6770
</TabItem>
6871
</Tabs>
6972

src/content/docs/features/cli.mdx

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Parse arguments from the command line interface.
44
---
55

66
import PluginLinks from '@components/PluginLinks.astro';
7-
import { Tabs, TabItem } from '@astrojs/starlight/components';
7+
import { Tabs, TabItem, Steps } from '@astrojs/starlight/components';
88
import CommandTabs from '@components/CommandTabs.astro';
99

1010
<PluginLinks plugin="cli" />
@@ -24,52 +24,55 @@ _This plugin requires a Rust version of at least **1.75**_
2424
Install the CLI plugin to get started.
2525

2626
<Tabs>
27-
<TabItem label="Automatic">
28-
29-
Use your project's package manager to add the dependency:
30-
31-
{' '}
32-
33-
<CommandTabs
34-
npm="npm run tauri add cli"
35-
yarn="yarn run tauri add cli"
36-
pnpm="pnpm tauri add cli"
37-
cargo="cargo tauri add cli"
38-
/>
39-
40-
</TabItem>
41-
<TabItem label="Manual">
42-
43-
1. Install the Core plugin by adding the following to your `Cargo.toml` file:
44-
45-
```toml title="src-tauri/Cargo.toml"
46-
# you can add the dependencies on the `[dependencies]` section if you do not target mobile
47-
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
48-
tauri-plugin-cli = "2.0.0-beta"
49-
# alternatively with Git:
50-
tauri-plugin-cli = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
51-
```
52-
53-
2. Modify `lib.rs` to initialize the plugin:
54-
55-
```rust title="src-tauri/src/lib.rs" ins={4}
56-
#[cfg_attr(mobile, tauri::mobile_entry_point)]
57-
fn run() {
58-
tauri::Builder::default()
59-
.plugin(tauri_plugin_cli::init())
60-
.run(tauri::generate_context!())
61-
.expect("error while running tauri application");
62-
}
63-
```
64-
65-
3. Install the JavaScript Guest bindings using your preferred JavaScript package manager:
66-
67-
<CommandTabs
68-
npm="npm install @tauri-apps/plugin-cli"
69-
yarn="yarn add @tauri-apps/plugin-cli"
70-
pnpm="pnpm add @tauri-apps/plugin-cli"
71-
/>
72-
</TabItem>
27+
<TabItem label="Automatic">
28+
29+
Use your project's package manager to add the dependency:
30+
31+
{' '}
32+
33+
<CommandTabs
34+
npm="npm run tauri add cli"
35+
yarn="yarn run tauri add cli"
36+
pnpm="pnpm tauri add cli"
37+
cargo="cargo tauri add cli"
38+
/>
39+
40+
</TabItem>
41+
<TabItem label="Manual">
42+
<Steps>
43+
44+
1. Install the Core plugin by adding the following to your `Cargo.toml` file:
45+
46+
```toml title="src-tauri/Cargo.toml"
47+
# you can add the dependencies on the `[dependencies]` section if you do not target mobile
48+
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
49+
tauri-plugin-cli = "2.0.0-beta"
50+
# alternatively with Git:
51+
tauri-plugin-cli = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
52+
```
53+
54+
2. Modify `lib.rs` to initialize the plugin:
55+
56+
```rust title="src-tauri/src/lib.rs" ins={4}
57+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
58+
fn run() {
59+
tauri::Builder::default()
60+
.plugin(tauri_plugin_cli::init())
61+
.run(tauri::generate_context!())
62+
.expect("error while running tauri application");
63+
}
64+
```
65+
66+
3. Install the JavaScript Guest bindings using your preferred JavaScript package manager:
67+
68+
<CommandTabs
69+
npm="npm install @tauri-apps/plugin-cli"
70+
yarn="yarn add @tauri-apps/plugin-cli"
71+
pnpm="pnpm add @tauri-apps/plugin-cli"
72+
/>
73+
74+
</Steps>
75+
</TabItem>
7376
</Tabs>
7477

7578
## Base Configuration

src/content/docs/features/clipboard.mdx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Read and write to the system clipboard.
55

66
import Stub from '@components/Stub.astro';
77
import PluginLinks from '@components/PluginLinks.astro';
8-
import { Tabs, TabItem } from '@astrojs/starlight/components';
8+
import { Tabs, TabItem, Steps } from '@astrojs/starlight/components';
99
import CommandTabs from '@components/CommandTabs.astro';
1010

1111
<PluginLinks plugin="clipboard-manager" />
@@ -28,33 +28,34 @@ Install the clipboard plugin to get started.
2828

2929
</TabItem>
3030
<TabItem label="Manual">
31+
<Steps>
3132

32-
1. Run `cargo add tauri-plugin-clipboard-manager` to add the plugin to the project's dependencies in `Cargo.toml`.
33+
1. Run `cargo add tauri-plugin-clipboard-manager` to add the plugin to the project's dependencies in `Cargo.toml`.
3334

34-
2. Modify `lib.rs` to initialize the plugin:
35+
2. Modify `lib.rs` to initialize the plugin:
3536

36-
```rust
37-
// lib.rs
38-
#[cfg_attr(mobile, tauri::mobile_entry_point)]
39-
pub fn run() {
40-
tauri::Builder::default()
41-
// Initialize the plugin
42-
.plugin(tauri_plugin_clipboard_manager::init())
43-
.run(tauri::generate_context!())
44-
.expect("error while running tauri application");
45-
}
46-
```
37+
```rust
38+
// lib.rs
39+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
40+
pub fn run() {
41+
tauri::Builder::default()
42+
// Initialize the plugin
43+
.plugin(tauri_plugin_clipboard_manager::init())
44+
.run(tauri::generate_context!())
45+
.expect("error while running tauri application");
46+
}
47+
```
4748

48-
3. If you'd like to manage the clipboard in JavaScript then install the npm package as well:
49+
3. If you'd like to manage the clipboard in JavaScript then install the npm package as well:
4950

50-
<CommandTabs
51-
npm="npm install @tauri-apps/plugin-clipboard-manager"
52-
yarn="yarn add @tauri-apps/plugin-clipboard-manager"
53-
pnpm="pnpm add @tauri-apps/plugin-clipboard-manager"
54-
/>
51+
<CommandTabs
52+
npm="npm install @tauri-apps/plugin-clipboard-manager"
53+
yarn="yarn add @tauri-apps/plugin-clipboard-manager"
54+
pnpm="pnpm add @tauri-apps/plugin-clipboard-manager"
55+
/>
5556

57+
</Steps>
5658
</TabItem>
57-
5859
</Tabs>
5960

6061
## Usage

0 commit comments

Comments
 (0)