@jhuix/showdowns 0.6.15 → 0.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -256,6 +256,8 @@ Table header can be eliminated.
256
256
 
257
257
  [ABCJS](https://github.com/jhuix/showdowns/blob/master/docs/showdowns-features.md#abc)
258
258
 
259
+ [Kroki](https://github.com/jhuix/showdowns/blob/master/docs/showdowns-features.md#kroki)
260
+
259
261
  See more information, refer to the following document:
260
262
 
261
263
  [Extensions Examples](https://github.com/jhuix/showdowns/blob/master/docs/showdowns-features.md)
@@ -377,7 +379,7 @@ Put the following line into your HTML page \<header> or \<body>:
377
379
 
378
380
  #### defaultOptions
379
381
 
380
- Type: {showdown: object, plantuml: object, mermaid: object, vega: object }
382
+ Type: {showdown: object, plantuml: object, mermaid: object, katex: object, kroki: object, vega: object }
381
383
 
382
384
  Default options is described below:
383
385
 
@@ -385,6 +387,7 @@ Default options is described below:
385
387
  showdown: {
386
388
  flavor: 'github',
387
389
  },
390
+ toc: { chapterNumber: true, title: '', toc: '[\\[【]Table[ -]Of[ -]Contents[\\]】]|[\\[【]目录[\\]】]|[\\[【]TOC[\\]】]|\\{\\{TOC\\}\\}' },
388
391
  plantuml: { imageFormat: 'svg' },
389
392
  mermaid: { theme: 'default' },
390
393
  katex: { mathDelimiters: [
@@ -399,6 +402,7 @@ Default options is described below:
399
402
  { left: '@@', right: '@@', display: true, asciimath: true },
400
403
  { left: "\\$", right: "\\$", display: false, asciimath: true }
401
404
  ]},
405
+ kroki: { serverUrl: 'kroki.io' },
402
406
  vega: { theme: 'vox' }
403
407
  };
404
408
 
@@ -408,6 +412,21 @@ Default options is described below:
408
412
 
409
413
  [Showdown Options](https://github.com/showdownjs/showdown/blob/master/README.md#options)
410
414
 
415
+ - toc: table of content options object
416
+
417
+ For more toc options:
418
+
419
+ {
420
+ chapterNumber: true,
421
+ title: '',
422
+ toc: '[\\[【]Table[ -]Of[ -]Contents[\\]】]|[\\[【]目录[\\]】]|[\\[【]TOC[\\]】]|\\{\\{TOC\\}\\}'
423
+ }
424
+
425
+ `chapterNumber` - Whether show chapter number such as '1.1.', default is true.
426
+ `title` - Custom defined text content of title, default is empty string indicates auto recognition based on the language(such as '目录' on chinese, 'Table Of Contents' on other language).
427
+ `toc` - Custom defined regex string of test for table of contents.
428
+
429
+
411
430
  - plantuml: plantuml options object
412
431
 
413
432
  For more plantuml options:
@@ -430,7 +449,7 @@ Default options is described below:
430
449
  [Katex AutoRender Options](https://katex.org/docs/autorender.html#api)
431
450
  [Katex Render Options](https://katex.org/docs/options.html)
432
451
 
433
- In addition, mathDelimiters is another format::
452
+ In addition, mathDelimiters is another format:
434
453
 
435
454
  {
436
455
  mathDelimiters: {
@@ -450,6 +469,15 @@ Default options is described below:
450
469
  }
451
470
  }
452
471
 
472
+ - kroki: kroki options object
473
+
474
+ For more kroki options:
475
+
476
+ {
477
+ serverUrl: "kroki.io",
478
+ imageFormat: "svg"
479
+ }
480
+
453
481
  - vega: vega-embed options object
454
482
 
455
483
  For more vega-embed options, refer to the following document:
@@ -463,11 +491,11 @@ Type: Array of showdown extensions
463
491
  Default extensions is described below:
464
492
 
465
493
  defaultExtensions = {
466
- 'showdown-toc': showdownToc,
467
- 'showdown-align': showdownAlign,
468
- 'showdown-footnotes': showdownFootnotes,
469
- 'showdown-container': showdownContainer,
470
- 'showdown-sequence': showdownSequence
494
+ 'showdown-toc': showdownToc(),
495
+ 'showdown-align': showdownAlign(),
496
+ 'showdown-footnotes': showdownFootnotes(),
497
+ 'showdown-container': showdownContainer(),
498
+ 'showdown-sequence': showdownSequence()
471
499
  }
472
500
 
473
501
  For more showdown extensions, refer to the following document:
@@ -481,16 +509,20 @@ Type: Array of showdown async extensions
481
509
  Default async extensions is described below:
482
510
 
483
511
  defaultAsyncExtensions = {
484
- 'showdown-plantuml': showdownPlantuml(plantumlOptions),
485
- 'showdown-mermaid': showdownMermaid(mermaidOptions),
486
- 'showdown-katex': showdownKatex(katexOptions),
487
- 'showdown-flowchart': showdownFlowchart,
488
- 'showdown-viz': showdownViz,
512
+ 'showdown-toc': getExtension('showdown-toc', showdownToc),
513
+ 'showdown-plantuml': showdownPlantuml(plantumlOptions()),
514
+ 'showdown-mermaid': showdownMermaid(mermaidOptions()),
515
+ 'showdown-katex': showdownKatex(katexOptions()),
516
+ 'showdown-kroki': showdownKroki(krokiOptions()),
517
+ 'showdown-flowchart': showdownFlowchart(),
518
+ 'showdown-viz': showdownViz(),
489
519
  'showdown-vega': showdownVega(vegaOptions),
490
- 'showdown-wavedrom': showdownWavedrom,
491
- 'showdown-railroad': showdownRailroad,
492
- 'showdown-abc': showdownAbc,
493
- 'showdown-echarts': showdownEcharts,
520
+ 'showdown-wavedrom': showdownWavedrom(),
521
+ 'showdown-railroad': showdownRailroad(),
522
+ 'showdown-abc': showdownAbc(),
523
+ 'showdown-echarts': showdownEcharts(),
524
+ 'showdown-sequence': getExtension('showdown-sequence', showdownSequence),
525
+ 'showdow-css': showdownCss(),
494
526
  }
495
527
 
496
528
  ### Properties
@@ -577,6 +609,16 @@ A function to set default options of showdown. When showdown.convertor instance
577
609
 
578
610
  See [showdown options of defaultOptions](#defaultoptions).
579
611
 
612
+ #### setExtensionlOptions
613
+
614
+ Type: (name: string, options: object) => boolean
615
+
616
+ A function to set default options of extension. It can reset new options of extension.
617
+
618
+ - Parameter `name` is suffix name of extension name, such as `showdown-[name]`.
619
+
620
+ See [options of extension](#defaultoptions).
621
+
580
622
  #### setPlantumlOptions
581
623
 
582
624
  Type: (options: object) => object
@@ -605,6 +647,14 @@ A function to set default options of katex extension. When showdown.convertor in
605
647
 
606
648
  See [katex options of defaultOptions](#defaultoptions).
607
649
 
650
+ #### setKrokiOptions
651
+
652
+ Type: (options: object) => object
653
+
654
+ A function to set default options of kroki extension. When showdown.convertor instance be created, it can reset kroki extension using the new default options.
655
+
656
+ See [Kroki options of defaultOptions](#defaultoptions).
657
+
608
658
  #### setVegaOptions
609
659
 
610
660
  Type: (options: object) => object
@@ -1,17 +1,17 @@
1
1
  /*!
2
- * css of showdowns v0.6.15
2
+ * css of showdowns v0.6.16
3
3
  * Copyright (c) 2019-present, Jhuix (Hui Jin) <jhuix0117@gmail.com>
4
4
  * Released under the MIT License.
5
5
  */.showdowns{flex-grow:1;margin-left:1rem;min-width:300px;position:relative}.showdowns blockquote,.showdowns dd,.showdowns div,.showdowns dl,.showdowns dt,.showdowns form,.showdowns h1,.showdowns h2,.showdowns h3,.showdowns h4,.showdowns h5,.showdowns h6,.showdowns li,.showdowns ol,.showdowns p,.showdowns pre,.showdowns td,.showdowns th,.showdowns ul{margin:0;padding:0}.showdowns div.paragraph.align-right,.showdowns h1.align-right,.showdowns h2.align-right,.showdowns h3.align-right,.showdowns h4.align-right,.showdowns h5.align-right,.showdowns h6.align-right,.showdowns li.align-right,.showdowns p.align-right{text-align:right}.showdowns div.paragraph.align-center,.showdowns h1.align-center,.showdowns h2.align-center,.showdowns h3.align-center,.showdowns h4.align-center,.showdowns h5.align-center,.showdowns h6.align-center,.showdowns li.align-center,.showdowns p.align-center{text-align:center}.showdowns a{color:#0366d6;line-height:inherit;text-decoration:none}.showdowns a img{border:none}.showdowns a:hover{cursor:pointer;text-decoration:underline}.showdowns img{-ms-interpolation-mode:bicubic;display:inherit;height:auto;margin:0 auto;max-width:100%}.showdowns p{font-family:inherit;font-size:1em;font-weight:400;line-height:1.5;margin-bottom:1.25em;text-rendering:optimizeLegibility}.showdowns p.lead{font-size:1.21875em;line-height:1.5}.showdowns p aside{font-size:.875em;font-style:italic;line-height:1.5}.showdowns h1,.showdowns h2,.showdowns h3,.showdowns h4,.showdowns h5,.showdowns h6{font-style:normal;font-weight:600;line-height:1.25;margin-bottom:1rem;margin-top:1.5rem;text-rendering:optimizeLegibility}.showdowns h1 small,.showdowns h2 small,.showdowns h3 small,.showdowns h4 small,.showdowns h5 small,.showdowns h6 small{font-size:60%;line-height:0}.showdowns h1,.showdowns h2{border-bottom:1px solid #d6d6d6;padding-bottom:.3em}.showdowns h1{font-size:3.2rem}.showdowns h2{font-size:2.8rem}.showdowns h3{font-size:2.4rem}.showdowns h4{font-size:2rem}.showdowns h5{font-size:1.8rem}.showdowns h6{color:#6a737d;font-size:1.6rem}.showdowns .subheader{color:#6f6f6f;font-weight:400;line-height:1.4;margin-bottom:.5em;margin-top:.2em}.showdowns hr{border:solid #ddd;border-width:1px 0 0;clear:both;height:0;margin:1.25em 0 1.1875em}.showdowns em,.showdowns i{font-style:italic;line-height:inherit}.showdowns b,.showdowns strong{font-weight:600;line-height:inherit}.showdowns small{font-size:60%;line-height:inherit}.showdowns code{border-style:solid;border-width:1px;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-weight:400;padding:.125em .3125em .0625em}.showdowns dl,.showdowns ol,.showdowns ul{font-family:inherit;font-size:1em;line-height:1.5;list-style-position:outside;margin-bottom:1.25em}.showdowns ul{margin-left:1.1em}.showdowns ul.no-bullet{margin-left:0}.showdowns ul.no-bullet li ol,.showdowns ul.no-bullet li ul{list-style:none;margin-bottom:0;margin-left:1.25em}.showdowns ul li ol,.showdowns ul li ul{margin-bottom:0;margin-left:1.25em}.showdowns ul.circle li ul,.showdowns ul.disc li ul,.showdowns ul.square li ul{list-style:inherit}.showdowns ul.square{list-style-type:square;margin-left:1.1em}.showdowns ul.circle{list-style-type:circle;margin-left:1.1em}.showdowns ul.disc{list-style-type:disc;margin-left:1.1em}.showdowns ul.no-bullet{list-style:none}.showdowns ol{margin-left:1.4em}.showdowns ol li ol,.showdowns ol li ul{margin-bottom:0;margin-left:1.25em}.showdowns dl dt{font-weight:600;margin-bottom:.3em}.showdowns dl dd{margin-bottom:.75em}.showdowns abbr,.showdowns acronym{color:#222;cursor:help;font-size:90%;text-transform:uppercase}.showdowns abbr{text-transform:none}.showdowns abbr[title]{border-bottom:1px dotted #5c5c5c}.showdowns blockquote{border-left:4px solid #d6d6d6;color:#5c5c5c;line-height:1.5;margin:0 0 16px;padding:0 15px}.showdowns blockquote cite{color:#555;display:block;font-size:.8125em}.showdowns blockquote cite:before{content:"\2014 \0020"}.showdowns blockquote cite a,.showdowns blockquote cite a:visited{color:#555}.showdowns pre{word-wrap:break-word;border:1px solid #dfdfdf;margin-bottom:1.5em;margin-top:1.5em;padding:.125em .3125em .0625em;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap}.showdowns pre code{background-color:transparent;border:0;padding:0}.showdowns table{background:#fff;border-collapse:collapse;border-spacing:0;margin-bottom:1.25em;overflow:auto;table-layout:auto}.showdowns table caption{background:transparent;color:#222;font-weight:600}.showdowns table thead{background:#f5f5f5}.showdowns table thead tr td,.showdowns table thead tr th{border:1px solid #d6d6d6;color:#222;font-weight:600;line-height:1.125em;padding:.5em .625em .625em}.showdowns table tfoot{background:#f5f5f5}.showdowns table tfoot tr td,.showdowns table tfoot tr th{border:1px solid #d6d6d6;color:#222;font-weight:600;line-height:1.125em;padding:.5em .625em .625em}.showdowns table tr td,.showdowns table tr th{border:1px solid #d6d6d6;color:#222;line-height:1.125em;padding:.5625em .625em}.showdowns table tr.alt,.showdowns table tr.even,.showdowns table tr:nth-of-type(2n){background:#f9f9f9}.showdowns table tbody tr td,.showdowns table tbody tr th{border:1px solid #d6d6d6;line-height:1.125em}.showdowns .flow,.showdowns .flowchart,.showdowns .mermaid,.showdowns .plantuml,.showdowns .sequence,.showdowns .wavedrom{background-color:#f9f9f9}.showdowns .diagram-center:not(.asciimath):not(.latex):not(.mermaid){display:flex;justify-content:center;margin:auto}.showdowns .diagram-right:not(.asciimath):not(.latex):not(.mermaid){display:flex;justify-content:right;margin:auto 0 auto auto}.showdowns .diagram-center.mermaid{text-align:center}.showdowns .diagram-right.mermaid{text-align:right}.showdowns .asciimath:not(.diagram-center):not(.diagram-right) .katex,.showdowns .asciimath:not(.diagram-center):not(.diagram-right) .katex-display,.showdowns .latex:not(.diagram-center):not(.diagram-right) .katex,.showdowns .latex:not(.diagram-center):not(.diagram-right) .katex-display{text-align:unset}.showdowns .asciimath.diagram-center .katex,.showdowns .asciimath.diagram-center .katex-display,.showdowns .latex.diagram-center .katex,.showdowns .latex.diagram-center .katex-display{text-align:center}.showdowns .asciimath.diagram-right .katex,.showdowns .asciimath.diagram-right .katex-display,.showdowns .latex.diagram-right .katex,.showdowns .latex.diagram-right .katex-display{text-align:right}
6
6
 
7
7
  /*!
8
- * css of showdowns v0.6.15
8
+ * css of showdowns v0.6.16
9
9
  * Copyright (c) 2019-present, Jhuix (Hui Jin) <jhuix0117@gmail.com>
10
10
  * Released under the MIT License.
11
11
  */.showdowns .showdown-container{border:1px solid #eee;border-radius:.25rem;margin-bottom:1rem;padding:.75rem 1.25rem;position:relative}.showdowns .showdown-container.container{border-left-width:.25rem;border-right-width:.25rem}.showdowns .showdown-container.container.tip{border-left-color:#5bc0de;border-right-color:#5bc0de}.showdowns .showdown-container.container.info{border-left-color:#cce5ff;border-right-color:#cce5ff}.showdowns .showdown-container.container.warning{border-left-color:#f0ad4e;border-right-color:#f0ad4e}.showdowns .showdown-container.container.error{border-left-color:#d9534f;border-right-color:#d9534f}.showdowns .showdown-container.container.success{border-left-color:#67c23a;border-right-color:#67c23a}.showdowns .showdown-container.alert{border:1px solid transparent;transition:opacity .2s}.showdowns .showdown-container.alert.alert-tip{background-color:#5bc0de}.showdowns .showdown-container.alert.alert-info{background-color:#cce5ff}.showdowns .showdown-container.alert.alert-warning{background-color:#f0ad4e}.showdowns .showdown-container.alert.alert-error{background-color:#d9534f}.showdowns .showdown-container.alert.alert-success{background-color:#67c23a}.showdowns .showdown-container .container-title{font-size:1.25rem;font-weight:700;line-height:1.2}
12
12
 
13
13
  /*!
14
- * css of showdowns v0.6.15
14
+ * css of showdowns v0.6.16
15
15
  * Copyright (c) 2019-present, Jhuix (Hui Jin) <jhuix0117@gmail.com>
16
16
  * Released under the MIT License.
17
- */.hidden{display:none!important}.divider{align-items:center;background:#d2d2d2;cursor:col-resize;display:none;justify-content:center;position:relative;transition:background .3s;width:2px}.divider:hover{background:#f59102}.icon{fill:currentColor;height:1em;overflow:hidden;vertical-align:-.15em;width:1em}.toc-switch{box-sizing:border-box;color:#3e69d7;cursor:pointer;font-size:3rem;overflow:hidden;position:fixed;right:2rem;text-align:center;top:0;transition:height .2s linear;z-index:110}.total-toc{-moz-column-break-after:page;box-sizing:border-box;break-after:page;display:flex;flex-direction:column;flex-shrink:0;order:-1;page-break-after:always;width:100%}.total-toc .toc-view ul li div i:not(.toc-chapter){cursor:pointer}.showdown-toc .toc-pin{align-items:center;border-bottom:1px solid #d2d2d2;display:flex;flex-direction:row;flex-shrink:0;font-size:2rem;overflow:hidden;padding:1rem}.showdown-toc .toc-pin-text{font-weight:700;margin-right:8px;white-space:nowrap}.showdown-toc .toc-fold-wrap{align-items:center;display:flex;flex-grow:1;justify-content:flex-start;position:relative}.showdown-toc .toc-icon{background-position:50%;background-repeat:no-repeat;cursor:pointer}.showdown-toc .toc-close{margin-left:auto}.showdown-toc .toc-icon:hover{color:#0089ff}.showdown-toc .toc-view{overflow:auto}.showdown-toc .toc-view .toc-chapter{color:#0089ff}.showdown-toc .toc-view ul{display:block;margin-left:2rem;padding-left:0;position:relative}.showdown-toc .toc-view ul li{box-sizing:border-box;display:flex;flex-direction:column;list-style:none;width:100%}.showdown-toc .toc-view ul li div{display:flex;flex-direction:row}.showdown-toc .toc-view ul li div i{align-items:center;display:inline-flex;margin-left:0;position:relative}.showdown-toc .toc-view ul li div a{color:currentColor;cursor:pointer;font-size:1.4rem;padding:.6rem;text-decoration:none;white-space:nowrap}.showdown-toc .toc-view ul li div:hover a,.showdown-toc .toc-view ul li div:hover i{color:#f59102}.showdown-toc .toc-view ul li div:hover a{border-radius:.5rem}.showdown-toc .toc-view ul li div:focus a,.showdown-toc .toc-view ul li div:focus i{color:#0089ff}.showdown-toc .toc-view ul li div:focus a{border-radius:.5rem}.showdown-toc .toc-view ul ul{margin-top:.24rem}.showdown-toc .toc-view .toc-multi-title{font-weight:600}.showdown-toc .toc-view .toc-title-1{font-size:1.6rem;font-weight:800}.main-toc-row{border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;flex-grow:1}.main-toc-row .toc-view{flex-grow:1}.toc-view::-webkit-scrollbar-thumb{background-color:#f59102}@media not print{.main-toc-row{flex-direction:row}.main-toc-row .total-toc{background:#ffffffd2;border-radius:10px;box-shadow:0 5px 11px #3333;box-sizing:border-box;margin-right:12px;max-height:100vh;max-width:50%;min-height:300px;min-width:256px;overflow:hidden;position:fixed;right:0;top:0;transition:all .3s;white-space:nowrap;width:25%;z-index:11}.main-toc-row .toc-view{overflow:auto}}@media print{.main-toc-row .total-toc{max-width:unset!important;order:-1!important;overflow:unset!important;width:100%!important}}.showdown-toc .toc-view{display:flex;width:100%}.showdown-toc .toc-view .toc-main{flex-grow:1;margin-left:1rem}.main-toc-column{display:flex;flex-direction:column;flex-grow:1;overflow:hidden}
17
+ */.hidden{display:none!important}.divider{align-items:center;background:#d2d2d2;cursor:col-resize;display:none;justify-content:center;position:relative;transition:background .3s;width:2px}.divider:hover{background:#f59102}.icon{fill:currentColor;height:1em;overflow:hidden;vertical-align:-.15em;width:1em}.toc-switch{box-sizing:border-box;color:#3e69d7;cursor:pointer;font-size:3rem;overflow:hidden;position:fixed;right:2rem;text-align:center;top:0;transition:height .2s linear;z-index:110}.total-toc{-moz-column-break-after:page;box-sizing:border-box;break-after:page;display:flex;flex-direction:column;flex-shrink:0;order:-1;page-break-after:always;width:100%}.total-toc .toc-view ul li div i:not(.toc-chapter){cursor:pointer}.showdown-toc .toc-pin{align-items:center;border-bottom:1px solid #d2d2d2;display:flex;flex-direction:row;flex-shrink:0;font-size:2rem;overflow:hidden;padding:1rem}.showdown-toc .toc-pin-text{font-weight:700;margin-right:8px;white-space:nowrap}.showdown-toc .toc-fold-wrap{align-items:center;display:flex;flex-grow:1;justify-content:flex-start;position:relative}.showdown-toc .toc-icon{background-position:50%;background-repeat:no-repeat;cursor:pointer}.showdown-toc .toc-close{margin-left:auto}.showdown-toc .toc-icon:hover{color:#0089ff}.showdown-toc .toc-view{overflow:auto}.showdown-toc .toc-view .toc-chapter{color:#0089ff}.showdown-toc .toc-view ul{display:block;margin-left:2rem;padding-left:0;position:relative}.showdown-toc .toc-view ul li{box-sizing:border-box;display:flex;flex-direction:column;list-style:none;width:100%}.showdown-toc .toc-view ul li div{display:flex;flex-direction:row}.showdown-toc .toc-view ul li div i{align-items:center;display:inline-flex;margin-left:0;position:relative}.showdown-toc .toc-view ul li div a{color:currentColor;cursor:pointer;font-size:1.4rem;padding:.6rem;text-decoration:none;white-space:nowrap}.showdown-toc .toc-view ul li div:hover a,.showdown-toc .toc-view ul li div:hover i{color:#f59102}.showdown-toc .toc-view ul li div:hover a{border-radius:.5rem}.showdown-toc .toc-view ul li div:focus a,.showdown-toc .toc-view ul li div:focus i{color:#0089ff}.showdown-toc .toc-view ul li div:focus a{border-radius:.5rem}.showdown-toc .toc-view ul ul{margin-top:.24rem}.showdown-toc .toc-view .toc-multi-title{font-weight:600}.showdown-toc .toc-view .toc-title-1{font-size:1.6rem;font-weight:800}.main-toc-row{display:flex;flex-direction:column;flex-grow:1}.main-toc-row .toc-view{flex-grow:1}.toc-view::-webkit-scrollbar-thumb{background-color:#f59102}@media not print{.main-toc-row{flex-direction:row}.main-toc-row .total-toc{background:#ffffffd2;border-radius:10px;box-shadow:0 5px 11px #3333;box-sizing:border-box;margin-right:12px;max-height:100vh;max-width:50%;min-height:300px;min-width:256px;overflow:hidden;position:fixed;right:0;top:0;transition:all .3s;white-space:nowrap;width:25%;z-index:11}.main-toc-row .toc-view{overflow:auto}}@media print{.main-toc-row .total-toc{max-width:unset!important;order:-1!important;overflow:unset!important;width:100%!important}}.showdown-toc .toc-view{display:flex;width:100%}.showdown-toc .toc-view .toc-main{flex-grow:1;margin-left:1rem}.main-toc-column{display:flex;flex-direction:column;flex-grow:1;overflow:hidden}