markdown-to-html-cli 3.4.2 → 3.4.3

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.
@@ -1,2 +1,2 @@
1
1
  import { Element, ElementContent } from 'hast';
2
- export declare function markdownStyle(child: ElementContent[], markdownStyleTheme: 'dark' | 'light'): Element[];
2
+ export declare function markdownStyle(child: ElementContent[], markdownStyleTheme?: 'dark' | 'light'): Element[];
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @wcj/markdown-style@1.0.6
2
+ * @wcj/markdown-style@1.0.7
3
3
  * https://github.com/jaywcjlove/markdown-to-html/tree/main/packages/markdown-style
4
4
  */
5
5
  const scriptString = `const __TEMPLATE__ = document.createElement('template');
@@ -12,20 +12,6 @@ __TEMPLATE__.innerHTML = \`
12
12
  :host a:not([href]) { color: inherit; text-decoration: none; } :host .absent { color: var(--color-danger-fg); } :host .anchor { float: left; padding-right: 4px; margin-left: -20px; line-height: 1; } :host .anchor:focus { outline: none; } :host p, :host blockquote, :host ul, :host ol, :host dl, :host table, :host pre, :host details { margin-top: 0; margin-bottom: 16px; } :host blockquote>:first-child { margin-top: 0; } :host blockquote>:last-child { margin-bottom: 0; } :host sup>a::before { content: "["; } :host sup>a::after { content: "]"; } :host h1 .octicon-link, :host h2 .octicon-link, :host h3 .octicon-link, :host h4 .octicon-link, :host h5 .octicon-link, :host h6 .octicon-link { color: var(--color-fg-default); vertical-align: middle; visibility: hidden; } :host h1:hover .anchor, :host h2:hover .anchor, :host h3:hover .anchor, :host h4:hover .anchor, :host h5:hover .anchor, :host h6:hover .anchor { text-decoration: none; } :host h1:hover .anchor .octicon-link, :host h2:hover .anchor .octicon-link, :host h3:hover .anchor .octicon-link, :host h4:hover .anchor .octicon-link, :host h5:hover .anchor .octicon-link, :host h6:hover .anchor .octicon-link { visibility: visible; } :host h1 tt, :host h1 code, :host h2 tt, :host h2 code, :host h3 tt, :host h3 code, :host h4 tt, :host h4 code, :host h5 tt, :host h5 code, :host h6 tt, :host h6 code { padding: 0 .2em; font-size: inherit; } :host ul.no-list, :host ol.no-list { padding: 0; list-style-type: none; } :host ol[type="1"] { list-style-type: decimal; } :host ol[type=a] { list-style-type: lower-alpha; } :host ol[type=i] { list-style-type: lower-roman; } :host div>ol:not([type]) { list-style-type: decimal; } :host ul ul, :host ul ol, :host ol ol, :host ol ul { margin-top: 0; margin-bottom: 0; } :host li>p { margin-top: 16px; } :host li+li { margin-top: .25em; } :host dl { padding: 0; } :host dl dt { padding: 0; margin-top: 16px; font-size: 1em; font-style: italic; font-weight: 600; } :host dl dd { padding: 0 16px; margin-bottom: 16px; } :host table th { font-weight: 600; } :host table th, :host table td { padding: 6px 13px; border: 1px solid var(--color-border-default); } :host table tr { background-color: var(--color-canvas-default); border-top: 1px solid var(--color-border-muted); } :host table tr:nth-child(2n) { background-color: var(--color-canvas-subtle); } :host table img { background-color: transparent; } :host img[align=right] { padding-left: 20px; } :host img[align=left] { padding-right: 20px; } :host .emoji { max-width: none; vertical-align: text-top; background-color: transparent; } :host span.frame { display: block; overflow: hidden; } :host span.frame>span { display: block; float: left; width: auto; padding: 7px; margin: 13px 0 0; overflow: hidden; border: 1px solid var(--color-border-default); } :host span.frame span img { display: block; float: left; } :host span.frame span span { display: block; padding: 5px 0 0; clear: both; color: var(--color-fg-default); } :host span.align-center { display: block; overflow: hidden; clear: both; } :host span.align-center>span { display: block; margin: 13px auto 0; overflow: hidden; text-align: center; } :host span.align-center span img { margin: 0 auto; text-align: center; } :host span.align-right { display: block; overflow: hidden; clear: both; } :host span.align-right>span { display: block; margin: 13px 0 0; overflow: hidden; text-align: right; } :host span.align-right span img { margin: 0; text-align: right; } :host span.float-left { display: block; float: left; margin-right: 13px; overflow: hidden; } :host span.float-left span { margin: 13px 0 0; } :host span.float-right { display: block; float: right; margin-left: 13px; overflow: hidden; } :host span.float-right>span { display: block; margin: 13px auto 0; overflow: hidden; text-align: right; } :host code, :host tt { padding: .2em .4em; margin: 0; font-size: 85%; background-color: var(--color-neutral-muted); border-radius: 6px; } :host code br, :host tt br { display: none; } :host del code { text-decoration: inherit; } :host pre code { font-size: 100%; } :host pre>code { padding: 0; margin: 0; word-break: normal; white-space: pre; background: transparent; border: 0; } :host .highlight { margin-bottom: 16px; } :host .highlight pre { margin-bottom: 0; word-break: normal; } :host .highlight pre, :host pre { position: relative; padding: 16px; overflow: auto; font-size: 85%; line-height: 1.45; background-color: var(--color-canvas-subtle); border-radius: 6px; } :host pre code, :host pre tt { display: inline; max-width: auto; padding: 0; margin: 0; overflow: visible; line-height: inherit; word-wrap: normal; background-color: transparent; border: 0; } :host .csv-data td, :host .csv-data th { padding: 5px; overflow: hidden; font-size: 12px; line-height: 1; text-align: left; white-space: nowrap; } :host .csv-data .blob-num { padding: 10px 8px 9px; text-align: right; background: var(--color-canvas-default); border: 0; } :host .csv-data tr { border-top: 0; } :host .csv-data th { font-weight: 600; background: var(--color-canvas-subtle); border-top: 0; } :host .footnotes { font-size: 12px; color: var(--color-fg-muted); border-top: 1px solid var(--color-border-default); } :host .footnotes ol { padding-left: 16px; } :host .footnotes li { position: relative; } :host .footnotes li:target::before { position: absolute; top: -8px; right: -8px; bottom: -8px; left: -24px; pointer-events: none; content: ""; border: 2px solid var(--color-accent-emphasis); border-radius: 6px; } :host .footnotes li:target { color: var(--color-fg-default); } :host .footnotes .data-footnote-backref g-emoji { font-family: monospace; } :host .task-list-item { list-style-type: none; } :host .task-list-item label { font-weight: 400; } :host .task-list-item.enabled label { cursor: pointer; } :host .task-list-item+.task-list-item { margin-top: 3px; } :host .task-list-item .handle { display: none; } :host .task-list-item-checkbox, :host input[type="checkbox"] { margin: 0 .2em .25em -1.6em; vertical-align: middle; } :host .contains-task-list:dir(rtl) .task-list-item-checkbox, :host .contains-task-list:dir(rtl) input[type="checkbox"] { margin: 0 -1.6em .25em .2em; } :host ::-webkit-calendar-picker-indicator { filter: invert(50%); }
13
13
  </style>
14
14
  \`;
15
- // See https://html.spec.whatwg.org/multipage/common-dom-interfaces.html
16
- // #reflecting-content-attributes-in-idl-attributes.
17
- const installStringReflection = (obj, attrName, propName = attrName) => {
18
- Object.defineProperty(obj, propName, {
19
- enumerable: true,
20
- get() {
21
- const value = this.getAttribute(attrName);
22
- return value === null ? '' : value;
23
- },
24
- set(v) {
25
- this.setAttribute(attrName, v);
26
- },
27
- });
28
- };
29
15
  class MarkdownStyle extends HTMLElement {
30
16
  constructor() {
31
17
  super();
@@ -59,7 +45,7 @@ class MarkdownStyle extends HTMLElement {
59
45
  this.warpper.setAttribute('data-color-mode', this.theme);
60
46
  }
61
47
  connectedCallback() {
62
- installStringReflection(this, 'theme');
48
+ this.installStringReflection('theme');
63
49
  if (!this.initTheme) {
64
50
  this.setTheme();
65
51
  const observer = new MutationObserver((mutationsList, observer) => {
@@ -78,6 +64,22 @@ class MarkdownStyle extends HTMLElement {
78
64
  };
79
65
  }
80
66
  }
67
+ /**
68
+ * See https://html.spec.whatwg.org/multipage/common-dom-interfaces.html
69
+ * #reflecting-content-attributes-in-idl-attributes.
70
+ */
71
+ installStringReflection(attrName, propName = attrName) {
72
+ Object.defineProperty(this, propName, {
73
+ enumerable: true,
74
+ get() {
75
+ const value = this.getAttribute(attrName);
76
+ return value === null ? '' : value;
77
+ },
78
+ set(v) {
79
+ this.setAttribute(attrName, v);
80
+ },
81
+ });
82
+ }
81
83
  }
82
84
  customElements.define('markdown-style', MarkdownStyle);
83
85
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-style.js","sourceRoot":"","sources":["../../src/nodes/markdown-style.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EpB,CAAA;AAED,MAAM,UAAU,aAAa,CAAC,KAAuB,EAAE,kBAAoC;IACzF,MAAM,UAAU,GAA2B;QACzC,KAAK,EAAE,0DAA0D;QACjE,SAAS,EAAE,eAAe;KAC3B,CAAA;IACD,IAAI,kBAAkB,EAAE;QACtB,UAAU,CAAC,KAAK,GAAG,kBAAkB,CAAC;KACvC;IACD,OAAO,CAAC;YACN,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,QAAQ;YACjB,gBAAgB;YAChB,uBAAuB;YACvB,4DAA4D;YAC5D,KAAK;YACL,QAAQ,EAAE,CAAC;oBACT,IAAI,EAAE,MAAM;oBACZ,KAAK,EAAE,YAAY;iBACpB,CAAC;SACH,EAAE;YACD,IAAI,EAAE,SAAS;YACf,UAAU;YACV,OAAO,EAAE,gBAAgB;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAA;AACJ,CAAC"}
1
+ {"version":3,"file":"markdown-style.js","sourceRoot":"","sources":["../../src/nodes/markdown-style.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgFpB,CAAA;AAED,MAAM,UAAU,aAAa,CAAC,KAAuB,EAAE,kBAAqC;IAC1F,MAAM,UAAU,GAA2B;QACzC,KAAK,EAAE,0DAA0D;QACjE,SAAS,EAAE,eAAe;KAC3B,CAAA;IACD,IAAI,kBAAkB,EAAE;QACtB,UAAU,CAAC,KAAK,GAAG,kBAAkB,CAAC;KACvC;IACD,OAAO,CAAC;YACN,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,QAAQ;YACjB,gBAAgB;YAChB,uBAAuB;YACvB,4DAA4D;YAC5D,KAAK;YACL,QAAQ,EAAE,CAAC;oBACT,IAAI,EAAE,MAAM;oBACZ,KAAK,EAAE,YAAY;iBACpB,CAAC;SACH,EAAE;YACD,IAAI,EAAE,SAAS;YACf,UAAU;YACV,OAAO,EAAE,gBAAgB;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAA;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-to-html-cli",
3
- "version": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "license": "MIT",
5
5
  "description": "Command line tool generates markdown as html.",
6
6
  "homepage": "https://jaywcjlove.github.io/markdown-to-html-cli",
@@ -40,7 +40,7 @@
40
40
  "@types/fs-extra": "~9.0.13",
41
41
  "@types/minimist": "~1.2.2",
42
42
  "@uiw/github-corners": "~1.5.10",
43
- "@wcj/markdown-style": "~1.0.6",
43
+ "@wcj/markdown-style": "~1.0.7",
44
44
  "@wcj/markdown-to-html": "~2.0.3",
45
45
  "fs-extra": "~10.0.0",
46
46
  "minimist": "~1.2.5",
@@ -1,7 +1,7 @@
1
1
  import { Element, ElementContent } from 'hast';
2
2
 
3
3
  /**
4
- * @wcj/markdown-style@1.0.6
4
+ * @wcj/markdown-style@1.0.7
5
5
  * https://github.com/jaywcjlove/markdown-to-html/tree/main/packages/markdown-style
6
6
  */
7
7
  const scriptString = `const __TEMPLATE__ = document.createElement('template');
