@@ -4,7 +4,7 @@ A docsify plugin is a function with the ability to execute custom JavaScript cod
4
4
5
5
## Setup
6
6
7
- Docsify plugins can be added directly to the ` plugins ` array.
7
+ Docsify plugins can be added directly to the ` plugins ` array:
8
8
9
9
``` js
10
10
window .$docsify = {
@@ -19,7 +19,7 @@ window.$docsify = {
19
19
};
20
20
```
21
21
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:
23
23
24
24
``` js
25
25
(function () {
@@ -98,7 +98,7 @@ Lifecycle hooks are provided via the `hook` argument passed to the plugin functi
98
98
99
99
### init()
100
100
101
- Invoked one time when docsify script is initialized
101
+ Invoked one time when docsify script is initialized.
102
102
103
103
``` js
104
104
hook .init (function () {
@@ -108,7 +108,7 @@ hook.init(function () {
108
108
109
109
### mounted()
110
110
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.
112
112
113
113
``` js
114
114
hook .mounted (function () {
@@ -118,7 +118,7 @@ hook.mounted(function () {
118
118
119
119
### beforeEach()
120
120
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.
122
122
123
123
``` js
124
124
hook .beforeEach (function (markdown ) {
@@ -143,7 +143,7 @@ hook.beforeEach(function (markdown, next) {
143
143
144
144
### afterEach()
145
145
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.
147
147
148
148
``` js
149
149
hook .afterEach (function (html ) {
@@ -161,14 +161,14 @@ hook.afterEach(function (html, next) {
161
161
} catch (err) {
162
162
// ...
163
163
} finally {
164
- next (markdown );
164
+ next (html );
165
165
}
166
166
});
167
167
```
168
168
169
169
### doneEach()
170
170
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.
172
172
173
173
``` js
174
174
hook .doneEach (function () {
@@ -178,7 +178,7 @@ hook.doneEach(function () {
178
178
179
179
### ready()
180
180
181
- Invoked one time after rendering the initial page
181
+ Invoked one time after rendering the initial page.
182
182
183
183
``` js
184
184
hook .ready (function () {
0 commit comments