1.4 KiB
1.4 KiB
title, icon, createTime, permalink
| title | icon | createTime | permalink |
|---|---|---|---|
| Code Pen | mingcute:codepen-line | 2025/10/08 10:41:58 | /en/guide/code/code-pen/ |
The theme supports embedding CodePen in Markdown files.
Configuration
This feature is disabled by default. You can enable it in the configuration file.
export default defineUserConfig({
theme: plumeTheme({
markdown: {
codepen: true, // [!code highlight]
},
})
})
Syntax
Basic syntax:
@[codepen](user/slash)
Extended options support:
@[codepen preview editable tab="css,result" theme="dark" height="500px" width="100%"](user/slash)
preview: Whether to render in preview modeeditable: Whether the content is editabletab: Default active tabs, defaults toresult, multiple tabs separated by,theme: Theme, options:darkandlightheight: Container height, defaults to400pxwidth: Container width, defaults to100%user: CodePen usernameslash: CodePen pen slug/identifier
Examples
Input:
@[codepen](leimapapa/RwOZQOW)
Output:
Preview Mode:
Input:
@[codepen preview](leimapapa/RwOZQOW)
Output:
Editable Mode:
Input:
@[codepen editable tab="html,result"](leimapapa/RwOZQOW)
Output: