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) ผ่าน markdown โดยไม่ถูกแตะต้อง — รวมถึง pipeline การแปลใดๆ ที่รักษา บล็อกโค้ดไว้ — ดังนั้นเดโมจึงคงอยู่หลังการทำให้เป็นท้องถิ่น.

Setup: เพิ่ม "@demo" ลงในตัวเลือก blockTags ของ TypeDoc. ตัววิเคราะห์คอมเมนต์จะอ่านรายการนั้นก่อน ที่ปลั๊กอินจะโหลด ดังนั้นปลั๊กอินจะไม่สามารถลงทะเบียนแท็กได้ช้าเพียงพอที่จะยกเลิกการเตือน "unknown block tag" ; ต้องอยู่ใน typedoc.json ของคุณ.

ตัวอย่าง

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

ตัวแปร

ฟังก์ชัน