返回 reveal.js
index.ts
根目录 / plugin / markdown / index.ts
1 import type { MarkdownConfig, RevealPlugin } from 'reveal.js';
2 import type { Marked } from 'marked';
3
4 // @ts-expect-error The runtime implementation remains in JS during the migration.
5 import MarkdownImplementation from './plugin.js';
6
7 export interface MarkdownSlidifyOptions {
8 separator?: string | null;
9 verticalSeparator?: string | null;
10 notesSeparator?: string;
11 attributes?: string;
12 }
13
14 export interface MarkdownOptions extends MarkdownConfig {
15 animateLists?: boolean;
16 }
17
18 export interface MarkdownPlugin extends RevealPlugin {
19 id: 'markdown';
20 processSlides(scope: ParentNode): Promise<void[]>;
21 convertSlides(): Promise<void>;
22 slidify(markdown: string, options?: MarkdownSlidifyOptions): string;
23 readonly marked: Marked | null;
24 readonly markdownOptions: MarkdownOptions;
25 }
26
27 const Markdown = MarkdownImplementation as () => MarkdownPlugin;
28
29 export default Markdown;
30
30 lines TYPESCRIPT