Skip to content

Commit

Permalink
fix(docs): indentation issues in <Steps> component (#2067) (fix #2065)
Browse files Browse the repository at this point in the history
* fix: indentation issue

* fix: identation issue in notification

* add: extra leading

* fix: indentation issue in single-instance

* add: more spacing

* more tests
  • Loading branch information
dreyfus92 authored Apr 12, 2024
1 parent 9d2b802 commit d2cff67
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 53 deletions.
47 changes: 24 additions & 23 deletions src/content/docs/features/logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,29 @@ Install the log plugin to get started.

## Usage

<Steps>
1. First, you need to register the plugin with Tauri.

```rust title="src-tauri/src/lib.rs" {1} {6-14}
use tauri_plugin_log::{Target, TargetKind};

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(
tauri_plugin_log::Builder::new()
.targets([
Target::new(TargetKind::Stdout),
Target::new(TargetKind::LogDir { file_name: None }),
Target::new(TargetKind::Webview),
])
.build(),
)
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```
<Steps>

1. First, you need to register the plugin with Tauri.

```rust title="src-tauri/src/lib.rs" {1} {6-14}
use tauri_plugin_log::{Target, TargetKind};

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(
tauri_plugin_log::Builder::new()
.targets([
Target::new(TargetKind::Stdout),
Target::new(TargetKind::LogDir { file_name: None }),
Target::new(TargetKind::Webview),
])
.build(),
)
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```

2. Afterwards, all the plugin's APIs are available through the JavaScript guest bindings:

Expand All @@ -117,7 +118,7 @@ Install the log plugin to get started.
detach();
```

</Steps>
</Steps>

## Permissions

Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/features/notification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ The notification plugin is available in both JavaScript and Rust.

Follow these steps to send a notification:

<Steps>
1. Check if permission is granted
<Steps>
1. Check if permission is granted

2. Request permission if not granted
2. Request permission if not granted

3. Send the notification
</Steps>
3. Send the notification
</Steps>

<Tabs>
<TabItem label="JavaScript">
Expand Down
38 changes: 19 additions & 19 deletions src/content/docs/features/persisted-scope.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@ Install the persisted-scope plugin to get started.
Currently manual install is required for setting up persisted-scope plugin.
:::

<Steps>
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");
}
<Steps>
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");
}
```

</Steps>

## Usage
Expand Down
12 changes: 6 additions & 6 deletions src/content/docs/features/single-instance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ The plugin is already installed and initialized, and it should be functioning co
The plugin `init()` method takes a closure that is invoked when a new app instance was started, but closed by the plugin.
The closure has three arguments:

<Steps>
1. **`app` :** The [AppHandle](https://docs.rs/tauri/latest/tauri/struct.AppHandle.html) of the application.
<Steps>

1. **`app` :** The [AppHandle](https://docs.rs/tauri/latest/tauri/struct.AppHandle.html) of the application.
2. **`args` :** The list of arguments, that was passed by the user to initiate this new instance.
3. **`cwd` :** The Current Working Directory denotes the directory from which the new application instance was launched.

2. **`args` :** The list of arguments, that was passed by the user to initiate this new instance.

3. **`cwd` :** The Current Working Directory denotes the directory from which the new application instance was launched.
</Steps>
</Steps>

So, the closure should look like below

Expand Down

0 comments on commit d2cff67

Please sign in to comment.