Skip to content

pantoken / demo

demo

@pantoken/demo@demo-systeama render-siidda.

@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."

Dat ođđasis leat golbma birra: resolveDemo (spec → iframe attributes, framework-agnostic), markdown-it-plugin (demoMarkdownIt) mii muhtun demo buoljiid panel HTML:ksi, ja eará-hosted runner (@pantoken/demo/runner.html) — sama-origin-sida mii vuollá nuvttin HTML/CSS/JS demo ja renderii dan token-stylesheettalaš injekterahtton. Dát leat maŋimuš váttis, dasgo self: demoid in leat vástit šaddan-ovttasvuhtii kontu dahje framing-rievdadusat.

Exempel

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;

Interfáčat

Variáblat

Fuššat