Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 57d16fb

Browse files
Update README.md
1 parent 51ac2e4 commit 57d16fb

File tree

1 file changed

+41
-6
lines changed

1 file changed

+41
-6
lines changed

docs/README.md

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Convert your _docs_ folder into a pretty docs website using [DocsifyJS](https://
1818
- [DocsifyJS Template](https://michaelcurrin.github.io/docsify-js-template/) project.
1919
- [MkDocs Quickstart](https://michaelcurrin.github.io/mkdocs-quickstart/) project - as an alternative to Docsify, try this demo / tutorial / template around MkDocs.
2020

21-
## Github repos
21+
### Github repos
2222

2323
- Docsify - [docsifyjs/docsify](https://github.com/docsifyjs/docsify)
2424
- Docsify CLI - [docsifyjs/docsify-cli](https://github.com/docsifyjs/docsify-cli)
@@ -370,7 +370,6 @@ Note: The _Buble_ theme has sidebar headings which are not distinguished from th
370370

371371
### 6.3 More styling
372372

373-
374373
You can easily reuse the theme color set early:
375374

376375
```css
@@ -469,15 +468,51 @@ Add this to the `head` tag in `index.html`.
469468
<link rel="icon" href="_media/favicon.ico">
470469
```
471470

471+
#### Add scripts
472+
473+
To run your own script tags, you must enable it with a parameter.
474+
475+
- `index.html
476+
```javascript
477+
window.$docsify = {
478+
executeScript: true,
479+
}
480+
```
481+
- `page.md`
482+
```html
483+
<script>
484+
console.log('My script');
485+
</script>
486+
```
487+
488+
Note that Vue is enabled by default.
489+
490+
See [executeScript](https://docsify.js.org/#/configuration?id=executescript) in the docs for more info.
491+
492+
If you want to run an external script, using the [External script plugin](#add-plugins).
493+
494+
- `index.html`
495+
```html
496+
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/external-script.min.js"></script>
497+
```
498+
- `page.md`
499+
```html
500+
<script src="main.js"></script>
501+
```
502+
503+
Note that this does _not_ support embedding gists, even if use `executeScript`. There is a JS error on running `document.write` on an asynchronously loaded script.
504+
472505
#### Add plugins
473506

474507
Optionally add plugins to extend your site. This is typically done by adding a JS link at the bottom of your `index.html` page.
475508

476-
Here is a narrowed down list of plugins I use or plan to use:
509+
Here is a narrowed down list of plugins of interest:
477510

478-
- [External script](https://docsify.js.org/#/plugins?id=external-script) - If the script on the page is an external one (imports a js file via src attribute), you'll need this plugin to make it work.
479-
- [Google Analytics](https://docsify.js.org/#/plugins?id=google-analytics) - Configure the app with your GA ID to add tracking.
480-
- [Tabs](https://docsify.js.org/#/plugins?id=tabs) - A docsify.js plugin for displaying tabbed content from markdown.
511+
Plugin | Description
512+
--- | ---
513+
[External script](https://docsify.js.org/#/plugins?id=external-script) | You need thus plugin if you want to place a `script` tag on the page that loads a `.js` script.
514+
[Google Analytics](https://docsify.js.org/#/plugins?id=google-analytics) | Configure the app with your GA ID to add tracking.
515+
[Tabs](https://docsify.js.org/#/plugins?id=tabs) | A Docsify.js plugin for displaying tabbed content from markdown.
481516

482517
Also of interest:
483518
- For pulling in JSON data and not just markdown files:

0 commit comments

Comments
 (0)