You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/livecodes/framework-wrappers/SKILL.md
+120-1Lines changed: 120 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -271,7 +271,7 @@ function App() {
271
271
<!-- Basic usage -->
272
272
<live-codes template="react"></live-codes>
273
273
274
-
<!-- With config -->
274
+
<!-- With config property -->
275
275
<live-codes height="400px"></live-codes>
276
276
277
277
<script>
@@ -282,6 +282,125 @@ function App() {
282
282
</script>
283
283
```
284
284
285
+
### Web Components: Declarative Code via Children
286
+
287
+
The web component supports providing code declaratively as child elements inside a wrapper `<template>`. This avoids JavaScript string escaping and enables IDE syntax highlighting.
288
+
289
+
The outer `<template>` makes inner `<style>` and `<script>` elements inert (no side effects on the embedding page).
290
+
291
+
#### Single-Editor Mode
292
+
293
+
```html
294
+
<live-codes height="400px">
295
+
<template>
296
+
<template lang="html">
297
+
<h1>Hello World</h1>
298
+
<p>Welcome to <strong>LiveCodes</strong></p>
299
+
</template>
300
+
<style lang="scss">
301
+
body {
302
+
font-family: sans-serif;
303
+
h1 {
304
+
color: royalblue;
305
+
}
306
+
}
307
+
</style>
308
+
<script lang="ts">
309
+
console.log('Hello from TypeScript!');
310
+
</script>
311
+
</template>
312
+
</live-codes>
313
+
```
314
+
315
+
If `lang` is omitted, defaults are `html`, `css`, and `javascript`.
316
+
317
+
<!--
318
+
#### Multi-File Mode
319
+
320
+
Use a `filename` attribute. Language is inferred from the file extension.
0 commit comments