mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-24 11:08:16 +08:00
1.3 KiB
1.3 KiB
url
| url |
|---|
| /en/guide/code/code-pen/index.md |
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: