Skip to content

pantoken-root / tools/demo/src / DemoMarkdownItOptions

Interface: DemoMarkdownItOptions ​

Options for demoMarkdownIt: the resolveDemo fields plus optional live-example seaming.

Extends ​

Properties ​

base? ​

optional base?: string

Site base path, e.g. /pantoken/ (default /).

Inherited from ​

ResolveOptions.base


runnerPath? ​

optional runnerPath?: string

Runner page path, relative to base (default play/index.html).

Inherited from ​

ResolveOptions.runnerPath


demosPath? ​

optional demosPath?: string

Self-hosted demo-source dir, relative to base (default demos/).

Inherited from ​

ResolveOptions.demosPath


cssUrls? ​

optional cssUrls?: readonly string[]

Stylesheet URLs the runner injects (into its chrome and every rendered result): the component sheets, the multi-theme token sheet, and the plugin/surface sheets. The runner themes by toggling the data-pantoken-theme attribute, so one token sheet covers every theme.

Inherited from ​

ResolveOptions.cssUrls


labels? ​

optional labels?: RunnerLabels

Localized RunnerLabels for the runner's view tabs, forwarded in the runner URL.

Inherited from ​

ResolveOptions.labels


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.

Parameters ​

relativePath ​

string

Returns ​

string


localeLabels? ​

optional localeLabels?: (relativePath) => RunnerLabels | undefined

Resolve the runner's view-tab labels for the current page, from its markdown-it env.relativePath — the same locale lookup as DemoMarkdownItOptions.localePrefix. Omit for a single-locale site (the runner then shows its English defaults).

Parameters ​

relativePath ​

string

Returns ​

RunnerLabels | undefined