@nuxtjs/mdc 0.8.2 → 0.8.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.
- package/dist/config.d.mts +1 -3
- package/dist/config.d.ts +1 -3
- package/dist/config.mjs +5 -7
- package/dist/module.d.mts +6 -64
- package/dist/module.d.ts +6 -64
- package/dist/module.json +2 -2
- package/dist/module.mjs +2 -4
- package/dist/runtime/components/MDCRenderer.vue.d.ts +1 -0
- package/dist/runtime/highlighter/shiki.js +16 -6
- package/dist/runtime/parser/index.d.ts +1 -1
- package/dist/runtime/parser/utils/plugins.d.ts +2 -1
- package/dist/shared/mdc.4762b8bc.d.mts +66 -0
- package/dist/shared/mdc.4762b8bc.d.ts +66 -0
- package/dist/types.d.mts +1 -17
- package/dist/types.d.ts +1 -17
- package/package.json +16 -16
package/dist/config.d.mts
CHANGED
package/dist/config.d.ts
CHANGED
package/dist/config.mjs
CHANGED
package/dist/module.d.mts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { BundledLanguage, LanguageRegistration, BundledTheme, ThemeRegistrationAny } from 'shiki';
|
|
3
3
|
import { Options } from 'remark-rehype';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { R as RehypeHighlightOption, M as MdcConfig, a as MdcThemeOptions } from './shared/mdc.4762b8bc.mjs';
|
|
5
|
+
export { A as Awaitable, b as HighlightResult, c as Highlighter, H as HighlighterOptions, d as defineConfig } from './shared/mdc.4762b8bc.mjs';
|
|
6
|
+
import 'unified';
|
|
7
|
+
import 'hast';
|
|
6
8
|
|
|
7
9
|
type MDCText = {
|
|
8
10
|
type: 'text';
|
|
@@ -28,65 +30,6 @@ interface MDCData extends Record<string, any> {
|
|
|
28
30
|
description: string;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
|
|
32
|
-
interface HighlighterOptions {
|
|
33
|
-
highlights?: number[];
|
|
34
|
-
meta?: string;
|
|
35
|
-
}
|
|
36
|
-
interface HighlightResult {
|
|
37
|
-
tree: ElementContent$1[];
|
|
38
|
-
className?: string;
|
|
39
|
-
style?: string;
|
|
40
|
-
inlineStyle?: string;
|
|
41
|
-
}
|
|
42
|
-
type Highlighter = (code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Promise<HighlightResult>;
|
|
43
|
-
interface RehypeHighlightOption {
|
|
44
|
-
theme?: MdcThemeOptions;
|
|
45
|
-
highlighter?: Highlighter;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type Awaitable<T> = T | Promise<T>;
|
|
49
|
-
interface MdcConfig {
|
|
50
|
-
/**
|
|
51
|
-
* Hooks for the unified markdown pipeline
|
|
52
|
-
*/
|
|
53
|
-
unified?: {
|
|
54
|
-
/**
|
|
55
|
-
* Custom setup for unified processor before other plugins
|
|
56
|
-
*/
|
|
57
|
-
pre?: (processor: Processor) => Awaitable<void | Processor>;
|
|
58
|
-
/**
|
|
59
|
-
* Custom setup for unified processor after remark but before rehype
|
|
60
|
-
*/
|
|
61
|
-
remark?: (processor: Processor) => Awaitable<void | Processor>;
|
|
62
|
-
/**
|
|
63
|
-
* Custom setup for unified processor after rehype
|
|
64
|
-
*/
|
|
65
|
-
rehype?: (processor: Processor) => Awaitable<void | Processor>;
|
|
66
|
-
/**
|
|
67
|
-
* Custom setup for unified processor after all plugins
|
|
68
|
-
*/
|
|
69
|
-
post?: (processor: Processor) => Awaitable<void | Processor>;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Custom hightlighter, available when `highlighter` is set to `custom`
|
|
73
|
-
*/
|
|
74
|
-
highlighter?: Highlighter$1;
|
|
75
|
-
/**
|
|
76
|
-
* Hooks for shiki
|
|
77
|
-
*/
|
|
78
|
-
shiki?: {
|
|
79
|
-
/**
|
|
80
|
-
* Get transformers for shiki
|
|
81
|
-
*/
|
|
82
|
-
transformers?: ShikiTransformer[] | ((code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Awaitable<ShikiTransformer[]>);
|
|
83
|
-
/**
|
|
84
|
-
* Custom setup for shiki instance, only called once on server or client
|
|
85
|
-
*/
|
|
86
|
-
setup?: (highlighter: HighlighterCore) => Awaitable<void>;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
33
|
interface TocLink {
|
|
91
34
|
id: string;
|
|
92
35
|
text: string;
|
|
@@ -567,7 +510,6 @@ interface Text extends Literal {
|
|
|
567
510
|
interface TextData extends Data {
|
|
568
511
|
}
|
|
569
512
|
|
|
570
|
-
declare function defineConfig(config: MdcConfig): MdcConfig;
|
|
571
513
|
declare const DefaultHighlightLangs: BundledLanguage[];
|
|
572
514
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
573
515
|
|
|
@@ -600,4 +542,4 @@ declare module '@nuxt/schema' {
|
|
|
600
542
|
}
|
|
601
543
|
}
|
|
602
544
|
|
|
603
|
-
export { type
|
|
545
|
+
export { type Comment, type CommentData, type Content, type Data, DefaultHighlightLangs, type Doctype, type DoctypeData, type Element, type ElementContent, type ElementContentMap, type ElementData, type Literal, type Literals, type MDCComment, type MDCData, type MDCElement, type MDCNode, type MDCParseOptions, type MDCParserResult, type MDCRoot, type MDCText, MdcConfig, MdcThemeOptions, type ModuleOptions, type Node, type Nodes, type Parent, type Parents, type Properties, RehypeHighlightOption, type RehypePlugin, type RemarkPlugin, type Root, type RootContent, type RootContentMap, type RootData, type Text, type TextData, type Toc, type TocLink, type UnistPlugin, _default as default };
|
package/dist/module.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { BundledLanguage, LanguageRegistration, BundledTheme, ThemeRegistrationAny } from 'shiki';
|
|
3
3
|
import { Options } from 'remark-rehype';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { R as RehypeHighlightOption, M as MdcConfig, a as MdcThemeOptions } from './shared/mdc.4762b8bc.js';
|
|
5
|
+
export { A as Awaitable, b as HighlightResult, c as Highlighter, H as HighlighterOptions, d as defineConfig } from './shared/mdc.4762b8bc.js';
|
|
6
|
+
import 'unified';
|
|
7
|
+
import 'hast';
|
|
6
8
|
|
|
7
9
|
type MDCText = {
|
|
8
10
|
type: 'text';
|
|
@@ -28,65 +30,6 @@ interface MDCData extends Record<string, any> {
|
|
|
28
30
|
description: string;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
|
|
32
|
-
interface HighlighterOptions {
|
|
33
|
-
highlights?: number[];
|
|
34
|
-
meta?: string;
|
|
35
|
-
}
|
|
36
|
-
interface HighlightResult {
|
|
37
|
-
tree: ElementContent$1[];
|
|
38
|
-
className?: string;
|
|
39
|
-
style?: string;
|
|
40
|
-
inlineStyle?: string;
|
|
41
|
-
}
|
|
42
|
-
type Highlighter = (code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Promise<HighlightResult>;
|
|
43
|
-
interface RehypeHighlightOption {
|
|
44
|
-
theme?: MdcThemeOptions;
|
|
45
|
-
highlighter?: Highlighter;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type Awaitable<T> = T | Promise<T>;
|
|
49
|
-
interface MdcConfig {
|
|
50
|
-
/**
|
|
51
|
-
* Hooks for the unified markdown pipeline
|
|
52
|
-
*/
|
|
53
|
-
unified?: {
|
|
54
|
-
/**
|
|
55
|
-
* Custom setup for unified processor before other plugins
|
|
56
|
-
*/
|
|
57
|
-
pre?: (processor: Processor) => Awaitable<void | Processor>;
|
|
58
|
-
/**
|
|
59
|
-
* Custom setup for unified processor after remark but before rehype
|
|
60
|
-
*/
|
|
61
|
-
remark?: (processor: Processor) => Awaitable<void | Processor>;
|
|
62
|
-
/**
|
|
63
|
-
* Custom setup for unified processor after rehype
|
|
64
|
-
*/
|
|
65
|
-
rehype?: (processor: Processor) => Awaitable<void | Processor>;
|
|
66
|
-
/**
|
|
67
|
-
* Custom setup for unified processor after all plugins
|
|
68
|
-
*/
|
|
69
|
-
post?: (processor: Processor) => Awaitable<void | Processor>;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Custom hightlighter, available when `highlighter` is set to `custom`
|
|
73
|
-
*/
|
|
74
|
-
highlighter?: Highlighter$1;
|
|
75
|
-
/**
|
|
76
|
-
* Hooks for shiki
|
|
77
|
-
*/
|
|
78
|
-
shiki?: {
|
|
79
|
-
/**
|
|
80
|
-
* Get transformers for shiki
|
|
81
|
-
*/
|
|
82
|
-
transformers?: ShikiTransformer[] | ((code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Awaitable<ShikiTransformer[]>);
|
|
83
|
-
/**
|
|
84
|
-
* Custom setup for shiki instance, only called once on server or client
|
|
85
|
-
*/
|
|
86
|
-
setup?: (highlighter: HighlighterCore) => Awaitable<void>;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
33
|
interface TocLink {
|
|
91
34
|
id: string;
|
|
92
35
|
text: string;
|
|
@@ -567,7 +510,6 @@ interface Text extends Literal {
|
|
|
567
510
|
interface TextData extends Data {
|
|
568
511
|
}
|
|
569
512
|
|
|
570
|
-
declare function defineConfig(config: MdcConfig): MdcConfig;
|
|
571
513
|
declare const DefaultHighlightLangs: BundledLanguage[];
|
|
572
514
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
573
515
|
|
|
@@ -600,4 +542,4 @@ declare module '@nuxt/schema' {
|
|
|
600
542
|
}
|
|
601
543
|
}
|
|
602
544
|
|
|
603
|
-
export { type
|
|
545
|
+
export { type Comment, type CommentData, type Content, type Data, DefaultHighlightLangs, type Doctype, type DoctypeData, type Element, type ElementContent, type ElementContentMap, type ElementData, type Literal, type Literals, type MDCComment, type MDCData, type MDCElement, type MDCNode, type MDCParseOptions, type MDCParserResult, type MDCRoot, type MDCText, MdcConfig, MdcThemeOptions, type ModuleOptions, type Node, type Nodes, type Parent, type Parents, type Properties, RehypeHighlightOption, type RehypePlugin, type RemarkPlugin, type Root, type RootContent, type RootContentMap, type RootData, type Text, type TextData, type Toc, type TocLink, type UnistPlugin, _default as default };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { defu } from 'defu';
|
|
|
4
4
|
import { resolve } from 'pathe';
|
|
5
5
|
import fs from 'node:fs/promises';
|
|
6
6
|
import { pascalCase } from 'scule';
|
|
7
|
+
export { defineConfig } from './config.mjs';
|
|
7
8
|
|
|
8
9
|
const registerMDCSlotTransformer = (resolver) => {
|
|
9
10
|
extendViteConfig((config) => {
|
|
@@ -195,9 +196,6 @@ function addWasmSupport(nuxt) {
|
|
|
195
196
|
});
|
|
196
197
|
}
|
|
197
198
|
|
|
198
|
-
function defineConfig(config) {
|
|
199
|
-
return config;
|
|
200
|
-
}
|
|
201
199
|
const DefaultHighlightLangs = [
|
|
202
200
|
"js",
|
|
203
201
|
"jsx",
|
|
@@ -402,4 +400,4 @@ function resolveOptions(options) {
|
|
|
402
400
|
}
|
|
403
401
|
}
|
|
404
402
|
|
|
405
|
-
export { DefaultHighlightLangs, module as default
|
|
403
|
+
export { DefaultHighlightLangs, module as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createHighlighterCore, addClassToHast, isSpecialLang, isSpecialTheme } from "shiki/core";
|
|
2
2
|
import {
|
|
3
3
|
transformerNotationDiff,
|
|
4
4
|
transformerNotationErrorLevel,
|
|
@@ -16,7 +16,7 @@ export function createShikiHighlighter({
|
|
|
16
16
|
let shiki;
|
|
17
17
|
let configs;
|
|
18
18
|
async function _getShiki() {
|
|
19
|
-
const shiki2 = await
|
|
19
|
+
const shiki2 = await createHighlighterCore({
|
|
20
20
|
langs,
|
|
21
21
|
themes,
|
|
22
22
|
loadWasm: () => import("shiki/wasm")
|
|
@@ -46,6 +46,19 @@ export function createShikiHighlighter({
|
|
|
46
46
|
];
|
|
47
47
|
const highlighter = async (code, lang, theme, options = {}) => {
|
|
48
48
|
const shiki2 = await getShiki();
|
|
49
|
+
const codeToHastOptions = {
|
|
50
|
+
defaultColor: false,
|
|
51
|
+
meta: {
|
|
52
|
+
__raw: options.meta
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
if (lang === "ts-type" || lang === "typescript-type") {
|
|
56
|
+
lang = "typescript";
|
|
57
|
+
codeToHastOptions.grammarContextCode = "let a:";
|
|
58
|
+
} else if (lang === "vue-html" || lang === "vue-template") {
|
|
59
|
+
lang = "vue";
|
|
60
|
+
codeToHastOptions.grammarContextCode = "<template>";
|
|
61
|
+
}
|
|
49
62
|
const themesObject = typeof theme === "string" ? { default: theme } : theme || {};
|
|
50
63
|
const loadedThemes = shiki2.getLoadedThemes();
|
|
51
64
|
const loadedLanguages = shiki2.getLoadedLanguages();
|
|
@@ -80,11 +93,8 @@ export function createShikiHighlighter({
|
|
|
80
93
|
}
|
|
81
94
|
const root = shiki2.codeToHast(code.trimEnd(), {
|
|
82
95
|
lang,
|
|
96
|
+
...codeToHastOptions,
|
|
83
97
|
themes: themesObject,
|
|
84
|
-
defaultColor: false,
|
|
85
|
-
meta: {
|
|
86
|
-
__raw: options.meta
|
|
87
|
-
},
|
|
88
98
|
transformers: [
|
|
89
99
|
...transformers,
|
|
90
100
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MDCParserResult, MDCRoot } from '@nuxtjs/mdc';
|
|
1
|
+
import type { MDCParseOptions, MDCParserResult, MDCRoot } from '@nuxtjs/mdc';
|
|
2
2
|
export declare const createMarkdownParser: (inlineOptions?: MDCParseOptions) => Promise<(md: string) => Promise<MDCParserResult>>;
|
|
3
3
|
export declare const parseMarkdown: (md: string, inlineOptions?: MDCParseOptions) => Promise<MDCParserResult>;
|
|
4
4
|
export declare function contentHeading(body: MDCRoot): {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { Processor } from 'remark-rehype/lib';
|
|
1
2
|
import type { MDCParseOptions } from '@nuxtjs/mdc';
|
|
2
|
-
export declare const useProcessorPlugins: (processor: Processor, plugins?: Exclude<MDCParseOptions[
|
|
3
|
+
export declare const useProcessorPlugins: (processor: Processor, plugins?: Exclude<MDCParseOptions["rehype"] | MDCParseOptions["remark"], undefined>["plugins"]) => Promise<void>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { BuiltinTheme, Highlighter as Highlighter$1, ShikiTransformer, HighlighterCore } from 'shiki';
|
|
2
|
+
import { Processor } from 'unified';
|
|
3
|
+
import { ElementContent } from 'hast';
|
|
4
|
+
|
|
5
|
+
type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
|
|
6
|
+
interface HighlighterOptions {
|
|
7
|
+
highlights?: number[];
|
|
8
|
+
meta?: string;
|
|
9
|
+
}
|
|
10
|
+
interface HighlightResult {
|
|
11
|
+
tree: ElementContent[];
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: string;
|
|
14
|
+
inlineStyle?: string;
|
|
15
|
+
}
|
|
16
|
+
type Highlighter = (code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Promise<HighlightResult>;
|
|
17
|
+
interface RehypeHighlightOption {
|
|
18
|
+
theme?: MdcThemeOptions;
|
|
19
|
+
highlighter?: Highlighter;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type Awaitable<T> = T | Promise<T>;
|
|
23
|
+
interface MdcConfig {
|
|
24
|
+
/**
|
|
25
|
+
* Hooks for the unified markdown pipeline
|
|
26
|
+
*/
|
|
27
|
+
unified?: {
|
|
28
|
+
/**
|
|
29
|
+
* Custom setup for unified processor before other plugins
|
|
30
|
+
*/
|
|
31
|
+
pre?: (processor: Processor) => Awaitable<void | Processor>;
|
|
32
|
+
/**
|
|
33
|
+
* Custom setup for unified processor after remark but before rehype
|
|
34
|
+
*/
|
|
35
|
+
remark?: (processor: Processor) => Awaitable<void | Processor>;
|
|
36
|
+
/**
|
|
37
|
+
* Custom setup for unified processor after rehype
|
|
38
|
+
*/
|
|
39
|
+
rehype?: (processor: Processor) => Awaitable<void | Processor>;
|
|
40
|
+
/**
|
|
41
|
+
* Custom setup for unified processor after all plugins
|
|
42
|
+
*/
|
|
43
|
+
post?: (processor: Processor) => Awaitable<void | Processor>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Custom hightlighter, available when `highlighter` is set to `custom`
|
|
47
|
+
*/
|
|
48
|
+
highlighter?: Highlighter$1;
|
|
49
|
+
/**
|
|
50
|
+
* Hooks for shiki
|
|
51
|
+
*/
|
|
52
|
+
shiki?: {
|
|
53
|
+
/**
|
|
54
|
+
* Get transformers for shiki
|
|
55
|
+
*/
|
|
56
|
+
transformers?: ShikiTransformer[] | ((code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Awaitable<ShikiTransformer[]>);
|
|
57
|
+
/**
|
|
58
|
+
* Custom setup for shiki instance, only called once on server or client
|
|
59
|
+
*/
|
|
60
|
+
setup?: (highlighter: HighlighterCore) => Awaitable<void>;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare function defineConfig(config: MdcConfig): MdcConfig;
|
|
65
|
+
|
|
66
|
+
export { type Awaitable as A, type HighlighterOptions as H, type MdcConfig as M, type RehypeHighlightOption as R, type MdcThemeOptions as a, type HighlightResult as b, type Highlighter as c, defineConfig as d };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { BuiltinTheme, Highlighter as Highlighter$1, ShikiTransformer, HighlighterCore } from 'shiki';
|
|
2
|
+
import { Processor } from 'unified';
|
|
3
|
+
import { ElementContent } from 'hast';
|
|
4
|
+
|
|
5
|
+
type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
|
|
6
|
+
interface HighlighterOptions {
|
|
7
|
+
highlights?: number[];
|
|
8
|
+
meta?: string;
|
|
9
|
+
}
|
|
10
|
+
interface HighlightResult {
|
|
11
|
+
tree: ElementContent[];
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: string;
|
|
14
|
+
inlineStyle?: string;
|
|
15
|
+
}
|
|
16
|
+
type Highlighter = (code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Promise<HighlightResult>;
|
|
17
|
+
interface RehypeHighlightOption {
|
|
18
|
+
theme?: MdcThemeOptions;
|
|
19
|
+
highlighter?: Highlighter;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type Awaitable<T> = T | Promise<T>;
|
|
23
|
+
interface MdcConfig {
|
|
24
|
+
/**
|
|
25
|
+
* Hooks for the unified markdown pipeline
|
|
26
|
+
*/
|
|
27
|
+
unified?: {
|
|
28
|
+
/**
|
|
29
|
+
* Custom setup for unified processor before other plugins
|
|
30
|
+
*/
|
|
31
|
+
pre?: (processor: Processor) => Awaitable<void | Processor>;
|
|
32
|
+
/**
|
|
33
|
+
* Custom setup for unified processor after remark but before rehype
|
|
34
|
+
*/
|
|
35
|
+
remark?: (processor: Processor) => Awaitable<void | Processor>;
|
|
36
|
+
/**
|
|
37
|
+
* Custom setup for unified processor after rehype
|
|
38
|
+
*/
|
|
39
|
+
rehype?: (processor: Processor) => Awaitable<void | Processor>;
|
|
40
|
+
/**
|
|
41
|
+
* Custom setup for unified processor after all plugins
|
|
42
|
+
*/
|
|
43
|
+
post?: (processor: Processor) => Awaitable<void | Processor>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Custom hightlighter, available when `highlighter` is set to `custom`
|
|
47
|
+
*/
|
|
48
|
+
highlighter?: Highlighter$1;
|
|
49
|
+
/**
|
|
50
|
+
* Hooks for shiki
|
|
51
|
+
*/
|
|
52
|
+
shiki?: {
|
|
53
|
+
/**
|
|
54
|
+
* Get transformers for shiki
|
|
55
|
+
*/
|
|
56
|
+
transformers?: ShikiTransformer[] | ((code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Awaitable<ShikiTransformer[]>);
|
|
57
|
+
/**
|
|
58
|
+
* Custom setup for shiki instance, only called once on server or client
|
|
59
|
+
*/
|
|
60
|
+
setup?: (highlighter: HighlighterCore) => Awaitable<void>;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare function defineConfig(config: MdcConfig): MdcConfig;
|
|
65
|
+
|
|
66
|
+
export { type Awaitable as A, type HighlighterOptions as H, type MdcConfig as M, type RehypeHighlightOption as R, type MdcThemeOptions as a, type HighlightResult as b, type Highlighter as c, defineConfig as d };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ModuleOptions } from './module.js'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare module '@nuxt/schema' {
|
|
7
|
-
interface NuxtConfig { ['mdc']?: Partial<ModuleOptions> }
|
|
8
|
-
interface NuxtOptions { ['mdc']?: ModuleOptions }
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
declare module 'nuxt/schema' {
|
|
12
|
-
interface NuxtConfig { ['mdc']?: Partial<ModuleOptions> }
|
|
13
|
-
interface NuxtOptions { ['mdc']?: ModuleOptions }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export type { Awaitable, Comment, CommentData, Content, Data, DefaultHighlightLangs, Doctype, DoctypeData, Element, ElementContent, ElementContentMap, ElementData, HighlightResult, Highlighter, HighlighterOptions, Literal, Literals, MDCComment, MDCData, MDCElement, MDCNode, MDCParseOptions, MDCParserResult, MDCRoot, MDCText, MdcConfig, MdcThemeOptions, ModuleOptions, Node, Nodes, Parent, Parents, Properties, RehypeHighlightOption, RehypePlugin, RemarkPlugin, Root, RootContent, RootContentMap, RootData, Text, TextData, Toc, TocLink, UnistPlugin, default, defineConfig } from './module.js'
|
|
1
|
+
export { type Awaitable, type HighlightResult, type Highlighter, type HighlighterOptions, type defineConfig } from './module.js'
|
package/dist/types.d.ts
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ModuleOptions } from './module'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare module '@nuxt/schema' {
|
|
7
|
-
interface NuxtConfig { ['mdc']?: Partial<ModuleOptions> }
|
|
8
|
-
interface NuxtOptions { ['mdc']?: ModuleOptions }
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
declare module 'nuxt/schema' {
|
|
12
|
-
interface NuxtConfig { ['mdc']?: Partial<ModuleOptions> }
|
|
13
|
-
interface NuxtOptions { ['mdc']?: ModuleOptions }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export type { Awaitable, Comment, CommentData, Content, Data, DefaultHighlightLangs, Doctype, DoctypeData, Element, ElementContent, ElementContentMap, ElementData, HighlightResult, Highlighter, HighlighterOptions, Literal, Literals, MDCComment, MDCData, MDCElement, MDCNode, MDCParseOptions, MDCParserResult, MDCRoot, MDCText, MdcConfig, MdcThemeOptions, ModuleOptions, Node, Nodes, Parent, Parents, Properties, RehypeHighlightOption, RehypePlugin, RemarkPlugin, Root, RootContent, RootContentMap, RootData, Text, TextData, Toc, TocLink, UnistPlugin, default, defineConfig } from './module'
|
|
1
|
+
export { type Awaitable, type HighlightResult, type Highlighter, type HighlighterOptions, type defineConfig } from './module'
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/mdc",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Nuxt MDC module",
|
|
5
5
|
"repository": "nuxt-modules/mdc",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./dist/
|
|
10
|
+
"types": "./dist/module.d.ts",
|
|
11
11
|
"import": "./dist/module.mjs",
|
|
12
12
|
"require": "./dist/module.cjs"
|
|
13
13
|
},
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"test:watch": "vitest watch"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@nuxt/kit": "^3.12.
|
|
75
|
-
"@shikijs/transformers": "^1.
|
|
74
|
+
"@nuxt/kit": "^3.12.2",
|
|
75
|
+
"@shikijs/transformers": "^1.10.0",
|
|
76
76
|
"@types/hast": "^3.0.4",
|
|
77
77
|
"@types/mdast": "^4.0.4",
|
|
78
|
-
"@vue/compiler-core": "^3.4.
|
|
78
|
+
"@vue/compiler-core": "^3.4.31",
|
|
79
79
|
"consola": "^3.2.3",
|
|
80
80
|
"debug": "^4.3.5",
|
|
81
81
|
"defu": "^6.1.4",
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
"remark-parse": "^11.0.0",
|
|
101
101
|
"remark-rehype": "^11.1.0",
|
|
102
102
|
"scule": "^1.3.0",
|
|
103
|
-
"shiki": "^1.
|
|
103
|
+
"shiki": "^1.10.0",
|
|
104
104
|
"ufo": "^1.5.3",
|
|
105
|
-
"unified": "^11.0.
|
|
105
|
+
"unified": "^11.0.5",
|
|
106
106
|
"unist-builder": "^4.0.0",
|
|
107
107
|
"unist-util-visit": "^5.0.0",
|
|
108
108
|
"unwasm": "^0.3.9"
|
|
@@ -110,22 +110,22 @@
|
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@nuxt/devtools": "latest",
|
|
112
112
|
"@nuxt/eslint-config": "^0.3.13",
|
|
113
|
-
"@nuxt/module-builder": "^0.
|
|
114
|
-
"@nuxt/schema": "^3.12.
|
|
113
|
+
"@nuxt/module-builder": "^0.8.1",
|
|
114
|
+
"@nuxt/schema": "^3.12.2",
|
|
115
115
|
"@nuxt/test-utils": "^3.13.1",
|
|
116
116
|
"@nuxt/ui": "^2.17.0",
|
|
117
117
|
"@nuxtjs/mdc": "link:.",
|
|
118
|
-
"@types/node": "^20.14.
|
|
118
|
+
"@types/node": "^20.14.9",
|
|
119
119
|
"changelogen": "^0.5.5",
|
|
120
|
-
"eslint": "^9.
|
|
121
|
-
"nuxt": "^3.12.
|
|
120
|
+
"eslint": "^9.6.0",
|
|
121
|
+
"nuxt": "^3.12.2",
|
|
122
122
|
"rehype": "^13.0.1",
|
|
123
|
-
"release-it": "^17.
|
|
124
|
-
"typescript": "^5.
|
|
123
|
+
"release-it": "^17.4.0",
|
|
124
|
+
"typescript": "^5.5.2",
|
|
125
125
|
"vitest": "^1.6.0",
|
|
126
|
-
"vue-tsc": "^2.0.
|
|
126
|
+
"vue-tsc": "^2.0.24"
|
|
127
127
|
},
|
|
128
|
-
"packageManager": "pnpm@9.
|
|
128
|
+
"packageManager": "pnpm@9.4.0",
|
|
129
129
|
"release-it": {
|
|
130
130
|
"git": {
|
|
131
131
|
"commitMessage": "chore(release): release v${version}"
|