内部示例
这是一个_仅限内部_的页面,用于展示在 Markdown 文档中嵌入代码的各种方式。
只是高亮一些代码,非交互式。使用与 playground 相同的渲染器,所以高亮样式将匹配。
```js
html`<h1>Hello ${name}</h1>`
```
html`<h1>Hello ${name}</h1>`
单文件示例
Permalink to "单文件示例"一个项目中的可编辑文件,下方有预览。
参数:
- 项目目录的路径,从
samples/PATH/project.json
开始。 - 要显示的项目文件名。
额外的project.json
配置选项:
previewHeight
:预览的高度,以像素为单位(默认120px
)。
{% playground-example "v3-docs/templates/define" "my-element.ts" %}
完整 IDE
Permalink to "完整 IDE"完全可编辑的 playground 项目,侧边有预览。
参数:
- (必需)项目目录的路径,从
samples/PATH/project.json
开始。
{% playground-ide "v3-docs/templates/define" %}
在你的project.config
中使用extends
来继承站点基础配置,将导入解析到lit-next
:
{
"extends": "/samples/v3-base.json",
}