Skip to content

pantoken / demo

demo

بتا

@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) داخل مارک‌داون بدون تغییر عبور می‌کند — از جمله هر خط‌لولهٔ ترجمه‌ای که بلوک‌های کد را حفظ می‌کند — بنابراین دمو هنگام بومی‌سازی سالم می‌ماند.

راه‌اندازی: "@demo" را به گزینه blockTags در TypeDoc اضافه کنید. پارسر کامنت آن فهرست را قبل از بارگذاری پلاگین‌ها می‌خواند، بنابراین یک پلاگین نمی‌تواند تگ را آن‌قدر دیر ثبت کند که هشدار «برچسب بلوک ناشناخته» را سرکوب کند؛ باید در typedoc.json شما باشد.

نمونه

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

متغیرها

توابع