Skip to content

Commit 341d864

Browse files
committed
edit docs
1 parent 57d613b commit 341d864

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

docs/docs/sdk/web-components.mdx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,33 @@
22

33
import LiveCodes from '../../src/components/LiveCodes.tsx';
44

5-
The Web Components SDK is a thin wrapper around the [JavaScript SDK](js-ts.mdx) to provide an easy to use custom element (`<live-codes>`), yet retaining the full power, by having access to the [SDK methods](js-ts.mdx#sdk-methods).
5+
The Web Components SDK is a wrapper around the [JavaScript SDK](js-ts.mdx) to provide an easy to use custom element (`<live-codes>`), yet retaining the full power, by having access to the [SDK methods](js-ts.mdx#sdk-methods).
66

77
## Demo
88

99
export const webComponentsSDKDemo = {
10-
html: `<live-codes height="80vh" params='{"console": "open"}'>\n <template>\n <template lang="html">\n <h1>Hello World!</h1>\n </template>\n <style lang="scss">\n h1 { color: royalblue; }\n </style>\n <script lang="ts" active>\n console.log('hello!');\n </script>\n </template>\n</live-codes>\n\n<script src="https://cdn.jsdelivr.net/npm/livecodes@${process.env.SDK_VERSION}/web-components.js"></script>\n`,
10+
markup: {
11+
language: 'html',
12+
content: `<live-codes height="90vh" params='{"console": "open"}'>
13+
<template>
14+
<template lang="html">
15+
<h1>Hello World!</h1>
16+
</template>
17+
<style lang="scss">
18+
h1 { color: royalblue; }
19+
</style>
20+
<script lang="ts" active>
21+
console.log('hello!');
22+
</script>
23+
</template>
24+
</live-codes>
25+
26+
<script src="https://cdn.jsdelivr.net/npm/livecodes@${process.env.SDK_VERSION}/web-components.js"></script>
27+
`,
28+
},
1129
};
1230

13-
<LiveCodes params={webComponentsSDKDemo} height="80vh" />
31+
<LiveCodes config={webComponentsSDKDemo} height="80vh" />
1432

1533
## Installation
1634

@@ -238,16 +256,14 @@ The following HTML attributes are supported and correspond to [embed options](js
238256
| `loading` | `string` | When to load the playground (`"click"`, `"lazy"`, or `"eager"`). |
239257
| `params` | `string` | A JSON string representing [URL Query parameters](../configuration/query-params.mdx). |
240258
| `template` | `string` | A [starter template](../features/templates.mdx) to load. |
241-
| `view` | `string` | Deprecated! The `view` option has been moved to `config.view`. For headless mode use the `headless` attribute. |
242259
| `headless` | `boolean` | Whether to use the headless mode of LiveCodes. |
243-
| `lite` | `boolean` | Deprecated! Use `config.mode = "lite"` instead. |
244260
| `height` | `string` | Sets the [height of playground container](js-ts.mdx#height) element. |
245261
| `data-default-styles` | `string` | If set to `"false"`, disables the [default styles](js-ts.mdx#default-styles) applied to the playground container. |
246262

247263
Example:
248264

249265
```html title="HTML"
250-
<live-codes template="react" loading="lazy"></live-codes>
266+
<live-codes template="react" loading="click"></live-codes>
251267

252268
<script type="module">
253269
import 'livecodes/web-components';

docs/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import siteConfig from '@generated/docusaurus.config';
55
...(globalThis as any).process,
66
env: {
77
...(globalThis as any).process?.env,
8-
SDK_VERSION: siteConfig.customFields.sdkVersion,
8+
SDK_VERSION: siteConfig.customFields?.sdkVersion,
99
},
1010
};
1111

12-
let docsBaseUrl = siteConfig.customFields.docsBaseUrl as string | undefined;
12+
let docsBaseUrl = siteConfig.customFields?.docsBaseUrl as string | undefined;
1313
if (docsBaseUrl && !docsBaseUrl.endsWith('/')) {
1414
docsBaseUrl = docsBaseUrl + '/';
1515
}

0 commit comments

Comments
 (0)