Skip to content

pantoken-root / tools/demo/src / DemoMarkdownItOptions

Giao diện: DemoMarkdownItOptions ​

Tùy chọn cho demoMarkdownIt: các trường của resolveDemo cộng với việc ghép ví dụ trực tiếp tùy chọn.

Mở rộng ​

Thuộc tính ​

base? ​

optional base?: string

Đường dẫn gốc của site, ví dụ /pantoken/ (mặc định /).

Kế thừa từ ​

ResolveOptions.base


runnerPath? ​

optional runnerPath?: string

Đường dẫn trang runner, tương đối so với base (mặc định play/index.html).

Kế thừa từ ​

ResolveOptions.runnerPath


demosPath? ​

optional demosPath?: string

Thư mục nguồn demo tự lưu trữ, tương đối so với base (mặc định demos/).

Kế thừa từ ​

ResolveOptions.demosPath


cssUrls? ​

optional cssUrls?: readonly string[]

Các URL stylesheet mà runner chèn (vào chrome của nó và mọi kết quả được render): các tệp stylesheet của component, bảng token đa-theme, và các stylesheet plugin/bề mặt. Runner thay đổi theme bằng cách chuyển đổi thuộc tính data-pantoken-theme, nên một bảng token có thể áp dụng cho mọi theme.

Kế thừa từ ​

ResolveOptions.cssUrls


labels? ​

optional labels?: RunnerLabels

Đã địa phương hóa RunnerLabels cho các tab chế độ xem của runner, được chuyển tiếp trong URL của runner.

Kế thừa từ ​

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.

Tham số ​

relativePath ​

string

Trả về ​

string


localeLabels? ​

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

Lấy nhãn tab chế độ xem của runner cho trang hiện tại, từ markdown-it env.relativePath

— cùng phương thức tra cứu locale như DemoMarkdownItOptions.localePrefix. Bỏ qua cho một site chỉ dùng một ngôn ngữ (khi đó runner sẽ hiển thị mặc định tiếng Anh của nó).

Tham số ​

relativePath ​

string

Trả về ​

RunnerLabels | undefined