Skip to content

Commit 63b2535

Browse files
feat: Plugin error handling (#1742)
1 parent 716a48e commit 63b2535

File tree

7 files changed

+495
-99
lines changed

7 files changed

+495
-99
lines changed

docs/configuration.md

+35-28
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ window.$docsify = {
365365

366366
## autoHeader
367367

368-
- type: `Boolean`
368+
- Type: `Boolean`
369369

370370
If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to HTML. See [#78](https://github.com/docsifyjs/docsify/issues/78).
371371

@@ -378,7 +378,7 @@ window.$docsify = {
378378

379379
## executeScript
380380

381-
- type: `Boolean`
381+
- Type: `Boolean`
382382

383383
Execute the script on the page. Only parse the first script tag ([demo](themes)). If Vue is present, it is turned on by default.
384384

@@ -400,8 +400,8 @@ Note that if you are running an external script, e.g. an embedded jsfiddle demo,
400400

401401
## nativeEmoji
402402

403-
- type: `Boolean`
404-
- default: `false`
403+
- Type: `Boolean`
404+
- Default: `false`
405405

406406
Render emoji shorthand codes using GitHub-style emoji images or platform-native emoji characters.
407407

@@ -453,8 +453,8 @@ To render shorthand codes as text, replace `:` characters with the `:` HTM
453453

454454
## noEmoji
455455

456-
- type: `Boolean`
457-
- default: `false`
456+
- Type: `Boolean`
457+
- Default: `false`
458458

459459
Disabled emoji parsing and render all emoji shorthand as text.
460460

@@ -492,7 +492,7 @@ To disable emoji parsing of individual shorthand codes, replace `:` characters w
492492

493493
## mergeNavbar
494494

495-
- type: `Boolean`
495+
- Type: `Boolean`
496496

497497
Navbar will be merged with the sidebar on smaller screens.
498498

@@ -504,7 +504,7 @@ window.$docsify = {
504504

505505
## formatUpdated
506506

507-
- type: `String|Function`
507+
- Type: `String|Function`
508508

509509
We can display the file update date through **{docsify-updated<span>}</span>** variable. And format it by `formatUpdated`.
510510
See https://github.com/lukeed/tinydate#patterns
@@ -523,8 +523,8 @@ window.$docsify = {
523523

524524
## externalLinkTarget
525525

526-
- type: `String`
527-
- default: `_blank`
526+
- Type: `String`
527+
- Default: `_blank`
528528

529529
Target to open external links inside the markdown. Default `'_blank'` (new window/tab)
530530

@@ -536,8 +536,8 @@ window.$docsify = {
536536

537537
## cornerExternalLinkTarget
538538

539-
- type:`String`
540-
- default:`_blank`
539+
- Type:`String`
540+
- Default:`_blank`
541541

542542
Target to open external link at the top right corner. Default `'_blank'` (new window/tab)
543543

@@ -549,8 +549,8 @@ window.$docsify = {
549549

550550
## externalLinkRel
551551

552-
- type: `String`
553-
- default: `noopener`
552+
- Type: `String`
553+
- Default: `noopener`
554554

555555
Default `'noopener'` (no opener) prevents the newly opened external page (when [externalLinkTarget](#externallinktarget) is `'_blank'`) from having the ability to control our page. No `rel` is set when it's not `'_blank'`. See [this post](https://mathiasbynens.github.io/rel-noopener/) for more information about why you may want to use this option.
556556

@@ -562,8 +562,8 @@ window.$docsify = {
562562

563563
## routerMode
564564

565-
- type: `String`
566-
- default: `hash`
565+
- Type: `String`
566+
- Default: `hash`
567567

568568
```js
569569
window.$docsify = {
@@ -573,7 +573,7 @@ window.$docsify = {
573573

574574
## crossOriginLinks
575575

576-
- type: `Array`
576+
- Type: `Array`
577577

578578
When `routerMode: 'history'`, you may face cross-origin issues. See [#1379](https://github.com/docsifyjs/docsify/issues/1379).
579579
In Markdown content, there is a simple way to solve it: see extends Markdown syntax `Cross-Origin link` in [helpers](helpers.md).
@@ -586,7 +586,7 @@ window.$docsify = {
586586

587587
## noCompileLinks
588588

589-
- type: `Array<string>`
589+
- Type: `Array<string>`
590590

591591
Sometimes we do not want docsify to handle our links. See [#203](https://github.com/docsifyjs/docsify/issues/203). We can skip compiling of certain links by specifying an array of strings. Each string is converted into to a regular expression (`RegExp`) and the _whole_ href of a link is matched against it.
592592

@@ -598,7 +598,7 @@ window.$docsify = {
598598

599599
## onlyCover
600600

601-
- type: `Boolean`
601+
- Type: `Boolean`
602602

603603
Only coverpage is loaded when visiting the home page.
604604

@@ -610,7 +610,7 @@ window.$docsify = {
610610

611611
## requestHeaders
612612

613-
- type: `Object`
613+
- Type: `Object`
614614

615615
Set the request resource headers.
616616

@@ -634,7 +634,7 @@ window.$docsify = {
634634

635635
## ext
636636

637-
- type: `String`
637+
- Type: `String`
638638

639639
Request file extension.
640640

@@ -646,7 +646,7 @@ window.$docsify = {
646646

647647
## fallbackLanguages
648648

649-
- type: `Array<string>`
649+
- Type: `Array<string>`
650650

651651
List of languages that will fallback to the default language when a page is requested and it doesn't exist for the given locale.
652652

@@ -664,7 +664,7 @@ window.$docsify = {
664664

665665
## notFoundPage
666666

667-
- type: `Boolean` | `String` | `Object`
667+
- Type: `Boolean` | `String` | `Object`
668668

669669
Load the `_404.md` file:
670670

@@ -697,8 +697,8 @@ window.$docsify = {
697697
698698
## topMargin
699699

700-
- type: `Number`
701-
- default: `0`
700+
- Type: `Number`
701+
- Default: `0`
702702

703703
Adds a space on top when scrolling the content page to reach the selected section. This is useful in case you have a _sticky-header_ layout and you want to align anchors to the end of your header.
704704

@@ -710,7 +710,7 @@ window.$docsify = {
710710

711711
## vueComponents
712712

713-
- type: `Object`
713+
- Type: `Object`
714714

715715
Creates and registers global [Vue components](https://vuejs.org/v2/guide/components.html). Components are specified using the component name as the key with an object containing Vue options as the value. Component `data` is unique for each instance and will not persist as users navigate the site.
716716

@@ -743,7 +743,7 @@ window.$docsify = {
743743

744744
## vueGlobalOptions
745745

746-
- type: `Object`
746+
- Type: `Object`
747747

748748
Specifies [Vue options](https://vuejs.org/v2/api/#Options-Data) for use with Vue content not explicitly mounted with [vueMounts](#mounting-dom-elements), [vueComponents](#components), or a [markdown script](#markdown-script). Changes to global `data` will persist and be reflected anywhere global references are used.
749749

@@ -777,7 +777,7 @@ window.$docsify = {
777777

778778
## vueMounts
779779

780-
- type: `Object`
780+
- Type: `Object`
781781

782782
Specifies DOM elements to mount as [Vue instances](https://vuejs.org/v2/guide/instance.html) and their associated options. Mount elements are specified using a [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) as the key with an object containing Vue options as their value. Docsify will mount the first matching element in the main content area each time a new page is loaded. Mount element `data` is unique for each instance and will not persist as users navigate the site.
783783

@@ -808,3 +808,10 @@ window.$docsify = {
808808
{{ count }}
809809
<button @click="count += 1">+</button>
810810
</output>
811+
812+
## catchPluginErrors
813+
814+
- Type: `Boolean`
815+
- Default: `true`
816+
817+
Determines if Docsify should handle uncaught _synchronous_ plugin errors automatically. This can prevent plugin errors from affecting docsify's ability to properly render live site content.

0 commit comments

Comments
 (0)