Skip to content

Commit 9e6a3e6

Browse files
docs: Minor fixes to plugin docs (#1774)
1 parent 6f4f09b commit 9e6a3e6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/write-a-plugin.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A docsify plugin is a function with the ability to execute custom JavaScript cod
44

55
## Setup
66

7-
Docsify plugins can be added directly to the `plugins` array.
7+
Docsify plugins can be added directly to the `plugins` array:
88

99
```js
1010
window.$docsify = {
@@ -19,7 +19,7 @@ window.$docsify = {
1919
};
2020
```
2121

22-
Alternatively, a plugin can be stored in a separate file and "installed" using a standard `<script>` tag.
22+
Alternatively, a plugin can be stored in a separate file and "installed" using a standard `<script>` tag:
2323

2424
```js
2525
(function () {
@@ -98,7 +98,7 @@ Lifecycle hooks are provided via the `hook` argument passed to the plugin functi
9898

9999
### init()
100100

101-
Invoked one time when docsify script is initialized
101+
Invoked one time when docsify script is initialized.
102102

103103
```js
104104
hook.init(function () {
@@ -108,7 +108,7 @@ hook.init(function () {
108108

109109
### mounted()
110110

111-
Invoked one time when the docsify instance has mounted on the DOM
111+
Invoked one time when the docsify instance has mounted on the DOM.
112112

113113
```js
114114
hook.mounted(function () {
@@ -118,7 +118,7 @@ hook.mounted(function () {
118118

119119
### beforeEach()
120120

121-
Invoked on each page load before new markdown is transformed to HTML
121+
Invoked on each page load before new markdown is transformed to HTML.
122122

123123
```js
124124
hook.beforeEach(function (markdown) {
@@ -143,7 +143,7 @@ hook.beforeEach(function (markdown, next) {
143143

144144
### afterEach()
145145

146-
Invoked on each page load after new markdown has been transformed to HTML
146+
Invoked on each page load after new markdown has been transformed to HTML.
147147

148148
```js
149149
hook.afterEach(function (html) {
@@ -161,14 +161,14 @@ hook.afterEach(function (html, next) {
161161
} catch (err) {
162162
// ...
163163
} finally {
164-
next(markdown);
164+
next(html);
165165
}
166166
});
167167
```
168168

169169
### doneEach()
170170

171-
Invoked on each page load after new HTML has been appended to the DOM
171+
Invoked on each page load after new HTML has been appended to the DOM.
172172

173173
```js
174174
hook.doneEach(function () {
@@ -178,7 +178,7 @@ hook.doneEach(function () {
178178

179179
### ready()
180180

181-
Invoked one time after rendering the initial page
181+
Invoked one time after rendering the initial page.
182182

183183
```js
184184
hook.ready(function () {

0 commit comments

Comments
 (0)