Components

ドキュメントを authoring するときに手を伸ばす building blocks です — prose (README、tutorials、docs files)の中でも、JSDoc / TypeDoc の doc comments の中 でも使えます。これらは 2 つの flavour に分かれます:

  • Visual components — prose や comment に差し込むと、より richな UI 要素として render される markup です(callouts、steppers、tabs、live embeds、実行可能な playgrounds)。
  • Custom tags — 基本の JSDoc/TypeDoc が定義しない doc-comment block tags で、 theme がこれらを読み取って sidebar を形作ったり、あなたの code から live content を埋め込んだりします。

Visual components

prose の中でも doc-comment description の中でも同じやり方で authoring します (同じ converter を通って流れます):

ComponentWhat it doesPage
CalloutsNote / tip / warning / error admonitions (GitHub-style > [!TIP]).Callouts
StepsA numbered <steps> / <step> stepper.Steps
TabsA tabbed <tabs> / <tab> view.Tabs
EmbedsA sandboxed <iframe> live demo — a ```iframe fence or the @iframe tag.Embeds
Playgrounds"Open in CodePen / JSFiddle / CodeSandbox" from an @example or a code fence.Playground

Custom tags

基本の JSDoc と TypeDoc が定義しない block tags です — theme はあなたの source comments からそれらを読み取ります。2 つは sidebar を形作り、2 つは live content を 埋め込みます(そして prose の相当物を持ちます):

TagWhat it doesPage
@category <path> [order=N]Put a symbol's page in an explicit sidebar group (and optionally order it).@category
@order NA standalone within-group sort key for any symbol.@order
@iframe <url> key=valueEmbed a sandboxed live demo from a source comment.Embeds
@playground <providers> [filename=] [highlight=]Open an @example in a live playground.Playground

まず custom tags を有効にする — allowUnknownTags

setup の手順は 1 つ だけで、これらの tags が「動かない」最大の理由でもありま す: 基本の JSDoc は、認識しない tag を theme が走る に取り除いてしまいます。 あなたの jsdoc.json で unknown tags を on にしてください:

CODE
{
  "tags": { "allowUnknownTags": true }
}

これがないと、@category は default の kind sections に潰れ、@order は何もせず、 @iframe / @playground は決して render されません — しかも静かに。この site の jsdoc.json はこれを設定しています。

TypeDoc にはそうした flag は不要です — これらの tags をそのまま通します。 allowUnknownTags の要件は JSDoc に限られます。

Tags vs. prose — 2 つの入り口

custom tags は source-comment 版です。代わりに prose を書いているとき(README、 tutorial、docs file)には、同じ能力が tags なしで利用できます:

  • group / order frontmatter は guide page 上で @category / @order を 反映します(Build a guides site を参照)。
  • ```iframe fence@iframe を反映します(Embeds を参照)。
  • ```js playground fence<playground> container@playground を反映します(Playground を参照)。

こちらも参照

  • Structure your sidebar@category / @ordersectionOrderdocGroupsclubSidebarItemsmenu とどう組み合わ さるか。
  • Embeds — 共有の @iframe / ```iframe の config grammar の全体。
  • Playground@playground feature の全体: opts.playground、prose 版、そして provider ごとの options。