1 line
3.4 KiB
JavaScript
1 line
3.4 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([["3142"],{4609:function(e,n,s){s.r(n),s.d(n,{default:()=>u,frontMatter:()=>o,metadata:()=>t,assets:()=>l,toc:()=>c,contentTitle:()=>d});var t=JSON.parse('{"id":"api/functions/getPlaygroundUrl","title":"Function: getPlaygroundUrl()","description":"getPlaygroundUrl(options): string","source":"@site/docs/api/functions/getPlaygroundUrl.md","sourceDirName":"api/functions","slug":"/api/functions/getPlaygroundUrl","permalink":"/docs/api/functions/getPlaygroundUrl","draft":false,"unlisted":false,"editUrl":"https://github.com/live-codes/livecodes/tree/develop/docs/docs/api/functions/getPlaygroundUrl.md","tags":[],"version":"current","frontMatter":{}}'),r=s("5893"),i=s("65");let o={},d="Function: getPlaygroundUrl()",l={},c=[{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Defined in",id:"defined-in",level:2}];function a(e){let n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"function-getplaygroundurl",children:"Function: getPlaygroundUrl()"})}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"getPlaygroundUrl"}),"(",(0,r.jsx)(n.code,{children:"options"}),"): ",(0,r.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Gets the URL to a LiveCodes playground (as a string) from the provided ",(0,r.jsx)(n.a,{href:"https://livecodes.io/docs/sdk/js-ts#embed-options",children:"options"}),".\nThis can be useful for providing links to run code in playgrounds."]}),"\n",(0,r.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,r.jsxs)(n.p,{children:["\u2022 ",(0,r.jsx)(n.strong,{children:"options"}),": ",(0,r.jsx)(n.a,{href:"/docs/api/interfaces/EmbedOptions",children:(0,r.jsx)(n.code,{children:"EmbedOptions"})})," = ",(0,r.jsx)(n.code,{children:"{}"})]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.a,{href:"https://livecodes.io/docs/sdk/js-ts#embed-options",children:"options"})," for the playground."]}),"\n",(0,r.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"string"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The URL of the playground (as a string)."}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"large objects like config and params are store in the url hash params while the rest are in the search params\nunless config is a string in which case it is stored in searchParams"}),"\n",(0,r.jsx)(n.h2,{id:"defined-in",children:"Defined in"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://github.com/live-codes/livecodes/blob/7617d5c8be5a2a8be8133f973d9e69eb9f86434d/src/sdk/index.ts#L391",children:"index.ts:391"})})]})}function u(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},65:function(e,n,s){s.d(n,{Z:function(){return d},a:function(){return o}});var t=s(7294);let r={},i=t.createContext(r);function o(e){let n=t.useContext(i);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); |