Skip to content

Commit

Permalink
docs: Minor fixes to plugin docs (#1774)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhildenbiddle authored Mar 19, 2022
1 parent 6f4f09b commit 9e6a3e6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/write-a-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A docsify plugin is a function with the ability to execute custom JavaScript cod

## Setup

Docsify plugins can be added directly to the `plugins` array.
Docsify plugins can be added directly to the `plugins` array:

```js
window.$docsify = {
Expand All @@ -19,7 +19,7 @@ window.$docsify = {
};
```

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

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

### init()

Invoked one time when docsify script is initialized
Invoked one time when docsify script is initialized.

```js
hook.init(function () {
Expand All @@ -108,7 +108,7 @@ hook.init(function () {

### mounted()

Invoked one time when the docsify instance has mounted on the DOM
Invoked one time when the docsify instance has mounted on the DOM.

```js
hook.mounted(function () {
Expand All @@ -118,7 +118,7 @@ hook.mounted(function () {

### beforeEach()

Invoked on each page load before new markdown is transformed to HTML
Invoked on each page load before new markdown is transformed to HTML.

```js
hook.beforeEach(function (markdown) {
Expand All @@ -143,7 +143,7 @@ hook.beforeEach(function (markdown, next) {

### afterEach()

Invoked on each page load after new markdown has been transformed to HTML
Invoked on each page load after new markdown has been transformed to HTML.

```js
hook.afterEach(function (html) {
Expand All @@ -161,14 +161,14 @@ hook.afterEach(function (html, next) {
} catch (err) {
// ...
} finally {
next(markdown);
next(html);
}
});
```

### doneEach()

Invoked on each page load after new HTML has been appended to the DOM
Invoked on each page load after new HTML has been appended to the DOM.

```js
hook.doneEach(function () {
Expand All @@ -178,7 +178,7 @@ hook.doneEach(function () {

### ready()

Invoked one time after rendering the initial page
Invoked one time after rendering the initial page.

```js
hook.ready(function () {
Expand Down

1 comment on commit 9e6a3e6

@vercel
Copy link

@vercel vercel bot commented on 9e6a3e6 Mar 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.