Skip to content

pantoken / demo

demo

Beta(測試)

@pantoken/typedoc-plugin-demo — TypeDoc 的 @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.)

程式碼 fence 會原封不動地通過 markdown — 包括任何會保留 程式碼區塊的翻譯流程 — 因此示範在本地化後仍能保留。

設定:"@demo" 新增到 TypeDoc 的 blockTags 選項。註解解析器在 外掛載入之前就讀取該清單,因此外掛無法晚到到足以壓制 "未知的區塊標籤" 警告;它必須存在於你的 typedoc.json 中。

範例

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

變數

函式