Skip to content

pantoken / demo

demo

Bèta

@pantoken/typedoc-plugin-demo — een TypeDoc-plugin voor de @demo block tag.

Authors attach a live, embeddable demo to any symbol with @demo <spec>, where <spec> is either a bare URL or a <provider>:<ref> pair (for example stackblitz:abc123, codesandbox:xy12z, wp-playground:https://…/blueprint.json, or self:button). This plugin registers nothing about providers itself — it stays deliberately dumb and reusable: it moves each @demo tag's spec into a fenced demo block appended to the symbol's summary, and your docs renderer decides how to turn a spec into an iframe. (See @pantoken/demo for a renderer that resolves the providers.)

De codefence blijft ongewijzigd in markdown — inclusief elke vertaalpijplijn die codeblokken behoudt — zodat de demo lokalisatie overleeft.

Installatie: voeg "@demo" toe aan TypeDoc's blockTags optie. De commentaarparser leest die lijst voordat plugins worden geladen, dus een plugin kan de tag niet laat genoeg registreren om de "unknown block tag" waarschuwing te onderdrukken; het moet in je typedoc.json staan.

Voorbeeld

jsonc
// typedoc.json
{
  "plugin": ["typedoc-plugin-markdown", "@pantoken/typedoc-plugin-demo"],
  "blockTags": ["@param", "@returns", "@example", "@demo"]
}

Variabelen

Functies