import{B as e,P as t,_ as n,f as r,g as i,h as a,l as o}from"./runtime-core.esm-bundler-CZvn3YaB.js";import{t as s}from"./plugin-vue_export-helper-CxTVcLa7.js";var c=JSON.parse(`{"path":"/en/guide/code/code-sandbox/","title":"Code Sandbox | Guide","lang":"en-US","frontmatter":{"title":"Code Sandbox","icon":"lucide:codesandbox","createTime":"2025/10/08 03:42:13","permalink":"/en/guide/code/code-sandbox/","description":"The theme supports embedding Code Sandbox in Markdown files. Configuration This feature is disabled by default. You can enable it in the configuration file. .vuepress/config.ts ...","head":[["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Code Sandbox\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2025-10-09T07:46:05.000Z\\",\\"author\\":[]}"],["meta",{"property":"og:url","content":"https://theme-plume.vuejs.press/en/guide/code/code-sandbox/"}],["meta",{"property":"og:site_name","content":"Plume Theme"}],["meta",{"property":"og:title","content":"Code Sandbox"}],["meta",{"property":"og:description","content":"The theme supports embedding Code Sandbox in Markdown files. Configuration This feature is disabled by default. You can enable it in the configuration file. .vuepress/config.ts ..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2025-10-09T07:46:05.000Z"}],["meta",{"property":"article:modified_time","content":"2025-10-09T07:46:05.000Z"}],["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://theme-plume.vuejs.press/guide/code/code-sandbox/"}]]},"readingTime":{"minutes":0.54,"words":163},"git":{"createdTime":1759995965000,"updatedTime":1759995965000,"contributors":[{"name":"pengzhanbo","username":"pengzhanbo","email":"volodymyr@foxmail.com","commits":1,"avatar":"https://avatars.githubusercontent.com/pengzhanbo?v=4","url":"https://github.com/pengzhanbo"}],"changelog":[{"hash":"385059f214cb07fc9a098859e889432fb81f998b","time":1759995965000,"email":"volodymyr@foxmail.com","author":"pengzhanbo","message":"docs: update en docs (#708)"}]},"autoDesc":true,"filePathRelative":"en/guide/repl/codeSandbox.md","headers":[],"bulletin":false}`),l={name:`codeSandbox.md`},u={class:`code-block-title`,"data-title":`.vuepress/config.ts`},d={class:`code-block-title-bar`},f={class:`title`};function p(s,c,l,p,m,h){let g=e(`VPIcon`),_=e(`CodeSandboxViewer`);return t(),r(`div`,null,[c[2]||=o(`p`,null,[i(`The theme supports embedding `),o(`a`,{href:`https://codesandbox.io`,target:`_blank`,rel:`noopener noreferrer`},`Code Sandbox`),i(` in Markdown files.`)],-1),c[3]||=o(`h2`,{id:`configuration`,tabindex:`-1`},[o(`a`,{class:`header-anchor`,href:`#configuration`},[o(`span`,null,`Configuration`)])],-1),c[4]||=o(`p`,null,`This feature is disabled by default. You can enable it in the configuration file.`,-1),o(`div`,u,[o(`div`,d,[o(`span`,f,[n(g,{provider:`iconify`,name:`vscode-icons:file-type-typescript`}),c[0]||=i(`.vuepress/config.ts`,-1)])]),c[1]||=a(`
export default defineUserConfig({
theme: plumeTheme({
markdown: {
codesandbox: true,
},
})
})Embed Code Sandbox in the page:
@[codesandbox](id)Use Code Sandbox redirect button:
@[codesandbox button](workspace/id)@[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 pathCode Sandbox redirect button:
@[codesandbox button](reaction/5wyzu)Output:
`,13),n(_,{width:`100%`,height:`500px`,user:`reaction`,id:`5wyzu`,title:``,navbar:``,layout:``,type:`button`,filepath:``}),c[6]||=a(`Code Sandbox embedded in page:
@[codesandbox](5wyzu)Output:
`,3),n(_,{width:`100%`,height:`500px`,user:``,id:`5wyzu`,title:``,navbar:``,layout:``,type:`embed`,filepath:``})])}var m=s(l,[[`render`,p]]);export{c as _pageData,m as default};