210 字
1 分鐘
Markdown Option Groups

Option groups keep equivalent instructions together without repeating the surrounding explanation. Each option accepts full block Markdown, while the selected value can synchronize with another group on the same page.

Choose a package manager#

Use @tab:active to select the initial option. A suffix after # supplies a stable value without changing the visible title.

npm

Install the package with npm:

Terminal window
npm install astro
pnpm

Install the package with pnpm:

Terminal window
pnpm.cmd add astro
Bun

Install the package with Bun:

Terminal window
bun add astro

Run the project#

This group shares the package-manager id. Selecting an option above updates the matching command below and remembers that choice for the next visit.

npm
Terminal window
npm run dev
pnpm
Terminal window
pnpm.cmd dev
Bun
Terminal window
bun run dev

Many alternatives#

Longer option rows remain on one line and scroll within their own navigation area on narrow screens.

Local workstation

Use the local toolchain while developing a feature.

Hosted preview environment

Publish a temporary preview for review.

Continuous integration

Run deterministic validation for every change.

Production deployment

Promote a verified artifact to production.

Offline recovery workflow

Restore from a local artifact when the network is unavailable.

Author syntax#

::: tabs#package-manager
@tab npm
Use npm instructions here.
@tab:active **pnpm**#pnpm
Use pnpm instructions here.
:::

Each group needs at least two @tab sections, and every section needs body content separated from its marker by a blank line. Invalid or incomplete groups remain readable as ordinary Markdown.

Markdown Option Groups
https://blog.kagurayami.top/zh-tw/posts/option-groups/
作者
Shirone
發佈於
2026-08-28
許可協議
CC BY-NC-SA 4.0

分享文章

生成精美分享圖或複製連結,與更多人分享本文。

繼續閱讀

沿著主題讀

基於共同的標籤與分類

換條路線

從其他文章中穩定抽取