Skip to content

pantoken-root / tools/demo/src / DemoMarkdownItOptions

Rajapinta: DemoMarkdownItOptions ​

Asetukset kohteelle demoMarkdownIt: resolveDemo -kentät sekä valinnainen live-esimerkin liittäminen.

Laajentaa ​

Ominaisuudet ​

base? ​

optional base?: string

Sivuston peruspolku, esim. /pantoken/ (oletus /).

Peritty kohteesta ​

ResolveOptions.base


runnerPath? ​

optional runnerPath?: string

Runner-sivun polku, suhteessa base (oletus play/index.html).

Peritty kohteesta ​

ResolveOptions.runnerPath


demosPath? ​

optional demosPath?: string

Omatoimisesti isännöity demo-lähdekansio, suhteessa base (oletus demos/).

Peritty kohteesta ​

ResolveOptions.demosPath


cssUrls? ​

optional cssUrls?: readonly string[]

Tyylitiedostojen URL-osoitteet, jotka runner lisää (sen chromeen ja jokaiseen renderöityyn tulokseen): komponenttityylit, moniteemainen token-tyylitiedosto ja plugin-/pintatiedostot. Runner vaihtaa teemoja kytkemällä data-pantoken-theme-attribuutin, joten yksi token-tyylitiedosto kattaa kaikki teemat.

Peritty kohteesta ​

ResolveOptions.cssUrls


labels? ​

optional labels?: RunnerLabels

Paikallistettu RunnerLabels ajurin näkymävälilehdille, välitetään runnerin URL:ssä.

Peritty kohteesta ​

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.

Parametrit ​

relativePath ​

string

Palauttaa ​

string


localeLabels? ​

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

Ratkaisee runnerin näkymävälilehtien etiketit nykyiselle sivulle, sen markdown-it env.relativePath — sama lokalisaation haku kuin DemoMarkdownItOptions.localePrefix. Jätä pois yhden kielen site (runner näyttää silloin englanninkieliset oletusarvonsa).

Parametrit ​

relativePath ​

string

Palauttaa ​

RunnerLabels | undefined