@coderminer/vue-markdown 0.0.0-stage → 1.0.1
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/CHANGELOG.md +226 -0
- package/LICENSE +21 -0
- package/README.md +584 -3
- package/README.zh-CN.md +550 -0
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +16 -0
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js +16 -0
- package/dist/chunks/MarkdownCode-B1k9tmW5.js +63 -0
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +49 -0
- package/dist/chunks/MarkdownContent-BAK6dqo7.js +13 -0
- package/dist/chunks/MarkdownCustomTag-lZJHsD6f.js +46 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js +16 -0
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +14 -0
- package/dist/chunks/MarkdownError-C0sPs5W0.js +17 -0
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +22 -0
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +21 -0
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js +29 -0
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +16 -0
- package/dist/chunks/MarkdownHtml-66lYkvwM.js +13 -0
- package/dist/chunks/MarkdownImage-BRy76svs.js +51 -0
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +16 -0
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js +45 -0
- package/dist/chunks/MarkdownList-BJ-_C71k.js +20 -0
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js +16 -0
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js +15 -0
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +16 -0
- package/dist/chunks/MarkdownRenderer-OlkdsvI3.js +482 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js +23 -0
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +16 -0
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +16 -0
- package/dist/chunks/MarkdownTable-DmBTg_CR.js +16 -0
- package/dist/chunks/MarkdownTableCell-eiCJe847.js +31 -0
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js +16 -0
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js +24 -0
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +38 -0
- package/dist/chunks/MarkdownToc-DHWWoH6t.js +49 -0
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +25 -0
- package/dist/chunks/MermaidLiveEditor-1TKkI5bp.js +414 -0
- package/dist/chunks/VueSyntaxHighlighter-BWpCO-cX.js +260 -0
- package/dist/chunks/adapters-CMwX_NEI.js +26 -0
- package/dist/chunks/asyncToGenerator-ChigusFD.js +26 -0
- package/dist/chunks/blank-line-CKKsFeKR.js +88 -0
- package/dist/chunks/codemirror-DyphMAEg.js +82 -0
- package/dist/chunks/config-aRYo2R8_.js +10 -0
- package/dist/chunks/context-8NfW6fxI.js +30 -0
- package/dist/chunks/convert-hast-C4Rg2ZuF.js +6 -0
- package/dist/chunks/default-ZQ5aHh-N.js +3 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js +23 -0
- package/dist/chunks/export-BrgMLgUp.js +1574 -0
- package/dist/chunks/hast-to-nodes-DuZsi4XT.js +29 -0
- package/dist/chunks/hast-util-from-html-D3e_iQ89.js +5088 -0
- package/dist/chunks/highlightjs-BxJFpKS1.js +196 -0
- package/dist/chunks/identity-Bi27FKyx.js +6243 -0
- package/dist/chunks/labels-BtHiUTQI.js +47 -0
- package/dist/chunks/lib-CCnkLL6S.js +252 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js +8 -0
- package/dist/chunks/micromark-factory-space-CpXAnYUY.js +137 -0
- package/dist/chunks/normalize-VKfQXZiK.js +226 -0
- package/dist/chunks/objectSpread2-CtBNx0TF.js +57 -0
- package/dist/chunks/plugin-YWo5uqTh.js +27 -0
- package/dist/chunks/preset-BjaOuJUL.js +44 -0
- package/dist/chunks/registry-B7BfEkuy.js +6150 -0
- package/dist/chunks/render-DAqK0w5J.js +1754 -0
- package/dist/chunks/rolldown-runtime-QGRDbDUS.js +19 -0
- package/dist/chunks/runtime-D95F41zG.js +574 -0
- package/dist/chunks/security-y4EwUyAs.js +212 -0
- package/dist/chunks/shared-NjFDPmkb.js +67 -0
- package/dist/chunks/space-separated-tokens-1ebNqf35.js +1097 -0
- package/dist/chunks/url-D2BoivaE.js +24 -0
- package/dist/chunks/useActiveHeading-CnyGTG1u.js +359 -0
- package/dist/components/CodeBlock.d.ts +73 -0
- package/dist/components/CodeBlock.js +1 -0
- package/dist/components/Icon.d.ts +6 -0
- package/dist/components/MarkdownBlockquote.d.ts +18 -0
- package/dist/components/MarkdownBlockquote.js +1 -0
- package/dist/components/MarkdownBreak.d.ts +8 -0
- package/dist/components/MarkdownBreak.js +1 -0
- package/dist/components/MarkdownChildren.d.ts +17 -0
- package/dist/components/MarkdownCode.d.ts +29 -0
- package/dist/components/MarkdownCode.js +1 -0
- package/dist/components/MarkdownConfigProvider.d.ts +33 -0
- package/dist/components/MarkdownConfigProvider.js +1 -0
- package/dist/components/MarkdownContent.d.ts +16 -0
- package/dist/components/MarkdownContent.js +1 -0
- package/dist/components/MarkdownCustomTag.d.ts +20 -0
- package/dist/components/MarkdownCustomTag.js +1 -0
- package/dist/components/MarkdownEmphasis.d.ts +18 -0
- package/dist/components/MarkdownEmphasis.js +1 -0
- package/dist/components/MarkdownEmpty.d.ts +8 -0
- package/dist/components/MarkdownEmpty.js +1 -0
- package/dist/components/MarkdownError.d.ts +11 -0
- package/dist/components/MarkdownError.js +1 -0
- package/dist/components/MarkdownFootnoteReference.d.ts +19 -0
- package/dist/components/MarkdownFootnoteReference.js +1 -0
- package/dist/components/MarkdownFootnotes.d.ts +17 -0
- package/dist/components/MarkdownFootnotes.js +1 -0
- package/dist/components/MarkdownHeading.d.ts +18 -0
- package/dist/components/MarkdownHeading.js +1 -0
- package/dist/components/MarkdownHorizontalRule.d.ts +8 -0
- package/dist/components/MarkdownHorizontalRule.js +1 -0
- package/dist/components/MarkdownHtml.d.ts +8 -0
- package/dist/components/MarkdownHtml.js +1 -0
- package/dist/components/MarkdownImage.d.ts +15 -0
- package/dist/components/MarkdownImage.js +1 -0
- package/dist/components/MarkdownInlineCode.d.ts +18 -0
- package/dist/components/MarkdownInlineCode.js +1 -0
- package/dist/components/MarkdownLink.d.ts +22 -0
- package/dist/components/MarkdownLink.js +1 -0
- package/dist/components/MarkdownList.d.ts +18 -0
- package/dist/components/MarkdownList.js +1 -0
- package/dist/components/MarkdownListItem.d.ts +18 -0
- package/dist/components/MarkdownListItem.js +1 -0
- package/dist/components/MarkdownLoading.d.ts +8 -0
- package/dist/components/MarkdownLoading.js +1 -0
- package/dist/components/MarkdownMath.d.ts +12 -0
- package/dist/components/MarkdownMath.js +1 -0
- package/dist/components/MarkdownMermaid.d.ts +78 -0
- package/dist/components/MarkdownMermaid.js +1 -0
- package/dist/components/MarkdownParagraph.d.ts +18 -0
- package/dist/components/MarkdownParagraph.js +1 -0
- package/dist/components/MarkdownRenderer.d.ts +167 -0
- package/dist/components/MarkdownRenderer.js +1 -0
- package/dist/components/MarkdownRoot.d.ts +24 -0
- package/dist/components/MarkdownRoot.js +1 -0
- package/dist/components/MarkdownStrikethrough.d.ts +18 -0
- package/dist/components/MarkdownStrikethrough.js +1 -0
- package/dist/components/MarkdownStrong.d.ts +18 -0
- package/dist/components/MarkdownStrong.js +1 -0
- package/dist/components/MarkdownTable.d.ts +18 -0
- package/dist/components/MarkdownTable.js +1 -0
- package/dist/components/MarkdownTableCell.d.ts +20 -0
- package/dist/components/MarkdownTableCell.js +1 -0
- package/dist/components/MarkdownTableRow.d.ts +18 -0
- package/dist/components/MarkdownTableRow.js +1 -0
- package/dist/components/MarkdownTableSection.d.ts +18 -0
- package/dist/components/MarkdownTableSection.js +1 -0
- package/dist/components/MarkdownTaskItem.d.ts +20 -0
- package/dist/components/MarkdownTaskItem.js +1 -0
- package/dist/components/MarkdownToc.d.ts +36 -0
- package/dist/components/MarkdownToc.js +1 -0
- package/dist/components/MarkdownTocItem.d.ts +14 -0
- package/dist/components/MarkdownTocItem.js +1 -0
- package/dist/components/MermaidBlock.d.ts +50 -0
- package/dist/components/MermaidBlock.js +1 -0
- package/dist/components/MermaidLiveEditor.d.ts +44 -0
- package/dist/components/MermaidLiveEditor.js +1 -0
- package/dist/components/VueSyntaxHighlighter.d.ts +39 -0
- package/dist/components/VueSyntaxHighlighter.js +1 -0
- package/dist/components/codeRegion.d.ts +14 -0
- package/dist/components/config.d.ts +7 -0
- package/dist/components/context.d.ts +45 -0
- package/dist/components/index.d.ts +42 -0
- package/dist/components/index.js +38 -0
- package/dist/components/render.d.ts +9 -0
- package/dist/components/scroll-lock.d.ts +7 -0
- package/dist/components/types.d.ts +61 -0
- package/dist/composables/useActiveHeading.d.ts +12 -0
- package/dist/composables/useCodeHighlighter.d.ts +30 -0
- package/dist/composables/useLineWindow.d.ts +38 -0
- package/dist/composables/useMarkdownDocument.d.ts +25 -0
- package/dist/core/adapters.d.ts +7 -0
- package/dist/core/config.d.ts +5 -0
- package/dist/core/diagnostics.d.ts +9 -0
- package/dist/core/finalize.d.ts +18 -0
- package/dist/core/hast-nodes.d.ts +3 -0
- package/dist/core/hast-to-nodes.d.ts +9 -0
- package/dist/core/highlight-lines.d.ts +8 -0
- package/dist/core/identity.d.ts +4 -0
- package/dist/core/labels.d.ts +4 -0
- package/dist/core/manifest.d.ts +38 -0
- package/dist/core/memo.d.ts +5 -0
- package/dist/core/model-hast.d.ts +8 -0
- package/dist/core/model.d.ts +10 -0
- package/dist/core/normalize.d.ts +37 -0
- package/dist/core/parts.d.ts +136 -0
- package/dist/core/preset.d.ts +10 -0
- package/dist/core/run.d.ts +16 -0
- package/dist/core/search.d.ts +5 -0
- package/dist/core/security.d.ts +21 -0
- package/dist/core/slugger.d.ts +13 -0
- package/dist/core/types.d.ts +392 -0
- package/dist/core/url.d.ts +10 -0
- package/dist/editor/codemirror.d.ts +14 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.js +1 -0
- package/dist/export/index.d.ts +6 -0
- package/dist/headless.d.ts +21 -0
- package/dist/headless.js +12 -0
- package/dist/highlight/convert-hast.d.ts +8 -0
- package/dist/highlight/highlightjs.d.ts +7 -0
- package/dist/highlight/index.d.ts +4 -0
- package/dist/highlight/index.js +4 -0
- package/dist/highlight/shared.d.ts +11 -0
- package/dist/highlight/shiki.d.ts +7 -0
- package/dist/highlight/shiki.js +75 -0
- package/dist/html/index.d.ts +17 -0
- package/dist/html/index.js +11 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +53 -0
- package/dist/math/index.d.ts +4 -0
- package/dist/math/index.js +585 -0
- package/dist/math/katex.d.ts +4 -0
- package/dist/math/plugin.d.ts +20 -0
- package/dist/mermaid/index.d.ts +6 -0
- package/dist/mermaid/index.js +8 -0
- package/dist/mermaid/plugin.d.ts +17 -0
- package/dist/mermaid/runtime.d.ts +14 -0
- package/dist/mermaid/sanitize-svg-lazy.d.ts +10 -0
- package/dist/mermaid/sanitize-svg.d.ts +3 -0
- package/dist/mermaid/sanitize.d.ts +16 -0
- package/dist/node-components.d.ts +1 -0
- package/dist/node-components.js +39 -0
- package/dist/pipeline/custom.d.ts +8 -0
- package/dist/pipeline/identity.d.ts +12 -0
- package/dist/pipeline/index.d.ts +5 -0
- package/dist/pipeline/official.d.ts +6 -0
- package/dist/pipeline.d.ts +1 -0
- package/dist/pipeline.js +1 -0
- package/dist/plugins/builtin.d.ts +15 -0
- package/dist/plugins/define.d.ts +7 -0
- package/dist/plugins/registry.d.ts +16 -0
- package/dist/plugins/source.d.ts +7 -0
- package/dist/plugins.d.ts +3 -0
- package/dist/plugins.js +1 -0
- package/dist/presets.d.ts +3 -0
- package/dist/presets.js +1 -0
- package/dist/style.css +2 -0
- package/dist/styles/components.css +737 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/math-full.css +3 -0
- package/dist/styles/math.css +18 -0
- package/dist/styles/tokens.css +96 -0
- package/package.json +214 -6
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MarkdownPlugin } from '../core/types';
|
|
2
|
+
export interface MermaidPluginOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Fence languages that become Mermaid nodes. Defaults to `mermaid` and
|
|
5
|
+
* `mmd`. Language matching is case-insensitive.
|
|
6
|
+
*
|
|
7
|
+
* This is the only option the plugin reads. Configure the Mermaid renderer
|
|
8
|
+
* and theme on `MarkdownRenderer` through `mermaidRenderer` and `theme`.
|
|
9
|
+
*/
|
|
10
|
+
languages?: string | string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Turn Mermaid fenced code blocks into `mermaid` nodes so the renderer can use
|
|
14
|
+
* `MermaidBlock` directly. The plugin is opt-in because the Mermaid runtime is
|
|
15
|
+
* an optional peer dependency.
|
|
16
|
+
*/
|
|
17
|
+
export declare function mermaidPlugin(options?: MermaidPluginOptions): MarkdownPlugin;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MermaidRenderOptions, MermaidRenderResult } from '../core/types';
|
|
2
|
+
/** Report the actual failure, adding an install hint for a missing peer. */
|
|
3
|
+
export declare function classifyMermaidError(error: unknown): string;
|
|
4
|
+
/** Create a unique DOM-safe identifier for one Mermaid render. */
|
|
5
|
+
export declare function createMermaidRenderId(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Render one diagram through a single lazy Mermaid instance. Renders are
|
|
8
|
+
* serialized so Mermaid's global configuration cannot be changed while another
|
|
9
|
+
* diagram is rendering. The configuration key is checked inside that queue, so
|
|
10
|
+
* blocks with different themes cannot reuse a stale initialization.
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderMermaid(source: string, options?: MermaidRenderOptions): Promise<MermaidRenderResult>;
|
|
13
|
+
export declare function resetMermaidRuntime(): void;
|
|
14
|
+
export default renderMermaid;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MarkdownNode } from '../core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Sanitize SVG markup without pulling the HTML parser into the initial graph.
|
|
4
|
+
*
|
|
5
|
+
* The renderer and the default Mermaid runtime only need this after a diagram
|
|
6
|
+
* has actually rendered, so the parser can stay in a lazy chunk. The
|
|
7
|
+
* synchronous `sanitizeSvg` export remains available from the Mermaid entry for
|
|
8
|
+
* hosts that need it during their own render pass.
|
|
9
|
+
*/
|
|
10
|
+
export declare function sanitizeSvgAsync(svg: string): Promise<MarkdownNode[]>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RootContent } from 'hast';
|
|
2
|
+
import { MarkdownNode } from '../core/types';
|
|
3
|
+
declare const ALLOWED_TAGS: Set<string>;
|
|
4
|
+
/**
|
|
5
|
+
* Sanitize parsed SVG markup into normalized nodes. Prefer the root SVG
|
|
6
|
+
* element so the stylesheet scope is derived from its id.
|
|
7
|
+
*/
|
|
8
|
+
export declare function sanitizeHastNodes(nodes: readonly RootContent[]): MarkdownNode[];
|
|
9
|
+
/**
|
|
10
|
+
* Sanitize nodes returned by an injected Mermaid renderer. Renderer output is
|
|
11
|
+
* treated as untrusted even when it looks like normalized SVG nodes. A
|
|
12
|
+
* stylesheet is kept only when the root SVG has an id and every selector is
|
|
13
|
+
* scoped to it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function sanitizeMermaidNodes(nodes: readonly MarkdownNode[]): MarkdownNode[];
|
|
16
|
+
export { ALLOWED_TAGS as MERMAID_ALLOWED_TAGS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./chunks/config-aRYo2R8_.js";
|
|
2
|
+
import { n as r, r as i, t as a } from "./chunks/context-8NfW6fxI.js";
|
|
3
|
+
import { a as o, i as s, n as c, r as l } from "./chunks/render-DAqK0w5J.js";
|
|
4
|
+
import { t as u } from "./chunks/MarkdownCode-B1k9tmW5.js";
|
|
5
|
+
import { t as d } from "./chunks/MarkdownBlockquote-DVXziX2t.js";
|
|
6
|
+
import { t as f } from "./chunks/MarkdownBreak-BwCi2Itt.js";
|
|
7
|
+
import { t as p } from "./chunks/MarkdownCustomTag-lZJHsD6f.js";
|
|
8
|
+
import { t as m } from "./chunks/MarkdownEmphasis-CppivOEu.js";
|
|
9
|
+
import { t as h } from "./chunks/MarkdownHeading-DaNcP0_6.js";
|
|
10
|
+
import { t as g } from "./chunks/MarkdownHorizontalRule-QNe_cuUI.js";
|
|
11
|
+
import { t as _ } from "./chunks/MarkdownImage-BRy76svs.js";
|
|
12
|
+
import { t as v } from "./chunks/MarkdownInlineCode-MXZYFwex.js";
|
|
13
|
+
import { t as y } from "./chunks/MarkdownLink-Dbx3NwgV.js";
|
|
14
|
+
import { t as b } from "./chunks/MarkdownList-BJ-_C71k.js";
|
|
15
|
+
import { t as x } from "./chunks/MarkdownListItem-Z1EHIY26.js";
|
|
16
|
+
import { t as S } from "./chunks/MarkdownFootnoteReference-Dy3Khwyj.js";
|
|
17
|
+
import { t as C } from "./chunks/MarkdownFootnotes-BRPzkbXv.js";
|
|
18
|
+
import { t as w } from "./chunks/MarkdownParagraph-BxLSmSaG.js";
|
|
19
|
+
import { t as T } from "./chunks/MarkdownStrikethrough-CblvbqDk.js";
|
|
20
|
+
import { t as E } from "./chunks/MarkdownTaskItem-BcmKo1lk.js";
|
|
21
|
+
import { t as D } from "./chunks/MarkdownStrong-uU5MzAoJ.js";
|
|
22
|
+
import { t as O } from "./chunks/MarkdownTable-DmBTg_CR.js";
|
|
23
|
+
import { t as k } from "./chunks/MarkdownTableCell-eiCJe847.js";
|
|
24
|
+
import { t as A } from "./chunks/MarkdownTableRow-DuJaPntg.js";
|
|
25
|
+
import { t as j } from "./chunks/MarkdownTableSection-PFHz-R33.js";
|
|
26
|
+
import { n as M, t as N } from "./chunks/MarkdownRenderer-OlkdsvI3.js";
|
|
27
|
+
import { t as P } from "./chunks/MarkdownContent-BAK6dqo7.js";
|
|
28
|
+
import { t as F } from "./chunks/MarkdownEmpty-Av5k6bqa.js";
|
|
29
|
+
import { t as I } from "./chunks/MarkdownError-C0sPs5W0.js";
|
|
30
|
+
import { t as L } from "./chunks/MarkdownLoading-D-RYtXxf.js";
|
|
31
|
+
import { t as R } from "./chunks/MarkdownRoot-DEE6iVfh.js";
|
|
32
|
+
import { t as z } from "./chunks/MarkdownTocItem-DT9mR3vL.js";
|
|
33
|
+
import { t as B } from "./chunks/MarkdownToc-DHWWoH6t.js";
|
|
34
|
+
import { t as V } from "./chunks/MarkdownConfigProvider-5N3ylrIu.js";
|
|
35
|
+
import { t as H } from "./chunks/VueSyntaxHighlighter-BWpCO-cX.js";
|
|
36
|
+
import { t as U } from "./chunks/MermaidLiveEditor-1TKkI5bp.js";
|
|
37
|
+
import { t as W } from "./chunks/MarkdownHtml-66lYkvwM.js";
|
|
38
|
+
import "./components/index.js";
|
|
39
|
+
export { o as CodeBlock, n as MARKDOWN_CONFIG, d as MarkdownBlockquote, f as MarkdownBreak, M as MarkdownChildren, u as MarkdownCode, V as MarkdownConfigProvider, P as MarkdownContent, p as MarkdownCustomTag, m as MarkdownEmphasis, F as MarkdownEmpty, I as MarkdownError, S as MarkdownFootnoteReference, C as MarkdownFootnotes, h as MarkdownHeading, g as MarkdownHorizontalRule, W as MarkdownHtml, _ as MarkdownImage, v as MarkdownInlineCode, y as MarkdownLink, b as MarkdownList, x as MarkdownListItem, L as MarkdownLoading, s as MarkdownMath, c as MarkdownMermaid, w as MarkdownParagraph, N as MarkdownRenderer, R as MarkdownRoot, T as MarkdownStrikethrough, D as MarkdownStrong, O as MarkdownTable, k as MarkdownTableCell, A as MarkdownTableRow, j as MarkdownTableSection, E as MarkdownTaskItem, B as MarkdownToc, z as MarkdownTocItem, l as MermaidBlock, U as MermaidLiveEditor, a as RENDER_CONTEXT, H as VueSyntaxHighlighter, r as isEmptySlotContent, e as provideMarkdownConfig, t as useMarkdownConfig, i as useRenderContext };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MarkdownDiagnostic, MarkdownPipeline, PipelineResult } from '../core/types';
|
|
2
|
+
export declare function defineMarkdownPipeline(pipeline: MarkdownPipeline): MarkdownPipeline;
|
|
3
|
+
export declare function validatePipeline(pipeline: unknown): MarkdownDiagnostic[];
|
|
4
|
+
export declare function assertPipelineResult(result: unknown): PipelineResult;
|
|
5
|
+
export declare function resolvePipeline(pipeline?: MarkdownPipeline): {
|
|
6
|
+
pipeline: MarkdownPipeline;
|
|
7
|
+
diagnostics: MarkdownDiagnostic[];
|
|
8
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MarkdownDocumentOptions, MarkdownPlugin } from '../core/types';
|
|
2
|
+
export interface PipelineIdentityInput {
|
|
3
|
+
pipelineName: string;
|
|
4
|
+
plugins: readonly MarkdownPlugin[];
|
|
5
|
+
remarkPlugins: readonly unknown[];
|
|
6
|
+
rehypePlugins: readonly unknown[];
|
|
7
|
+
remarkRehypeOptions: Record<string, unknown> | undefined;
|
|
8
|
+
options: MarkdownDocumentOptions;
|
|
9
|
+
}
|
|
10
|
+
/** Deterministic identity for parse-affecting configuration. */
|
|
11
|
+
export declare function createPipelineIdentity(input: PipelineIdentityInput): string;
|
|
12
|
+
export declare function createMemoKey(source: string, pipelineIdentity: string, extra?: string): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createOfficialPipeline } from './official';
|
|
2
|
+
export type { OfficialPipelineOptions } from './official';
|
|
3
|
+
export { assertPipelineResult, defineMarkdownPipeline, resolvePipeline, validatePipeline, } from './custom';
|
|
4
|
+
export { createMemoKey, createPipelineIdentity } from './identity';
|
|
5
|
+
export type { PipelineIdentityInput } from './identity';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MarkdownPipeline } from '../core/types';
|
|
2
|
+
export declare function pluginName(item: unknown): string;
|
|
3
|
+
export interface OfficialPipelineOptions {
|
|
4
|
+
name?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function createOfficialPipeline(options?: OfficialPipelineOptions): MarkdownPipeline;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './pipeline/index';
|
package/dist/pipeline.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { r as assertPipelineResult, t as createMemoKey, s as createOfficialPipeline, n as createPipelineIdentity, i as defineMarkdownPipeline, a as resolvePipeline, o as validatePipeline } from "./chunks/identity-Bi27FKyx.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MarkdownPlugin, SearchOptions } from '../core/types';
|
|
2
|
+
export declare const tocPlugin: MarkdownPlugin;
|
|
3
|
+
export declare const codePlugin: MarkdownPlugin;
|
|
4
|
+
export declare const linkPlugin: MarkdownPlugin;
|
|
5
|
+
/** Segment search matches inside text nodes. */
|
|
6
|
+
export declare function searchPlugin(options?: SearchOptions): MarkdownPlugin;
|
|
7
|
+
export interface CustomTagsPluginOptions {
|
|
8
|
+
tags: string[];
|
|
9
|
+
}
|
|
10
|
+
/** Turn selected element tags into custom tag nodes. */
|
|
11
|
+
export declare function customTagsPlugin(options?: CustomTagsPluginOptions): MarkdownPlugin;
|
|
12
|
+
export declare const gfmPlugin: MarkdownPlugin;
|
|
13
|
+
export declare const frontmatterPlugin: MarkdownPlugin;
|
|
14
|
+
export declare const defaultPlugins: MarkdownPlugin[];
|
|
15
|
+
export declare const fullPlugins: MarkdownPlugin[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MarkdownPlugin, PluginContext } from '../core/types';
|
|
2
|
+
export type MarkdownPluginFactory<Options> = (options: Options) => MarkdownPlugin;
|
|
3
|
+
/** Identity helper for plugins created through the typed helper. */
|
|
4
|
+
export declare function defineMarkdownPlugin(plugin: MarkdownPlugin): MarkdownPlugin;
|
|
5
|
+
export declare function defineMarkdownPlugin<Options>(factory: MarkdownPluginFactory<Options>): MarkdownPluginFactory<Options>;
|
|
6
|
+
export declare function validatePlugin(plugin: MarkdownPlugin): MarkdownPlugin;
|
|
7
|
+
export declare function createPluginContext(source: string, options: PluginContext['options'], diagnostics: PluginContext['diagnostics']): PluginContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PluggableList } from 'unified';
|
|
2
|
+
import { MarkdownDiagnostic, MarkdownLabels, MarkdownNodeComponents, MarkdownPlugin, MarkdownRegionComponents, MarkdownTagComponents, PluginInput } from '../core/types';
|
|
3
|
+
export interface ResolvedPlugins {
|
|
4
|
+
plugins: MarkdownPlugin[];
|
|
5
|
+
names: string[];
|
|
6
|
+
diagnostics: MarkdownDiagnostic[];
|
|
7
|
+
components: MarkdownTagComponents;
|
|
8
|
+
nodeComponents: MarkdownNodeComponents;
|
|
9
|
+
regions: MarkdownRegionComponents;
|
|
10
|
+
labels: Partial<MarkdownLabels>;
|
|
11
|
+
tokens: Record<string, string>;
|
|
12
|
+
remarkPlugins: PluggableList;
|
|
13
|
+
rehypePlugins: PluggableList;
|
|
14
|
+
remarkRehypeOptions: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolvePlugins(input: readonly PluginInput[] | undefined, disablePlugins?: readonly string[]): ResolvedPlugins;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MarkdownDiagnostic, MarkdownDocumentOptions, MarkdownPlugin } from '../core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Run plugin source transforms in resolved order before parsing. A transform
|
|
4
|
+
* that throws or returns a non-string leaves the previous source intact and
|
|
5
|
+
* reports a diagnostic instead of breaking the run.
|
|
6
|
+
*/
|
|
7
|
+
export declare function applySourceTransforms(source: string, plugins: readonly MarkdownPlugin[], options: MarkdownDocumentOptions, diagnostics: MarkdownDiagnostic[]): string;
|
package/dist/plugins.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { n as codePlugin, d as createPluginContext, r as customTagsPlugin, i as defaultPlugins, f as defineMarkdownPlugin, a as frontmatterPlugin, o as fullPlugins, s as gfmPlugin, c as linkPlugin, t as resolvePlugins, l as searchPlugin, u as tocPlugin, p as validatePlugin } from "./chunks/registry-B7BfEkuy.js";
|
package/dist/presets.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as composePresets, n as defineMarkdownPreset, i as mergeMarkdownConfig, a as mergeMarkdownPreset, r as resolvePreset } from "./chunks/preset-BjaOuJUL.js";
|
package/dist/style.css
ADDED