Skip to content

pantoken-root / tools/demo/src / DemoMarkdownItOptions

رابط: DemoMarkdownItOptions ​

گزینه‌ها برای demoMarkdownIt: فیلدهای resolveDemo به‌علاوهٔ امکان الحاق مثال‌های زنده (اختیاری).

گسترش می‌دهد ​

خصوصیات ​

base? ​

optional base?: string

مسیر پایهٔ سایت، مثلاً /pantoken/ (پیش‌فرض /).

ارث‌بری از ​

ResolveOptions.base


runnerPath? ​

optional runnerPath?: string

مسیر صفحهٔ رانر، نسبت به base (پیش‌فرض play/index.html).

ارث‌بری از ​

ResolveOptions.runnerPath


demosPath? ​

optional demosPath?: string

دایرکتوری منبع دموی خودمیزبان، نسبت به base (پیش‌فرض demos/).

ارث‌بری از ​

ResolveOptions.demosPath


cssUrls? ​

optional cssUrls?: readonly string[]

آدرس‌های URL فایل‌های استایل که رانر وارد می‌کند (در کروم آن و هر نتیجهٔ رندرشده): شیت‌های مؤلفه، شیت توکن چندتمی، و شیت‌های پلاگین/سِرفِیس. رانر با تغییر ویژگی data-pantoken-theme تم‌ها را اعمال می‌کند، بنابراین یک شیت توکن همهٔ تم‌ها را پوشش می‌دهد.

ارث‌بری از ​

ResolveOptions.cssUrls


labels? ​

optional labels?: RunnerLabels

محلی‌شده RunnerLabels برای زبانه‌های نمای رانر، که در URL رانر فوروارد می‌شود.

ارث‌بری از ​

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

برچسب‌های زبانهٔ نمای رانر را برای صفحهٔ جاری از markdown-it env.relativePath استخراج کنید — همان جستجوی محل (locale) که در DemoMarkdownItOptions.localePrefix استفاده می‌شود. برای یک سایت تک‌زبان این مقدار را حذف کنید (در این صورت رانر پیش‌فرض‌های انگلیسی خود را نشان می‌دهد) ).

پارامترها ​

relativePath ​

string

مقدار بازگشتی ​

RunnerLabels | undefined