Skip to content

Commit 47f337a

Browse files
committed
Fix style issues
1 parent ad47f80 commit 47f337a

8 files changed

+20
-18
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@
1818
npm-debug.log*
1919
yarn-debug.log*
2020
yarn-error.log*
21+
22+
.obsidian

docs/contribute.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Each guide should have the following structure:
2121
1. Full code example
2222
1. Detailed explanation of the code example
2323

24-
The code block for the full code example must have a title with the file name, for example `title="main.ts"`.
24+
The code block for the full code example must have a title with the filename, for example `title="main.ts"`.
2525

26-
The example must be complete: The reader can copy-paste it into their own editor and run it without modifications.
26+
The example must be complete: the reader can copy-paste it into their own editor and run it without modifications.
2727

2828
For simpler code examples, use [line highlighting](https://docusaurus.io/docs/markdown-features/code-blocks#line-highlighting) to draw the reader's attention to the important parts.
2929

docs/getting-started/create-your-first-plugin.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_position: 10
66

77
This guide walks you through the steps needed to develop a plugin for Obsidian.
88

9-
> If you prefer a video walkthrough, check out [Create Your Own Obsidian Plugin](https://www.youtube.com/watch?v=9lA-jaMNS0k) by [Antone Heyward](https://www.youtube.com/channel/UC9w43btR2UUsfR6ZUf3AlqQ).
9+
> If you prefer a video walk-through, check out [Create Your Own Obsidian Plugin](https://www.youtube.com/watch?v=9lA-jaMNS0k) by [Antone Heyward](https://www.youtube.com/channel/UC9w43btR2UUsfR6ZUf3AlqQ).
1010
1111
:::warning Before you start
1212
**Don't develop plugins in your main vault.** When you develop a plugin, one mistake can lead to unintentional modifications to your vault. You also risk **permanently deleting your vault**.
@@ -68,13 +68,13 @@ Though "Sample Plugin" is probably not the name you had in mind for your plugin.
6868

6969
The plugin manifest, `manifest.json` is a file that contains information about your plugin, such as its name and version.
7070

71-
1. Open the `obsidian-instant-coffee` directory that has been created, in a code editor, such as [Visual Studio Code](https://code.visualstudio.com/).
71+
1. Open the `obsidian-instant-coffee` directory in a code editor, such as [Visual Studio Code](https://code.visualstudio.com/).
7272
1. Open `manifest.json` in your editor.
7373
1. Change `id` to your plugin ID, for example `obsidian-instant-coffee`.
7474
1. Change `name` to the human-friendly name of the plugin, for example `Instant coffee`.
7575
1. If you'd like, then update `description`, `author`, and `authorUrl` as well.
7676

77-
A plugin is an NodeJS package, which is configured in the `package.json`. You shouldn't need to worry much about it for now. For now, only update it to match the properties in the plugin manifest.
77+
A plugin is also a NodeJS package, which you can configure in the `package.json`. You shouldn't need to worry much about it for now. For now, update it to match the properties in the plugin manifest.
7878

7979
1. Open `package.json` in your editor.
8080
1. Change `name` to match the `id` in `manifest.json`.
@@ -103,4 +103,4 @@ A plugin is an NodeJS package, which is configured in the `package.json`. You sh
103103

104104
Congratulations! 🎉 You've successfully loaded and changed a custom plugin for Obsidian. 🚀
105105

106-
Feel free to modify the code from the sample plugin to see what it does. Once you're ready, learn more about the [anatomy of a plugin](plugin-anatomy).
106+
Feel free to change the code from the sample plugin to see what it does. Once you're ready, learn more about the [anatomy of a plugin](plugin-anatomy).

docs/guides/commands.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ this.addCommand({
5353

5454
## Editor commands
5555

56-
If your command needs access to the editor, you can also use the `editorCallback`, which provides the currently active editor and its view as arguments.
56+
If your command needs access to the editor, you can also use the `editorCallback`, which provides the active editor and its view as arguments.
5757

5858
```ts {4}
5959
this.addCommand({
@@ -94,7 +94,7 @@ this.addCommand({
9494
The user can run commands using a keyboard shortcut, or _hot key_. While they can configure this themselves, you can also provide a default hot key.
9595
9696
:::warning
97-
Avoid setting default hot keys for plugins that are intended to be used by people other than yourself. Hot keys are highly likely to conflict with those defined by other plugins or by the user themselves.
97+
Avoid setting default hot keys for plugins that you intend for others to use. Hot keys are highly likely to conflict with those defined by other plugins or by the user themselves.
9898
:::
9999
100100
In this example, the user can run the command by pressing and holding Ctrl (or Cmd on Mac) and Shift together, and then pressing the letter `a` on their keyboard.

docs/guides/custom-views.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 70
44

55
# Custom views
66

7-
Views determine how Obsidian displays content. The file explorer, graph view, and the Markdown view are all examples of views, but you can also create your own custom custom views that display content in a way that makes sense for your plugin.
7+
Views determine how Obsidian displays content. The file explorer, graph view, and the Markdown view are all examples of views, but you can also create your own custom views that display content in a way that makes sense for your plugin.
88

99
To create a custom view, create a class that extends the `ItemView` interface:
1010

@@ -42,9 +42,9 @@ export class ExampleView extends ItemView {
4242
For more information on how to use the `createEl()` method, refer to [HTML elements](html-elements.md).
4343
:::
4444

45-
Each view is uniquely identified by a text string and many operations require that you specify the view you'd like to modify. Extracting it to a constant, `VIEW_TYPE_EXAMPLE`, is a good idea—as you will see later in this guide.
45+
Each view is uniquely identified by a text string and several operations require that you specify the view you'd like to use. Extracting it to a constant, `VIEW_TYPE_EXAMPLE`, is a good idea—as you will see later in this guide.
4646

47-
- `getViewType()` returns a unique identier for the view.
47+
- `getViewType()` returns a unique identifier for the view.
4848
- `getDisplayText()` returns a human-friendly name for the view.
4949
- `onOpen()` is called when the view is opened within a new leaf and is responsible for building the content of your view.
5050
- `onClose()` is called when the view should close and is responsible for cleaning up any resources used by the view.
@@ -110,7 +110,7 @@ After you've registered a custom view for the plugin, you should to give the use
110110
- Reveals the leaf that contains the custom view.
111111

112112
:::tip
113-
The `activateView()` restricts your plugin to at most one leaf at a time. Try commenting out the call to `detachLeavesOfType()` to allow the user to create multiple leaves. One for every call to `activateView()`.
113+
The `activateView()` restricts your plugin to at most one leaf at a time. Try commenting out the call to `detachLeavesOfType()` to allow the user to create more than one leaf. One for every call to `activateView()`.
114114
:::
115115

116116
How you want the user to activate the custom view is up to you. The example uses a [ribbon action](./ribbon-actions.md), but you can also use a [command](./commands.md).

docs/guides/html-elements.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ book.createEl("small", { text: "Sönke Ahrens" });
4747

4848
## Style your elements
4949

50-
You can add custom CSS styles to your plugin by adding a `styles.css` file in the plugin root directory. Let's add some styles for the previous book example:
50+
You can add custom CSS styles to your plugin by adding a `styles.css` file in the plugin root directory. To add some styles for the previous book example:
5151

5252
```css title="styles.css"
5353
.book {

docs/guides/icons.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Icons
22

3-
Many of the UI components in the Obsidian API lets you configure an accompanying icon. You can choose from one of the many built-in icons, or you can add your own.
3+
Several of the UI components in the Obsidian API lets you configure an accompanying icon. You can choose from one of the built-in icons, or you can add your own.
44

55
## Browse available icons
66

77
If you'd like to see all available icons and their corresponding names, you can install the
8-
[Icon Swapper](https://github.com/mgmeyers/obsidian-icon-swapper) plugin by mgmeyers. While its main purpose is to replace the built-in icons with custom ones, it also serves as a directory of what icons are included in Obsidian.
8+
[Icon Swapper](https://github.com/mgmeyers/obsidian-icon-swapper) plugin by mgmeyers. While its main purpose is to replace the built-in icons with custom ones, it also serves as a list of what icons are available in Obsidian.
99

1010
## Draw icons
1111

docs/guides/settings.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ async onload() {
9292

9393
## Provide default values
9494

95-
When the user enables the plugin for the first time, none of the settings will have been configured yet. The example above provides default values for any missing settings.
95+
When the user enables the plugin for the first time, none of the settings have been configured yet. The preceding example provides default values for any missing settings.
9696

97-
To understand how this work, let's look a little closer at this code:
97+
To understand how this work, let's look at the following code:
9898

9999
```ts
100100
Object.assign(DEFAULT_SETTINGS, await this.loadData())
@@ -168,4 +168,4 @@ Update the settings object whenever the value of the text field changes, and the
168168
})
169169
```
170170

171-
Nice work! 💪 Your users will thank you for giving them a way to customize how they interact with your plugin. Before heading to the next guide, experiment with what you've leared by adding another setting.
171+
Nice work! 💪 Your users will thank you for giving them a way to customize how they interact with your plugin. Before heading to the next guide, experiment with what you've learned by adding another setting.

0 commit comments

Comments
 (0)