Skip to content

pantoken / demo

demo

Beta

@pantoken/typedoc-plugin-demo — ein TypeDoc-Plugin für das Block-Tag @demo.

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.)

Der fence bleibt im Markdown unverändert — einschließlich jeder Übersetzungspipeline, die Codeblöcke bewahrt — sodass die Demo die Lokalisierung übersteht.

Einrichtung: Füge "@demo" zur blockTags-Option von TypeDoc hinzu. Der Kommentarparser liest diese Liste bevor Plugins geladen werden, sodass ein Plugin das Tag nicht mehr rechtzeitig registrieren kann, um die Warnung "unknown block tag" zu unterdrücken; es muss in deinem typedoc.json sein.

Beispiel

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

Variablen

Funktionen