mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
1.3 KiB
1.3 KiB
title, icon, createTime, permalink
| title | icon | createTime | permalink |
|---|---|---|---|
| Code Sandbox | lucide:codesandbox | 2025/10/08 03:42:13 | /en/guide/code/code-sandbox/ |
The theme supports embedding Code Sandbox in Markdown files.
Configuration
This feature is disabled by default. You can enable it in the configuration file.
export default defineUserConfig({
theme: plumeTheme({
markdown: {
codesandbox: true, // [!code highlight]
},
})
})
Syntax
Basic Syntax
Embed Code Sandbox in the page:
@[codesandbox](id)
Use Code Sandbox redirect button:
@[codesandbox button](workspace/id)
Extended Options
@[codesanbox title="xxx" layout="Editor+Preview" height="500px" navbar="false" console](id#filepath)
id: Code Sandbox identifiertitle: Code Sandbox titlelayout: Code preview layout, options:Preview,Editor,Editor+Previewheight: Code preview heightnavbar: Whether to display navigation bar, defaults to trueconsole: Whether to display console, defaults to falsefilepath: File path
Examples
Code Sandbox redirect button:
@[codesandbox button](reaction/5wyzu)
Output:
Code Sandbox embedded in page:
@[codesandbox](5wyzu)
Output: