Skip to content

pantoken / demo

demo

@pantoken/demo — ochr rendro system @demo.

@pantoken/typedoc-plugin-demo turns a @demo <spec> tag into a fenced demo block whose body is the spec (a bare URL or a <provider>:<ref> pair). This package resolves that spec into an embeddable iframe and renders the surrounding panel — an MDN-style "live sample."

Mae'n cyflwyno tri pheth: resolveDemo (spec → attributeau iframe, annibynnol o fframweithiau), a plugin markdown-it (demoMarkdownIt) sy'n troi blociau cod demo yn HTML y panel, a rhedegwr hunan-lety (@pantoken/demo/runner.html) — tudalen o'r un tarddiad sy'n llwytho demo HTML/CSS/JS amrwd ac yn ei rendro gyda'ch taflenni steil tocynnau wedi'u chwistrellu, felly nid oes angen cyfrif trydydd parti nac unrhyw ddatrysiadau fframio ar demos self:.

Enghraifft

ts
import { resolveDemo } from "@pantoken/demo";

resolveDemo("stackblitz:abc123").src; // → "https://stackblitz.com/edit/abc123?embed=1&…"
resolveDemo("self:button", { base: "/docs/", cssUrls: ["/docs/tokens.css"] }).src;

Rhyngwynebau

Newidynnau

Swyddogaethau