Skip to content

Recma plugins support #10237

@pomber

Description

@pomber

TL;DR: Docusaurus supports remark and rehype plugins, but not recma plugins.


Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

I'm working on an example showing how to use Code Hike v1 + Docusaurus, but Docusaurus is missing the option to pass recma plugins that Code Hike needs.

Reproducible demo

code-hike/examples#8

Actual behavior

The MDXOptions from @docusaurus/mdx-loader:

export type MDXOptions = {
  admonitions: boolean | Partial<AdmonitionOptions>;
  remarkPlugins: MDXPlugin[];
  rehypePlugins: MDXPlugin[];
  beforeDefaultRemarkPlugins: MDXPlugin[];
  beforeDefaultRehypePlugins: MDXPlugin[];
};

Expected behavior

export type MDXOptions = {
  admonitions: boolean | Partial<AdmonitionOptions>;
  remarkPlugins: MDXPlugin[];
  rehypePlugins: MDXPlugin[];
  recmaPlugins: MDXPlugin[]; // <-- code hike needs this
  beforeDefaultRemarkPlugins: MDXPlugin[];
  beforeDefaultRehypePlugins: MDXPlugin[];
};

recmaPlugins is already supported by the ProcessorOptions from @mdx-js/mdx v3.0.0 that @docusaurus/mdx-loader is using.

Your environment

  • Docusaurus version used: 3.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions