Skip to content

pantoken-root / 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

תיקיית מקור הדמו המאוחסנת באופן עצמאי, יחסית ל-base (ברירת מחדל demos/).

יורש מ־ ​

ResolveOptions.demosPath


cssUrls? ​

optional cssUrls?: readonly string[]

כתובות ה-URL של גיליונות הסגנון שה-runner מזריק (ל־chrome שלו ולכל תוצאה שנ-render): גיליונות הרכיב, גיליון הטוקנים רב-הנושאים, וגיליונות התוסף/משטח. ה-runner מחליף נושאים על ידי הפעלת/כיבוי התכונה data-pantoken-theme, לכן גיליון טוקנים אחד מכסה את כל הנושאים.

יורש מ־ ​

ResolveOptions.cssUrls


labels? ​

optional labels?: RunnerLabels

מקומי RunnerLabels עבור לשוניות התצוגה של ה-runner, מועבר ב-URL של ה-runner.

יורש מ־ ​

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.

פרמטרים ​

relativePath ​

string

מחזיר ​

string


localeLabels? ​

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

פתור את תוויות לשוניות התצוגה של ה-runner עבור הדף הנוכחי, מתוך markdown-it שלו env.relativePath — אותו חיפוש locale כמו DemoMarkdownItOptions.localePrefix. השמט עבור אתר בעל שפה אחת site (ה-runner יציג אז את ברירות המחדל באנגלית)).

פרמטרים ​

relativePath ​

string

מחזיר ​

RunnerLabels | undefined