@vuepress/markdown 2.0.0-beta.5 → 2.0.0-beta.50
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/dist/index.d.ts +184 -0
- package/dist/index.js +561 -0
- package/package.json +48 -17
- package/CHANGELOG.md +0 -212
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -16
- package/lib/markdown.d.ts +0 -5
- package/lib/markdown.js +0 -77
- package/lib/plugins/anchorPlugin.d.ts +0 -62
- package/lib/plugins/anchorPlugin.js +0 -5
- package/lib/plugins/assetsPlugin.d.ts +0 -11
- package/lib/plugins/assetsPlugin.js +0 -24
- package/lib/plugins/codePlugin/codePlugin.d.ts +0 -28
- package/lib/plugins/codePlugin/codePlugin.js +0 -73
- package/lib/plugins/codePlugin/index.d.ts +0 -6
- package/lib/plugins/codePlugin/index.js +0 -18
- package/lib/plugins/codePlugin/languages.d.ts +0 -38
- package/lib/plugins/codePlugin/languages.js +0 -68
- package/lib/plugins/codePlugin/resolveHighlightLines.d.ts +0 -9
- package/lib/plugins/codePlugin/resolveHighlightLines.js +0 -28
- package/lib/plugins/codePlugin/resolveLanguage.d.ts +0 -5
- package/lib/plugins/codePlugin/resolveLanguage.js +0 -41
- package/lib/plugins/codePlugin/resolveLineNumbers.d.ts +0 -4
- package/lib/plugins/codePlugin/resolveLineNumbers.js +0 -16
- package/lib/plugins/codePlugin/resolveVPre.d.ts +0 -4
- package/lib/plugins/codePlugin/resolveVPre.js +0 -16
- package/lib/plugins/customComponentPlugin/customComponentPlugin.d.ts +0 -6
- package/lib/plugins/customComponentPlugin/customComponentPlugin.js +0 -18
- package/lib/plugins/customComponentPlugin/htmlBlockRule.d.ts +0 -2
- package/lib/plugins/customComponentPlugin/htmlBlockRule.js +0 -90
- package/lib/plugins/customComponentPlugin/htmlInlineRule.d.ts +0 -2
- package/lib/plugins/customComponentPlugin/htmlInlineRule.js +0 -40
- package/lib/plugins/customComponentPlugin/htmlRe.d.ts +0 -2
- package/lib/plugins/customComponentPlugin/htmlRe.js +0 -33
- package/lib/plugins/customComponentPlugin/index.d.ts +0 -4
- package/lib/plugins/customComponentPlugin/index.js +0 -16
- package/lib/plugins/customComponentPlugin/inlineTags.d.ts +0 -18
- package/lib/plugins/customComponentPlugin/inlineTags.js +0 -78
- package/lib/plugins/customComponentPlugin/vueReservedTags.d.ts +0 -6
- package/lib/plugins/customComponentPlugin/vueReservedTags.js +0 -17
- package/lib/plugins/emojiPlugin.d.ts +0 -25
- package/lib/plugins/emojiPlugin.js +0 -5
- package/lib/plugins/extractHeadersPlugin.d.ts +0 -27
- package/lib/plugins/extractHeadersPlugin.js +0 -31
- package/lib/plugins/hoistTagsPlugin.d.ts +0 -12
- package/lib/plugins/hoistTagsPlugin.js +0 -26
- package/lib/plugins/index.d.ts +0 -9
- package/lib/plugins/index.js +0 -21
- package/lib/plugins/linksPlugin/index.d.ts +0 -2
- package/lib/plugins/linksPlugin/index.js +0 -14
- package/lib/plugins/linksPlugin/linksPlugin.d.ts +0 -11
- package/lib/plugins/linksPlugin/linksPlugin.js +0 -104
- package/lib/plugins/linksPlugin/resolvePaths.d.ts +0 -7
- package/lib/plugins/linksPlugin/resolvePaths.js +0 -38
- package/lib/plugins/tocPlugin/createRenderHeaders.d.ts +0 -5
- package/lib/plugins/tocPlugin/createRenderHeaders.js +0 -28
- package/lib/plugins/tocPlugin/createTocBlockRule.d.ts +0 -11
- package/lib/plugins/tocPlugin/createTocBlockRule.js +0 -50
- package/lib/plugins/tocPlugin/index.d.ts +0 -3
- package/lib/plugins/tocPlugin/index.js +0 -15
- package/lib/plugins/tocPlugin/tocPlugin.d.ts +0 -65
- package/lib/plugins/tocPlugin/tocPlugin.js +0 -54
- package/lib/types.d.ts +0 -58
- package/lib/types.js +0 -2
- package/lib/utils/index.d.ts +0 -3
- package/lib/utils/index.js +0 -15
- package/lib/utils/parseEmoji.d.ts +0 -1
- package/lib/utils/parseEmoji.js +0 -6
- package/lib/utils/resolveHeadersFromTokens.d.ts +0 -11
- package/lib/utils/resolveHeadersFromTokens.js +0 -81
- package/lib/utils/slugify.d.ts +0 -1
- package/lib/utils/slugify.js +0 -24
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { SfcPluginOptions } from '@mdit-vue/plugin-sfc';
|
|
2
|
+
export { MarkdownSfcBlocks, SfcPluginOptions, sfcPlugin } from '@mdit-vue/plugin-sfc';
|
|
3
|
+
import { MarkdownItEnv } from '@mdit-vue/types';
|
|
4
|
+
import { PageHeader, PageFrontmatter } from '@vuepress/shared';
|
|
5
|
+
import MarkdownIt, { PluginWithOptions } from 'markdown-it';
|
|
6
|
+
import { FrontmatterPluginOptions } from '@mdit-vue/plugin-frontmatter';
|
|
7
|
+
export { FrontmatterPluginOptions, frontmatterPlugin } from '@mdit-vue/plugin-frontmatter';
|
|
8
|
+
import { HeadersPluginOptions } from '@mdit-vue/plugin-headers';
|
|
9
|
+
export { HeadersPluginOptions, headersPlugin } from '@mdit-vue/plugin-headers';
|
|
10
|
+
import { TocPluginOptions } from '@mdit-vue/plugin-toc';
|
|
11
|
+
export { TocPluginOptions, tocPlugin } from '@mdit-vue/plugin-toc';
|
|
12
|
+
import anchorPlugin from 'markdown-it-anchor';
|
|
13
|
+
export { default as anchorPlugin } from 'markdown-it-anchor';
|
|
14
|
+
import emojiPlugin from 'markdown-it-emoji';
|
|
15
|
+
export { default as emojiPlugin } from 'markdown-it-emoji';
|
|
16
|
+
export { ComponentPluginOptions, componentPlugin } from '@mdit-vue/plugin-component';
|
|
17
|
+
export { titlePlugin } from '@mdit-vue/plugin-title';
|
|
18
|
+
|
|
19
|
+
declare type AnchorPluginOptions = anchorPlugin.AnchorOptions;
|
|
20
|
+
|
|
21
|
+
interface AssetsPluginOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Prefix to add to relative assets links
|
|
24
|
+
*/
|
|
25
|
+
relativePathPrefix?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Plugin to handle assets links
|
|
29
|
+
*/
|
|
30
|
+
declare const assetsPlugin: PluginWithOptions<AssetsPluginOptions>;
|
|
31
|
+
|
|
32
|
+
interface CodePluginOptions {
|
|
33
|
+
/**
|
|
34
|
+
* Enable highlight lines or not
|
|
35
|
+
*/
|
|
36
|
+
highlightLines?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Enable line numbers or not
|
|
39
|
+
*
|
|
40
|
+
* - A `boolean` value is to enable line numbers or not.
|
|
41
|
+
* - A `number` value is the minimum number of lines to enable line numbers
|
|
42
|
+
*/
|
|
43
|
+
lineNumbers?: boolean | number;
|
|
44
|
+
/**
|
|
45
|
+
* Wrap the `<pre>` tag with an extra `<div>` or not. Do not disable it unless you
|
|
46
|
+
* understand what's it for
|
|
47
|
+
*
|
|
48
|
+
* - Required for `highlightLines`
|
|
49
|
+
* - Required for `lineNumbers`
|
|
50
|
+
* - Required for language display of default theme
|
|
51
|
+
*/
|
|
52
|
+
preWrapper?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Add `v-pre` directive or not
|
|
55
|
+
*/
|
|
56
|
+
vPre?: {
|
|
57
|
+
/**
|
|
58
|
+
* Add `v-pre` directive to `<pre>` tag of code block or not
|
|
59
|
+
*/
|
|
60
|
+
block?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Add `v-pre` directive to `<code>` tag of inline code or not
|
|
63
|
+
*/
|
|
64
|
+
inline?: boolean;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Code plugin
|
|
69
|
+
*/
|
|
70
|
+
declare const codePlugin: PluginWithOptions<CodePluginOptions>;
|
|
71
|
+
|
|
72
|
+
declare type EmojiPluginOptions = emojiPlugin.Options;
|
|
73
|
+
|
|
74
|
+
interface ImportCodePluginOptions {
|
|
75
|
+
/**
|
|
76
|
+
* A function to handle the import path
|
|
77
|
+
*/
|
|
78
|
+
handleImportPath?: (str: string) => string;
|
|
79
|
+
}
|
|
80
|
+
declare const importCodePlugin: PluginWithOptions<ImportCodePluginOptions>;
|
|
81
|
+
|
|
82
|
+
interface LinksPluginOptions {
|
|
83
|
+
/**
|
|
84
|
+
* Tag for internal links
|
|
85
|
+
*
|
|
86
|
+
* @default 'RouterLink'
|
|
87
|
+
*/
|
|
88
|
+
internalTag?: 'a' | 'RouterLink';
|
|
89
|
+
/**
|
|
90
|
+
* Additional attributes for external links
|
|
91
|
+
*
|
|
92
|
+
* @default
|
|
93
|
+
* ```js
|
|
94
|
+
* ({
|
|
95
|
+
* target: '_blank',
|
|
96
|
+
* rel: 'noopener noreferrer',
|
|
97
|
+
* })
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
externalAttrs?: Record<string, string>;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Process links in markdown file
|
|
104
|
+
*
|
|
105
|
+
* - internal links: convert them into `<RouterLink>`
|
|
106
|
+
* - external links: add extra attrs and external icon
|
|
107
|
+
*/
|
|
108
|
+
declare const linksPlugin: PluginWithOptions<LinksPluginOptions>;
|
|
109
|
+
|
|
110
|
+
declare type Markdown = MarkdownIt;
|
|
111
|
+
|
|
112
|
+
interface MarkdownOptions extends MarkdownIt.Options {
|
|
113
|
+
anchor?: false | AnchorPluginOptions;
|
|
114
|
+
assets?: false | AssetsPluginOptions;
|
|
115
|
+
code?: false | CodePluginOptions;
|
|
116
|
+
component?: false;
|
|
117
|
+
emoji?: false | EmojiPluginOptions;
|
|
118
|
+
frontmatter?: false | FrontmatterPluginOptions;
|
|
119
|
+
headers?: false | HeadersPluginOptions;
|
|
120
|
+
title?: false;
|
|
121
|
+
importCode?: false | ImportCodePluginOptions;
|
|
122
|
+
links?: false | LinksPluginOptions;
|
|
123
|
+
sfc?: false | SfcPluginOptions;
|
|
124
|
+
slugify?: MarkdownSlugifyFunction;
|
|
125
|
+
toc?: false | TocPluginOptions;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Headers in markdown file
|
|
129
|
+
*/
|
|
130
|
+
declare type MarkdownHeader = PageHeader;
|
|
131
|
+
/**
|
|
132
|
+
* Internal links in markdown file
|
|
133
|
+
*
|
|
134
|
+
* Used for file existence check
|
|
135
|
+
*/
|
|
136
|
+
interface MarkdownLink {
|
|
137
|
+
raw: string;
|
|
138
|
+
relative: string;
|
|
139
|
+
absolute: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The `env` object to be passed to markdown-it render function
|
|
143
|
+
*
|
|
144
|
+
* Input some meta data for markdown file parsing and rendering
|
|
145
|
+
*
|
|
146
|
+
* Output some resources from the markdown file
|
|
147
|
+
*/
|
|
148
|
+
interface MarkdownEnv extends MarkdownItEnv {
|
|
149
|
+
/**
|
|
150
|
+
* Base / publicPath of current site
|
|
151
|
+
*/
|
|
152
|
+
base?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Absolute file path of the markdown file
|
|
155
|
+
*/
|
|
156
|
+
filePath?: string | null;
|
|
157
|
+
/**
|
|
158
|
+
* Relative file path of the markdown file
|
|
159
|
+
*/
|
|
160
|
+
filePathRelative?: string | null;
|
|
161
|
+
/**
|
|
162
|
+
* Frontmatter of the markdown file
|
|
163
|
+
*/
|
|
164
|
+
frontmatter?: PageFrontmatter;
|
|
165
|
+
/**
|
|
166
|
+
* Imported file that extracted by importCodePlugin
|
|
167
|
+
*/
|
|
168
|
+
importedFiles?: string[];
|
|
169
|
+
/**
|
|
170
|
+
* Links that extracted by linksPlugin
|
|
171
|
+
*/
|
|
172
|
+
links?: MarkdownLink[];
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Type of `slugify` function
|
|
176
|
+
*/
|
|
177
|
+
declare type MarkdownSlugifyFunction = (str: string) => string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Create vuepress customized markdown-it instance
|
|
181
|
+
*/
|
|
182
|
+
declare const createMarkdown: ({ anchor, assets, code, component, emoji, frontmatter, headers, title, importCode, links, sfc, slugify, toc, ...markdownItOptions }?: MarkdownOptions) => Markdown;
|
|
183
|
+
|
|
184
|
+
export { AnchorPluginOptions, AssetsPluginOptions, CodePluginOptions, EmojiPluginOptions, ImportCodePluginOptions, LinksPluginOptions, Markdown, MarkdownEnv, MarkdownHeader, MarkdownLink, MarkdownOptions, MarkdownSlugifyFunction, assetsPlugin, codePlugin, createMarkdown, importCodePlugin, linksPlugin };
|