@nuxtjs/mdc 0.17.3 → 0.17.4
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 +51 -43
- package/dist/module.json +1 -1
- package/dist/runtime/highlighter/shiki.js +1 -1
- package/dist/runtime/parser/index.js +1 -4
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
3
|
# Nuxt MDC
|
|
4
4
|
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
MDC supercharges regular Markdown to write documents interacting deeply with any Vue component. MDC stands for MarkDown Components.
|
|
11
11
|
|
|
12
|
-
- [✨ Release Notes](https://github.com/nuxt-
|
|
13
|
-
- [🏀 Online Playground](https://stackblitz.com/github/nuxt-
|
|
12
|
+
- [✨ Release Notes](https://github.com/nuxt-content/mdc/releases)
|
|
13
|
+
- [🏀 Online Playground](https://stackblitz.com/github/nuxt-content/mdc?file=playground%2Fapp.vue)
|
|
14
14
|
- [🧩 VS Code Extension](https://marketplace.visualstudio.com/items?itemName=Nuxt.mdc)
|
|
15
15
|
|
|
16
16
|
## Features
|
|
@@ -156,30 +156,30 @@ Here is the list of available prose components:
|
|
|
156
156
|
|
|
157
157
|
| Tag | Component | Source | Description |
|
|
158
158
|
| -- | -- | -- | -- |
|
|
159
|
-
| `p` | `<ProseP>` | [ProseP.vue](https://github.com/nuxt-
|
|
160
|
-
| `h1` | `<ProseH1>` | [ProseH1.vue](https://github.com/nuxt-
|
|
161
|
-
| `h2` | `<ProseH2>` | [ProseH2.vue](https://github.com/nuxt-
|
|
162
|
-
| `h3` | `<ProseH3>` | [ProseH3.vue](https://github.com/nuxt-
|
|
163
|
-
| `h4` | `<ProseH4>` | [ProseH4.vue](https://github.com/nuxt-
|
|
164
|
-
| `h5` | `<ProseH5>` | [ProseH5.vue](https://github.com/nuxt-
|
|
165
|
-
| `h6` | `<ProseH6>` | [ProseH6.vue](https://github.com/nuxt-
|
|
166
|
-
| `ul` | `<ProseUl>` | [ProseUl.vue](https://github.com/nuxt-
|
|
167
|
-
| `ol` | `<ProseOl>` | [ProseOl.vue](https://github.com/nuxt-
|
|
168
|
-
| `li` | `<ProseLi>` | [ProseLi.vue](https://github.com/nuxt-
|
|
169
|
-
| `blockquote` | `<ProseBlockquote>` | [ProseBlockquote.vue](https://github.com/nuxt-
|
|
170
|
-
| `hr` | `<ProseHr>` | [ProseHr.vue](https://github.com/nuxt-
|
|
171
|
-
| `pre` | `<ProsePre>` | [ProsePre.vue](https://github.com/nuxt-
|
|
172
|
-
| `code` | `<ProseCode>` | [ProseCode.vue](https://github.com/nuxt-
|
|
173
|
-
| `table` | `<ProseTable>` | [ProseTable.vue](https://github.com/nuxt-
|
|
174
|
-
| `thead` | `<ProseThead>` | [ProseThead.vue](https://github.com/nuxt-
|
|
175
|
-
| `tbody` | `<ProseTbody>` | [ProseTbody.vue](https://github.com/nuxt-
|
|
176
|
-
| `tr` | `<ProseTr>` | [ProseTr.vue](https://github.com/nuxt-
|
|
177
|
-
| `th` | `<ProseTh>` | [ProseTh.vue](https://github.com/nuxt-
|
|
178
|
-
| `td` | `<ProseTd>` | [ProseTd.vue](https://github.com/nuxt-
|
|
179
|
-
| `a` | `<ProseA>` | [ProseA.vue](https://github.com/nuxt-
|
|
180
|
-
| `img` | `<ProseImg>` | [ProseImg.vue](https://github.com/nuxt-
|
|
181
|
-
| `em` | `<ProseEm>` | [ProseEm.vue](https://github.com/nuxt-
|
|
182
|
-
| `strong` | `<ProseStrong>` | [ProseStrong.vue](https://github.com/nuxt-
|
|
159
|
+
| `p` | `<ProseP>` | [ProseP.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseP.vue) | Paragraph |
|
|
160
|
+
| `h1` | `<ProseH1>` | [ProseH1.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseH1.vue) | Heading 1 |
|
|
161
|
+
| `h2` | `<ProseH2>` | [ProseH2.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseH2.vue) | Heading 2 |
|
|
162
|
+
| `h3` | `<ProseH3>` | [ProseH3.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseH3.vue) | Heading 3 |
|
|
163
|
+
| `h4` | `<ProseH4>` | [ProseH4.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseH4.vue) | Heading 4 |
|
|
164
|
+
| `h5` | `<ProseH5>` | [ProseH5.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseH5.vue) | Heading 5 |
|
|
165
|
+
| `h6` | `<ProseH6>` | [ProseH6.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseH6.vue) | Heading 6 |
|
|
166
|
+
| `ul` | `<ProseUl>` | [ProseUl.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseUl.vue) | Unordered List |
|
|
167
|
+
| `ol` | `<ProseOl>` | [ProseOl.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseOl.vue) | Ordered List |
|
|
168
|
+
| `li` | `<ProseLi>` | [ProseLi.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseLi.vue) | List Item |
|
|
169
|
+
| `blockquote` | `<ProseBlockquote>` | [ProseBlockquote.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseBlockquote.vue) | Blockquote |
|
|
170
|
+
| `hr` | `<ProseHr>` | [ProseHr.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseHr.vue) | Horizontal Rule |
|
|
171
|
+
| `pre` | `<ProsePre>` | [ProsePre.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProsePre.vue) | Preformatted Text |
|
|
172
|
+
| `code` | `<ProseCode>` | [ProseCode.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseCode.vue) | Code Block |
|
|
173
|
+
| `table` | `<ProseTable>` | [ProseTable.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseTable.vue) | Table |
|
|
174
|
+
| `thead` | `<ProseThead>` | [ProseThead.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseThead.vue) | Table Head |
|
|
175
|
+
| `tbody` | `<ProseTbody>` | [ProseTbody.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseTbody.vue) | Table Body |
|
|
176
|
+
| `tr` | `<ProseTr>` | [ProseTr.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseTr.vue) | Table Row |
|
|
177
|
+
| `th` | `<ProseTh>` | [ProseTh.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseTh.vue) | Table Header |
|
|
178
|
+
| `td` | `<ProseTd>` | [ProseTd.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseTd.vue) | Table Data |
|
|
179
|
+
| `a` | `<ProseA>` | [ProseA.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseA.vue) | Anchor Link |
|
|
180
|
+
| `img` | `<ProseImg>` | [ProseImg.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseImg.vue) | Image |
|
|
181
|
+
| `em` | `<ProseEm>` | [ProseEm.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseEm.vue) | Emphasis |
|
|
182
|
+
| `strong` | `<ProseStrong>` | [ProseStrong.vue](https://github.com/nuxt-content/mdc/blob/main/src/runtime/components/prose/ProseStrong.vue) | Strong |
|
|
183
183
|
|
|
184
184
|
## Parsing Markdown
|
|
185
185
|
|
|
@@ -224,7 +224,7 @@ const { data: ast } = await useAsyncData('markdown', () => parseMarkdown('::aler
|
|
|
224
224
|
|
|
225
225
|
### Options
|
|
226
226
|
|
|
227
|
-
The `parseMarkdown` helper also accepts options as the second argument to control the parser's behavior. (Checkout [`MDCParseOptions` interface↗︎](https://github.com/nuxt-
|
|
227
|
+
The `parseMarkdown` helper also accepts options as the second argument to control the parser's behavior. (Checkout [`MDCParseOptions` interface↗︎](https://github.com/nuxt-content/mdc/blob/main/src/types/parser.ts)).
|
|
228
228
|
|
|
229
229
|
| Name | Default | Description |
|
|
230
230
|
| -- | -- | -- |
|
|
@@ -235,7 +235,7 @@ The `parseMarkdown` helper also accepts options as the second argument to contro
|
|
|
235
235
|
| `toc.depth` | `2` | Maximum heading depth to include in the table of contents. |
|
|
236
236
|
| `toc.searchDepth` | `2` | Maximum depth of nested tags to search for heading. |
|
|
237
237
|
|
|
238
|
-
Checkout [`MDCParseOptions` types↗︎](https://github.com/nuxt-
|
|
238
|
+
Checkout [`MDCParseOptions` types↗︎](https://github.com/nuxt-content/mdc/blob/main/src/types/parser.ts).
|
|
239
239
|
|
|
240
240
|
## Configurations
|
|
241
241
|
|
|
@@ -248,17 +248,25 @@ export default defineNuxtConfig({
|
|
|
248
248
|
modules: ['@nuxtjs/mdc'],
|
|
249
249
|
mdc: {
|
|
250
250
|
remarkPlugins: {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
// Register/Configure remark plugin to extend the parser, e.g.
|
|
252
|
+
// 'remark-math': {
|
|
253
|
+
// src: 'remark-math',
|
|
254
|
+
// options: {
|
|
255
|
+
// singleDollarTextMath: true,
|
|
256
|
+
// },
|
|
257
|
+
// },
|
|
254
258
|
},
|
|
255
259
|
rehypePlugins: {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
// Register/Configure rehype plugin to extend the parser, e.g.
|
|
261
|
+
// 'rehype-mathjax': {
|
|
262
|
+
// src: 'rehype-mathjax',
|
|
263
|
+
// options: {
|
|
264
|
+
// tex: {
|
|
265
|
+
// inlineMath: [['$', '$'], ['\\(', '\\)']],
|
|
266
|
+
// displayMath: [['$$', '$$'], ['\\[', '\\]']],
|
|
267
|
+
// },
|
|
268
|
+
// },
|
|
269
|
+
// },
|
|
262
270
|
},
|
|
263
271
|
headings: {
|
|
264
272
|
anchorLinks: {
|
|
@@ -276,7 +284,7 @@ export default defineNuxtConfig({
|
|
|
276
284
|
})
|
|
277
285
|
```
|
|
278
286
|
|
|
279
|
-
Checkout [`ModuleOptions` types↗︎](https://github.com/nuxt-
|
|
287
|
+
Checkout [`ModuleOptions` types↗︎](https://github.com/nuxt-content/mdc/blob/main/src/module.ts).
|
|
280
288
|
|
|
281
289
|
---
|
|
282
290
|
|
|
@@ -476,7 +484,7 @@ onBeforeMount(async () => {
|
|
|
476
484
|
|
|
477
485
|
You can dive into this module online using StackBlitz:
|
|
478
486
|
|
|
479
|
-
[](https://stackblitz.com/github/nuxt-
|
|
487
|
+
[](https://stackblitz.com/github/nuxt-content/mdc?file=playground%2Fapp.vue)
|
|
480
488
|
|
|
481
489
|
Or locally:
|
|
482
490
|
|
|
@@ -486,7 +494,7 @@ Or locally:
|
|
|
486
494
|
|
|
487
495
|
## License
|
|
488
496
|
|
|
489
|
-
[MIT License](https://github.com/nuxt-
|
|
497
|
+
[MIT License](https://github.com/nuxt-content/mdc/blob/main/LICENSE)
|
|
490
498
|
|
|
491
499
|
Copyright (c) NuxtLabs
|
|
492
500
|
|
|
@@ -497,8 +505,8 @@ Copyright (c) NuxtLabs
|
|
|
497
505
|
[npm-downloads-src]: https://img.shields.io/npm/dm/@nuxtjs/mdc.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
498
506
|
[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/mdc
|
|
499
507
|
|
|
500
|
-
[license-src]: https://img.shields.io/github/license/nuxt-
|
|
501
|
-
[license-href]: https://github.com/nuxt-
|
|
508
|
+
[license-src]: https://img.shields.io/github/license/nuxt-content/mdc.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
509
|
+
[license-href]: https://github.com/nuxt-content/mdc/blob/main/LICENSE
|
|
502
510
|
|
|
503
511
|
|
|
504
512
|
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
|
package/dist/module.json
CHANGED
|
@@ -11,7 +11,7 @@ export function createShikiHighlighter({
|
|
|
11
11
|
let shiki;
|
|
12
12
|
let configs;
|
|
13
13
|
async function _getShiki() {
|
|
14
|
-
const { createHighlighterCore, addClassToHast, isSpecialLang, isSpecialTheme } = await import("
|
|
14
|
+
const { createHighlighterCore, addClassToHast, isSpecialLang, isSpecialTheme } = await import("@shikijs/core");
|
|
15
15
|
const { transformerNotationDiff, transformerNotationErrorLevel, transformerNotationFocus, transformerNotationHighlight } = await import("@shikijs/transformers");
|
|
16
16
|
const shiki2 = await createHighlighterCore({
|
|
17
17
|
langs,
|
|
@@ -47,10 +47,7 @@ export const createParseProcessor = async (inlineOptions = {}) => {
|
|
|
47
47
|
if (inlineOptions.highlight === false) {
|
|
48
48
|
delete options.rehype.plugins.highlight;
|
|
49
49
|
} else {
|
|
50
|
-
options.rehype.plugins.highlight.options = {
|
|
51
|
-
...options.rehype.plugins.highlight.options || {},
|
|
52
|
-
...options.highlight || {}
|
|
53
|
-
};
|
|
50
|
+
options.rehype.plugins.highlight.options = defu({}, options.rehype.plugins.highlight.options, options.highlight || {});
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
53
|
let processor = unified();
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/mdc",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.4",
|
|
4
4
|
"description": "Nuxt MDC module",
|
|
5
|
-
"repository": "nuxt-
|
|
5
|
+
"repository": "nuxt-content/mdc",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"exports": {
|
|
@@ -68,13 +68,14 @@
|
|
|
68
68
|
"verify": "npm run dev:prepare && npm run lint && npm run test && npm run typecheck"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@nuxt/kit": "^4.
|
|
72
|
-
"@shikijs/
|
|
73
|
-
"@shikijs/
|
|
74
|
-
"@shikijs/
|
|
71
|
+
"@nuxt/kit": "^4.1.1",
|
|
72
|
+
"@shikijs/core": "^3.12.2",
|
|
73
|
+
"@shikijs/langs": "^3.12.2",
|
|
74
|
+
"@shikijs/themes": "^3.12.2",
|
|
75
|
+
"@shikijs/transformers": "^3.12.2",
|
|
75
76
|
"@types/hast": "^3.0.4",
|
|
76
77
|
"@types/mdast": "^4.0.4",
|
|
77
|
-
"@vue/compiler-core": "^3.5.
|
|
78
|
+
"@vue/compiler-core": "^3.5.21",
|
|
78
79
|
"consola": "^3.4.2",
|
|
79
80
|
"debug": "^4.4.1",
|
|
80
81
|
"defu": "^6.1.4",
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
"remark-rehype": "^11.1.2",
|
|
104
105
|
"remark-stringify": "^11.0.0",
|
|
105
106
|
"scule": "^1.3.0",
|
|
106
|
-
"shiki": "^3.12.
|
|
107
|
+
"shiki": "^3.12.2",
|
|
107
108
|
"ufo": "^1.6.1",
|
|
108
109
|
"unified": "^11.0.5",
|
|
109
110
|
"unist-builder": "^4.0.0",
|
|
@@ -115,13 +116,13 @@
|
|
|
115
116
|
"@nuxt/devtools": "^2.6.3",
|
|
116
117
|
"@nuxt/eslint-config": "^1.9.0",
|
|
117
118
|
"@nuxt/module-builder": "^1.0.2",
|
|
118
|
-
"@nuxt/schema": "^4.
|
|
119
|
+
"@nuxt/schema": "^4.1.1",
|
|
119
120
|
"@nuxt/test-utils": "^3.19.2",
|
|
120
121
|
"@nuxt/ui": "^3.3.3",
|
|
121
122
|
"@nuxtjs/mdc": "link:.",
|
|
122
|
-
"@types/node": "^24.3.
|
|
123
|
-
"eslint": "^9.
|
|
124
|
-
"nuxt": "^4.
|
|
123
|
+
"@types/node": "^24.3.1",
|
|
124
|
+
"eslint": "^9.35.0",
|
|
125
|
+
"nuxt": "^4.1.1",
|
|
125
126
|
"rehype": "^13.0.2",
|
|
126
127
|
"release-it": "^19.0.4",
|
|
127
128
|
"typescript": "5.9.2",
|