Skip to content

Commit

Permalink
Revert "docs: Minor fixes to plugin docs (#1774)"
Browse files Browse the repository at this point in the history
This reverts commit 5f24f07.
  • Loading branch information
Koooooo-7 authored Oct 26, 2022
1 parent b49ec04 commit d2961b6
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(html);
next(markdown);
}
});
```

### 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

0 comments on commit d2961b6

Please sign in to comment.