Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recma plugins support #10237

Closed
2 of 6 tasks
pomber opened this issue Jun 19, 2024 · 2 comments · Fixed by #10241
Closed
2 of 6 tasks

Recma plugins support #10237

pomber opened this issue Jun 19, 2024 · 2 comments · Fixed by #10241
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@pomber
Copy link

pomber commented Jun 19, 2024

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
@pomber pomber added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jun 19, 2024
@slorber slorber added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jun 20, 2024
@slorber
Copy link
Collaborator

slorber commented Jun 20, 2024

👍 that should be easy to add

What I understand is that you need plugins (docs, blog, pages) to support a recmaPlugins option as well right? It's not just the mdx loader parameters.

@pomber
Copy link
Author

pomber commented Jun 20, 2024

What I understand is that you need plugins (docs, blog, pages) to support a recmaPlugins option as well right? It's not just the mdx loader parameters.

Yes! I clicked (go to definition) on the remarkPlugins option from the docusaurus config and it took me directly to the MDXOptions type. That's why I put it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants