Markdown Code Config
The following options adds new code feature in Markdown, and can be set under markdown property in theme options.
Options
booleanWhether to enable tabs support.
See also: Markdown → Code Tabs and @vuepress/plugin-markdown-tab → codeTabs.
booleanWhether to enable file tree support.
See also: Markdown → File Tree and @vuepress/plugin-markdown-file-tree → fileTree.
boolean | MarkdownCodeTreePluginOptionsWhether to enable code tree support. You can also pass an object to customize the default height.
See also: Markdown → Code Tree and @vuepress/plugin-markdown-file-tree → codeTree.
number | string"320px"The default height of the code tree, accepts a CSS length or a number in pixels.
booleanWhether to enable preview support.
See also: Markdown → Preview and @vuepress/plugin-markdown-preview.
PlaygroundGlobalOptionsPlayground options.
See also: Markdown → Playground.
(BuiltInPlaygroundPreset | PlaygroundOptions)[]Playground presets. BuiltInPlaygroundPreset is one of "ts", "vue" and "unocss", which enables a built-in preset, while an object configures a custom playground.
stringPlayground container name.
string"Playground"Playground component name.
(data: PlaygroundData) => Record<string, string>Props getter. Its data argument has the following types:
interface PlaygroundCodeConfig {
/**
* Code block extension
*
* @description It's based on filename, not code fence language
*/
ext: string;
/** Code block content */
content: string;
}
interface PlaygroundData {
/** Title of Playground */
title?: string;
/**
* Import map file name
*
* @default "import-map.json"
*/
importMap?: string;
/** Playground files info */
files: Record<
/** File name */
string,
/** File detail */
PlaygroundCodeConfig
>;
/**
* Playground settings
*
* @description It's parsed result of json content after setting directive
*/
settings: Record<string, unknown>;
/** hash key based on playground content */
key: string;
}{ ts?: TSPresetPlaygroundOptions; vue?: VuePresetPlaygroundOptions; unocss?: UnoPresetPlaygroundOptions }Playground config of the built-in presets.
TSPresetPlaygroundOptionsOptions of the ts preset.
string"https://www.typescriptlang.org/play"External playground service url.
VuePresetPlaygroundOptionsOptions of the vue preset.
string"https://sfc.vuejs.org/"External playground service url.
booleanWhether to use the development version.
booleanWhether to enable SSR.
UnoPresetPlaygroundOptionsOptions of the unocss preset.
string"https://unocss.dev/play"External playground service url.
booleanWhether to enable Kotlin playground support.
See also: Markdown → Kotlin Playground.
booleanWhether to enable Vue playground support.
See also: Markdown → Vue Playground.
booleanWhether to enable sandpack playground support.
See also: Markdown → Sandpack Playground.
Partial<CodeDemoOptions> | booleanWhether to enable code demo support.
See also: Markdown → Code Demo.
string[]External JS libraries for CodePen, JsFiddle only.
string[]External CSS libraries for CodePen, JsFiddle only.
Warning
The above two options are only used by third-party code demo service, you need to import these libraries in head to get it work.
booleantrueWhether to display the JSFiddle button.
booleantrueWhether to display the CodePen button.
"top" | "left" | "right""left"CodePen editor layout.
string"101"CodePen editor status.
Changelog
0c1aa-onde40e-onfc49f-onb15c6-on68504-onb1230-on1b917-on22787-on