Skip to content

pantoken / demo

demo

Beta

@pantoken/typedoc-plugin-demo — một plugin TypeDoc cho thẻ block @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.)

Hàng rào (fence) đi xuyên qua markdown không thay đổi — bao gồm bất kỳ pipeline dịch nào giữ nguyên các khối mã — nên demo vẫn tồn tại sau khi bản địa hóa.

Setup: thêm "@demo" vào tuỳ chọn blockTags của TypeDoc. Trình phân tích nhận xét đọc danh sách đó trước khi plugins load, nên một plugin không thể đăng ký thẻ này muộn đến mức để ngăn cảnh báo "unknown block tag" ; nó phải nằm trong typedoc.json của bạn.

Ví dụ

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

Biến

Hàm