# Fumadocs Core (the core library of Fumadocs): Remark Show
URL: /zh-TW/docs/headless/mdx/remark-show
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/headless/mdx/remark-show.zh-TW.mdx

依條件顯示內容。

## 使用方式 [#usage]

Remark Show 是用於 [`<show>`](/docs/next/markdown#show) 語法的 remark 外掛。Fumadocs MDX、`@fumadocs/astro` 與[本機 Markdown](/docs/next/integrations/content/local-md) 皆預設啟用此外掛。

當 `when` 表達式為 true 時，`<show>` 會算繪其內容。表達式會在頁面算繪時求值，因此可以讀取頁面的 props，例如[路徑參數](/docs/headless/page-conventions#path-params)。若 `<show>` 未指定 `when`，將無法通過編譯。

## 頁面資料 [#page-data]

未算繪的內容同樣不會納入頁面資料，包括目錄、[標題 ID](/docs/headless/mdx/headings#headings-with-expressions)、[結構化資料](/docs/headless/mdx/structure)以及[處理後的 Markdown](/docs/headless/mdx/remark-llms)。

<Callout type="warn">
這些資料來自 Rehype 目錄、Remark Structure 和 Remark LLMs。若未使用 Fumadocs MDX，它們會在編譯時期產生資料，
此時任何條件都尚未求值，因此含有 `<show>` 的文件
會編譯失敗。若使用自訂內容來源，請啟用[執行階段
輸出](/docs/headless/source-api/source#runtime-outputs)。
</Callout>

## 步驟與頁籤群組 [#steps-and-tab-groups]

`<show>` 可以包裹一個[步驟](/docs/headless/mdx/remark-steps)，或是[頁籤群組](/docs/next/markdown#tab-groups)中的程式碼區塊。請參閱[範例](/docs/next/markdown#show)。

* 在外掛設定中，請將 Remark Show 放在 Remark 步驟與 `remarkCodeTab` 之前。
* 請至少保留一個步驟或一個頁籤在 `<show>` 之外，否則每個 `<show>` 都會各自形成獨立的步驟或頁籤群組。