Skip to content

pantoken / tools/demo/src / DemoMarkdownItOptions

介面: DemoMarkdownItOptions

demoMarkdownIt 的選項:resolveDemo 欄位,以及可選的即時範例接合。

擴充自

屬性

base?

optional base?: string

網站基底路徑,例如 /pantoken/(預設 /)。

繼承自

ResolveOptions.base


runnerPath?

optional runnerPath?: string

Runner 頁面路徑,相對於 base(預設 play/index.html)。

繼承自

ResolveOptions.runnerPath


demosPath?

optional demosPath?: string

自我託管的 demo 原始碼目錄,相對於 base(預設 demos/)。

繼承自

ResolveOptions.demosPath


cssUrls?

optional cssUrls?: readonly string[]

Runner 注入的樣式表 URL(注入其 chrome 以及每個呈現結果):元件 樣式表、多主題代幣樣式表,以及外掛/表面樣式表。Runner 透過切換 data-pantoken-theme 屬性來切換主題,因此一個代幣樣式表即可涵蓋所有主題。

繼承自

ResolveOptions.cssUrls


liveExample?

optional liveExample?: LiveExampleOptions

When set, appends a live preview after each html fence on matching pages — the same markup, rendered live, beneath its source. Overlay examples (<dialog>, [popover]) are skipped: they're hidden until opened, so a ## Demo iframe drives their preview instead.


localePrefix?

optional localePrefix?: (relativePath) => string

Route a demo:self:<name> fence to a locale-specific self-hosted demo directory, from the current page's markdown-it env.relativePath (e.g. "hu/" for pages under hu/, "" for the root locale). Prepended to demosPath so the localized clone of a demo (translated prose, same markup) loads instead of the English source. Omit for a single-locale site.

參數

relativePath

string

回傳

string