Skip to content

pantoken / demo

demo

@pantoken/demo — te taha whakaatu o te pūnaha @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."

Ka tuku mea e toru: resolveDemo (spec → āhuatanga iframe, kāore e herea ki tētahi anga), he taapiri markdown-it (demoMarkdownIt) e huri ana i ngā here demo ki te HTML o te panui, me tētahi kaiwhakahaere e tūngaia ana e koe anō (@pantoken/demo/runner.html) — he whārangi same-origin e tiki ana i tētahi tauira HTML/CSS/JS mārama ka whakaatu i runga i ngā pepa kāwai (token) kua whakakuiia, nō reira kāore e hiahiatia he pūkete o tētahi atu rānei, ā, kāore e hiahiatia he rongoā whakamaru (framing) mō ngā tauira self:.

Tauira

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;

Ngā Atanga

Ngā Taipūtī

Ngā Mahi