CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-storybook--addon-mdx-gfm

GitHub Flavored Markdown support addon for Storybook documentation.

69

0.97x
Overview
Eval results
Files

task.mdevals/scenario-4/

Storybook MDX GFM auto-preset

A coding task to produce a helper that demonstrates how listing the GitHub Flavored Markdown addon in Storybook's addons array automatically enriches MDX compile options without manual wiring.

Capabilities

Auto-enables GFM when addon listed

  • With addons containing the Markdown addon and no docs.mdxCompileOptions provided, the produced MDX options include GitHub Flavored Markdown support via a remark plugin and leave other options unchanged. @test

Preserves existing MDX options

  • If docs.mdxCompileOptions already contains remarkPlugins or rehypePlugins, the returned options retain existing entries and append the GFM plugin only once. @test

Requires no manual wiring

  • The solution relies solely on the addon being listed in addons; no direct configuration of the GFM plugin in the main config is needed, yet the resulting options still include it. @test

Implementation

@generates

API

export interface DocsMdxCompileOptions {
  remarkPlugins?: unknown[];
  rehypePlugins?: unknown[];
}

export interface StorybookMainConfig {
  addons: string[];
  docs?: {
    mdxCompileOptions?: DocsMdxCompileOptions;
  };
}

export function buildDocsMdxOptions(config: StorybookMainConfig): Promise<DocsMdxCompileOptions>;

Dependencies { .dependencies }

@storybook/addon-mdx-gfm { .dependency }

Adds GitHub Flavored Markdown support for Storybook MDX through an auto-loaded preset entry.

Install with Tessl CLI

npx tessl i tessl/npm-storybook--addon-mdx-gfm

tile.json