CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

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

tessl install tessl/npm-storybook--addon-mdx-gfm@8.6.0

GitHub Flavored Markdown support addon for Storybook documentation.

Agent Success

Agent success rate when using this tile

69%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.97x

Baseline

Agent success rate without this tile

71%

task.mdevals/scenario-4/

MDX GFM Loader Preset

A Storybook preset wrapper that ensures GitHub Flavored Markdown support is merged into MDX compile options without disturbing existing settings. It can be consumed automatically by Storybook or invoked manually to patch custom loader configs.

Capabilities

Append GFM while preserving compile options

  • When loader options already include MDX compile settings with existing remark plugins, the hook returns new options that keep existing remark plugins in order and adds the GFM plugin at the end. @test
  • If MDX compile settings or remark plugins are absent, the hook initializes them and includes only the GFM plugin. @test

Non-intrusive behavior

  • Other MDX compile settings (for example, rehype plugins) remain unchanged, and the original options object is not mutated after applying the hook. @test

Manual application support

  • The helper can be called directly to patch arbitrary loader options objects outside of Storybook's preset auto-discovery, returning merged settings ready for MDX loaders. @test

Deprecation warning

  • On first use, it logs a deprecation warning about migrating to direct GFM configuration, avoiding repeated warnings on subsequent calls. @test

Implementation

@generates

API

export type RemarkPlugin = any;
export type MdxCompileOptions = {
  remarkPlugins?: RemarkPlugin[];
  [key: string]: any;
};

export type LoaderOptions = {
  mdxCompileOptions?: MdxCompileOptions;
  [key: string]: any;
};

export interface Logger {
  warn(message: string): void;
}

/**
 * Returns loader options that include GitHub Flavored Markdown support while preserving existing MDX settings.
 * Does not mutate the input object.
 */
export function applyGfmPreset(
  loaderOptions?: LoaderOptions,
  logger?: Logger
): LoaderOptions;

/**
 * Preset entry consumed by Storybook that delegates to the GFM-merging helper.
 * The preset exposes a loader-options hook recognized by Storybook.
 */
export const preset: {
  name: string;
  loaderOptionsHook: (loaderOptions?: LoaderOptions, logger?: Logger) => LoaderOptions;
};

Dependencies { .dependencies }

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

Provides a preset hook that merges MDX compile options with GitHub Flavored Markdown support.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@storybook/addon-mdx-gfm@8.6.x
tile.json