Skip to content

Vizel API / core/src / VizelMarkdownFlavor

Interface: VizelMarkdownFlavor

Defined in: packages/core/src/markdown/types.ts:72

First-class Markdown flavor plugin.

A flavor bundles three concerns:

  • markdownItPlugins — registered against the parser instance so the flavor recognizes its source-syntax extensions on input.
  • nodeSerializers / markSerializers — override the default markdown serialization of named Tiptap node / mark types so the flavor controls its output syntax.
  • config — ambient configuration consumed by extensions that need flavor-specific tuning (e.g. callout output style, wiki-link bracket style).

Vizel ships five built-in flavors as VizelMarkdownFlavor instances: vizelCommonMarkFlavor, vizelGfmFlavor, vizelObsidianFlavor, vizelDocusaurusFlavor, vizelPandocFlavor. Compose them with composeVizelMarkdownFlavors to derive a custom flavor.

Example

ts
import { composeVizelMarkdownFlavors, vizelGfmFlavor } from "@vizel/core";
import footnote from "markdown-it-footnote";

const myFlavor = composeVizelMarkdownFlavors(
  [
    vizelGfmFlavor,
    { name: "footnote", markdownItPlugins: [(md) => md.use(footnote)] },
  ],
  "gfm-with-footnotes"
);

Properties

config?

ts
readonly optional config?: Readonly<Record<string, unknown>>;

Defined in: packages/core/src/markdown/types.ts:94

Ambient configuration consumed by flavor-aware extensions. Later flavors shallow-merge over earlier ones when composed.


markdownItPlugins?

ts
readonly optional markdownItPlugins?: readonly (md) => void[];

Defined in: packages/core/src/markdown/types.ts:79

Plugins applied to the parser's MarkdownIt instance, in order. Use this to extend the parser with new source-syntax recognizers.


markSerializers?

ts
readonly optional markSerializers?: Readonly<Record<string, VizelMarkSerializer>>;

Defined in: packages/core/src/markdown/types.ts:89

Per-mark serializer overrides keyed by Tiptap mark type name. Later flavors override earlier ones when composed.


name

ts
readonly name: string;

Defined in: packages/core/src/markdown/types.ts:74

Stable identifier for the flavor (e.g. "gfm").


nodeSerializers?

ts
readonly optional nodeSerializers?: Readonly<Record<string, VizelNodeSerializer>>;

Defined in: packages/core/src/markdown/types.ts:84

Per-node serializer overrides keyed by Tiptap node type name. Later flavors override earlier ones when composed.

Released under the MIT License.