@@ -14,20 +14,6 @@ __TEMPLATE__.innerHTML = \`
14
14
  :host a:not([href]) { color: inherit; text-decoration: none; } :host .absent { color: var(--color-danger-fg); } :host .anchor { float: left; padding-right: 4px; margin-left: -20px; line-height: 1; } :host .anchor:focus { outline: none; } :host p, :host blockquote, :host ul, :host ol, :host dl, :host table, :host pre, :host details { margin-top: 0; margin-bottom: 16px; } :host blockquote>:first-child { margin-top: 0; } :host blockquote>:last-child { margin-bottom: 0; } :host sup>a::before { content: "["; } :host sup>a::after { content: "]"; } :host h1 .octicon-link, :host h2 .octicon-link, :host h3 .octicon-link, :host h4 .octicon-link, :host h5 .octicon-link, :host h6 .octicon-link { color: var(--color-fg-default); vertical-align: middle; visibility: hidden; } :host h1:hover .anchor, :host h2:hover .anchor, :host h3:hover .anchor, :host h4:hover .anchor, :host h5:hover .anchor, :host h6:hover .anchor { text-decoration: none; } :host h1:hover .anchor .octicon-link, :host h2:hover .anchor .octicon-link, :host h3:hover .anchor .octicon-link, :host h4:hover .anchor .octicon-link, :host h5:hover .anchor .octicon-link, :host h6:hover .anchor .octicon-link { visibility: visible; } :host h1 tt, :host h1 code, :host h2 tt, :host h2 code, :host h3 tt, :host h3 code, :host h4 tt, :host h4 code, :host h5 tt, :host h5 code, :host h6 tt, :host h6 code { padding: 0 .2em; font-size: inherit; } :host ul.no-list, :host ol.no-list { padding: 0; list-style-type: none; } :host ol[type="1"] { list-style-type: decimal; } :host ol[type=a] { list-style-type: lower-alpha; } :host ol[type=i] { list-style-type: lower-roman; } :host div>ol:not([type]) { list-style-type: decimal; } :host ul ul, :host ul ol, :host ol ol, :host ol ul { margin-top: 0; margin-bottom: 0; } :host li>p { margin-top: 16px; } :host li+li { margin-top: .25em; } :host dl { padding: 0; } :host dl dt { padding: 0; margin-top: 16px; font-size: 1em; font-style: italic; font-weight: 600; } :host dl dd { padding: 0 16px; margin-bottom: 16px; } :host table th { font-weight: 600; } :host table th, :host table td { padding: 6px 13px; border: 1px solid var(--color-border-default); } :host table tr { background-color: var(--color-canvas-default); border-top: 1px solid var(--color-border-muted); } :host table tr:nth-child(2n) { background-color: var(--color-canvas-subtle); } :host table img { background-color: transparent; } :host img[align=right] { padding-left: 20px; } :host img[align=left] { padding-right: 20px; } :host .emoji { max-width: none; vertical-align: text-top; background-color: transparent; } :host span.frame { display: block; overflow: hidden; } :host span.frame>span { display: block; float: left; width: auto; padding: 7px; margin: 13px 0 0; overflow: hidden; border: 1px solid var(--color-border-default); } :host span.frame span img { display: block; float: left; } :host span.frame span span { display: block; padding: 5px 0 0; clear: both; color: var(--color-fg-default); } :host span.align-center { display: block; overflow: hidden; clear: both; } :host span.align-center>span { display: block; margin: 13px auto 0; overflow: hidden; text-align: center; } :host span.align-center span img { margin: 0 auto; text-align: center; } :host span.align-right { display: block; overflow: hidden; clear: both; } :host span.align-right>span { display: block; margin: 13px 0 0; overflow: hidden; text-align: right; } :host span.align-right span img { margin: 0; text-align: right; } :host span.float-left { display: block; float: left; margin-right: 13px; overflow: hidden; } :host span.float-left span { margin: 13px 0 0; } :host span.float-right { display: block; float: right; margin-left: 13px; overflow: hidden; } :host span.float-right>span { display: block; margin: 13px auto 0; overflow: hidden; text-align: right; } :host code, :host tt { padding: .2em .4em; margin: 0; font-size: 85%; background-color: var(--color-neutral-muted); border-radius: 6px; } :host code br, :host tt br { display: none; } :host del code { text-decoration: inherit; } :host pre code { font-size: 100%; } :host pre>code { padding: 0; margin: 0; word-break: normal; white-space: pre; background: transparent; border: 0; } :host .highlight { margin-bottom: 16px; } :host .highlight pre { margin-bottom: 0; word-break: normal; } :host .highlight pre, :host pre { position: relative; padding: 16px; overflow: auto; font-size: 85%; line-height: 1.45; background-color: var(--color-canvas-subtle); border-radius: 6px; } :host pre code, :host pre tt { display: inline; max-width: auto; padding: 0; margin: 0; overflow: visible; line-height: inherit; word-wrap: normal; background-color: transparent; border: 0; } :host .csv-data td, :host .csv-data th { padding: 5px; overflow: hidden; font-size: 12px; line-height: 1; text-align: left; white-space: nowrap; } :host .csv-data .blob-num { padding: 10px 8px 9px; text-align: right; background: var(--color-canvas-default); border: 0; } :host .csv-data tr { border-top: 0; } :host .csv-data th { font-weight: 600; background: var(--color-canvas-subtle); border-top: 0; } :host .footnotes { font-size: 12px; color: var(--color-fg-muted); border-top: 1px solid var(--color-border-default); } :host .footnotes ol { padding-left: 16px; } :host .footnotes li { position: relative; } :host .footnotes li:target::before { position: absolute; top: -8px; right: -8px; bottom: -8px; left: -24px; pointer-events: none; content: ""; border: 2px solid var(--color-accent-emphasis); border-radius: 6px; } :host .footnotes li:target { color: var(--color-fg-default); } :host .footnotes .data-footnote-backref g-emoji { font-family: monospace; } :host .task-list-item { list-style-type: none; } :host .task-list-item label { font-weight: 400; } :host .task-list-item.enabled label { cursor: pointer; } :host .task-list-item+.task-list-item { margin-top: 3px; } :host .task-list-item .handle { display: none; } :host .task-list-item-checkbox, :host input[type="checkbox"] { margin: 0 .2em .25em -1.6em; vertical-align: middle; } :host .contains-task-list:dir(rtl) .task-list-item-checkbox, :host .contains-task-list:dir(rtl) input[type="checkbox"] { margin: 0 -1.6em .25em .2em; } :host ::-webkit-calendar-picker-indicator { filter: invert(50%); }
15
15
  </style>
16
16
  \`;
17
- // See https://html.spec.whatwg.org/multipage/common-dom-interfaces.html
18
- // #reflecting-content-attributes-in-idl-attributes.
19
- const installStringReflection = (obj, attrName, propName = attrName) => {
20
- Object.defineProperty(obj, propName, {
21
- enumerable: true,
22
- get() {
23
- const value = this.getAttribute(attrName);
24
- return value === null ? '' : value;
25
- },
26
- set(v) {
27
- this.setAttribute(attrName, v);
28
- },
29
- });
30
- };
31
17
  class MarkdownStyle extends HTMLElement {
32
18
  constructor() {
33
19
  super();
@@ -61,7 +47,7 @@ class MarkdownStyle extends HTMLElement {
61
47
  this.warpper.setAttribute('data-color-mode', this.theme);
62
48
  }
63
49
  connectedCallback() {
64
- installStringReflection(this, 'theme');
50
+ this.installStringReflection('theme');
65
51
  if (!this.initTheme) {
66
52
  this.setTheme();
67
53
  const observer = new MutationObserver((mutationsList, observer) => {
@@ -80,11 +66,27 @@ class MarkdownStyle extends HTMLElement {
80
66
  };
81
67
  }
82
68
  }
69
+ /**
70
+ * See https://html.spec.whatwg.org/multipage/common-dom-interfaces.html
71
+ * #reflecting-content-attributes-in-idl-attributes.
72
+ */
73
+ installStringReflection(attrName, propName = attrName) {
74
+ Object.defineProperty(this, propName, {
75
+ enumerable: true,
76
+ get() {
77
+ const value = this.getAttribute(attrName);
78
+ return value === null ? '' : value;
79
+ },
80
+ set(v) {
81
+ this.setAttribute(attrName, v);
82
+ },
83
+ });
84
+ }
83
85
  }
84
86
  customElements.define('markdown-style', MarkdownStyle);
85
87
  `
86
88
 
87
- export function markdownStyle(child: ElementContent[], markdownStyleTheme: 'dark' | 'light'): Element[] {
89
+ export function markdownStyle(child: ElementContent[], markdownStyleTheme?: 'dark' | 'light'): Element[] {
88
90
  const properties: Record<string, string> = {
89
91
  style: 'max-width: 960px; margin: 0 auto 60px auto; padding: 8px',
90
92
  className: 'markdown-body',