You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/contribute.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ Each guide should have the following structure:
21
21
1. Full code example
22
22
1. Detailed explanation of the code example
23
23
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"`.
25
25
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.
27
27
28
28
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.
Copy file name to clipboardexpand all lines: docs/getting-started/create-your-first-plugin.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ sidebar_position: 10
6
6
7
7
This guide walks you through the steps needed to develop a plugin for Obsidian.
8
8
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).
10
10
11
11
:::warning Before you start
12
12
**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.
68
68
69
69
The plugin manifest, `manifest.json` is a file that contains information about your plugin, such as its name and version.
70
70
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/).
72
72
1. Open `manifest.json` in your editor.
73
73
1. Change `id` to your plugin ID, for example `obsidian-instant-coffee`.
74
74
1. Change `name` to the human-friendly name of the plugin, for example `Instant coffee`.
75
75
1. If you'd like, then update `description`, `author`, and `authorUrl` as well.
76
76
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.
78
78
79
79
1. Open `package.json` in your editor.
80
80
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
103
103
104
104
Congratulations! 🎉 You've successfully loaded and changed a custom plugin for Obsidian. 🚀
105
105
106
-
Feelfreetomodifythecodefromthesampleplugintoseewhatitdoes. Onceyou're ready, learn more about the [anatomy of a plugin](plugin-anatomy).
106
+
Feelfreetochangethecodefromthesampleplugintoseewhatitdoes. Onceyou're ready, learn more about the [anatomy of a plugin](plugin-anatomy).
Copy file name to clipboardexpand all lines: docs/guides/commands.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ this.addCommand({
53
53
54
54
## Editor commands
55
55
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.
57
57
58
58
```ts {4}
59
59
this.addCommand({
@@ -94,7 +94,7 @@ this.addCommand({
94
94
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.
95
95
96
96
:::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.
98
98
:::
99
99
100
100
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.
Copy file name to clipboardexpand all lines: docs/guides/custom-views.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ sidebar_position: 70
4
4
5
5
# Custom views
6
6
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.
8
8
9
9
To create a custom view, create a class that extends the `ItemView` interface:
10
10
@@ -42,9 +42,9 @@ export class ExampleView extends ItemView {
42
42
For more information on how to use the `createEl()` method, refer to [HTML elements](html-elements.md).
43
43
:::
44
44
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.
46
46
47
-
-`getViewType()` returns a unique identier for the view.
47
+
-`getViewType()` returns a unique identifier for the view.
48
48
-`getDisplayText()` returns a human-friendly name for the view.
49
49
-`onOpen()` is called when the view is opened within a new leaf and is responsible for building the content of your view.
50
50
-`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
110
110
- Reveals the leaf that contains the custom view.
111
111
112
112
:::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()`.
114
114
:::
115
115
116
116
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).
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:
Copy file name to clipboardexpand all lines: docs/guides/icons.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
# Icons
2
2
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.
4
4
5
5
## Browse available icons
6
6
7
7
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.
Copy file name to clipboardexpand all lines: docs/guides/settings.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -92,9 +92,9 @@ async onload() {
92
92
93
93
## Provide default values
94
94
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.
96
96
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:
@@ -168,4 +168,4 @@ Update the settings object whenever the value of the text field changes, and the
168
168
})
169
169
```
170
170
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