Questions tagged [mdxjs]

MDX is an authorable format that lets users write JSX in markdown documents.

153 questions
4
votes
1 answer

Passing common prop to all components in MDX file, without adding the prop to each component

I've got mdx files with components that need to be locale aware. Lots of components. And they all need to be locale-aware. In the .mdx files, I can change them from this: to that: But then I'd need…
Félix Paradis
  • 5,165
  • 6
  • 40
  • 49
4
votes
1 answer

How to load external (remote) Markdown files into Docusaurus?

Seems like a very basic question, but I could not find an answer in SO, docs or GH issues: We are transferring an existing doc site to Docusaurus V2. Many of our .md files are stored across different GH repos (=different URLs), and we'd like to link…
Ariel Noyman
  • 53
  • 1
  • 8
4
votes
1 answer

How to use i18next / react-i18next inside MDX / Markdown files with MDXJS?

We use the MDXJS package to write content in Markdown and use React components in it. Is there a way of using the i18next / react-i18next package inside the MDX / Markdown files?
jakecahill
  • 53
  • 3
3
votes
1 answer

How to embed youtube videos in mdx files using Next.js with Nextra library?

I am using this Portfolio Starter Kit for my travel blog. The only feature I am missing there is a way to embed youtube videos into the blog post, so that they would play on-the-spot, without opening the video on youtube.com on a new page. I used…
3
votes
2 answers

Module not found: Can't resolve 'next-mdx-import-source-file'

I am trying to get @next/mdx running with the new app directory. I followed the setup in the Readme of the package but i get the following error message when I try to render an mdx page. I can not find any information on this package what so…
giggo1604
  • 481
  • 1
  • 5
  • 14
3
votes
0 answers

Next.js MDX rendering problem with remark-math and rehype-katex

I am using MDX in my NEXT.JS project with the react-math and rehype-katex plugins. When I render the MDX files it gives me errors: "LaTeX-incompatible input and strict mode is set to 'warn': In LaTeX, \ or \newline does nothing in display mode…
JL L
  • 31
  • 1
3
votes
2 answers

How can I integrate MDX with STRAPI

I am creating a project in which I am trying to use MDX with STRAPI but I am confused. How and where to integrate that, as MDX work with .mdx file but as I am using strapi it works with API Can anyone guide me throw this Below is my Github link…
Owaiz Yusufi
  • 849
  • 1
  • 14
  • 34
3
votes
0 answers

imported .mdx files does not get styles for inline-code and code previews

I ran into a problem / bug, when you import .mdx file inside another .mdx file, then imported file does not get styles for inline-code and code preview. Text is displayed, also headings are formatted but styles for these 2 specific things are…
Pinnci
  • 423
  • 2
  • 5
  • 20
3
votes
1 answer

When I try to load MDX in Next.js using mdx-js/react, I get a TypeError

Assumptions and what I want to achieve. Note, this question has been translated by Deepl Translations. I want to use mdx-js/react in Next.js to load mdx files. Environment. OS : macOS Bigsur node : 16.3 React : 17.0.2 Next : 12.0.7 We are using npm…
3
votes
1 answer

Reference Frontmatter in React MDX Markdown File

I have set up a next.js markdown blog using mdx: https://mdxjs.com/. I would like to be able to reference data in the frontmatter section within the mdx file itself. Something like this: // my-file.mdx --- title: "My blog post title" # {title} //…
Moshe
  • 6,011
  • 16
  • 60
  • 112
3
votes
0 answers

Using exported variable in MDX does not work

In the Getting Started documentation of mdxjs.com we see the following documentation: Defining variables with exports If you need to define a variable in your MDX document, you can use an export to do so. Not only do exports emit data, they…
b.lyte
  • 6,518
  • 4
  • 40
  • 51
3
votes
1 answer

How to get mdx file support (linting) in VS Code?

I have a vue.js project with the storybook addon. I am trying to write a story using the Docs addon which allows you to write stories in .mdx, I am having trouble getting linting to work in vs code. Thanks in advance and any help would be much…
Sobbles
  • 105
  • 1
  • 11
3
votes
1 answer

MDX blog just displays markdown content instead of rendering it while using `MDXProvider` from `@mdx-js/react` in Next JS

I am making a blog with MDX & Next.js but I am unable to render Markdown content. The blog post just shows markdown content as string. Here's my complete source code → https://github.com/deadcoder0904/blog-mdx-next/ I have the following folder…
deadcoder0904
  • 7,232
  • 12
  • 66
  • 163
3
votes
3 answers

Gatsby Mdx frontmatter is empty

I have a mdx gatsby page with frontmatter defined. --- title: About Me path: /about description: Some information about me. --- # About Me [Twitter](https://twitter.com/RainFire336) I have configured a default layout in the gatsby-config.js: { …
Rain336
  • 1,450
  • 14
  • 21
3
votes
1 answer

How to import images within a Gatsby blog Mdx file (for a slick carousel)

I am currently trying to setup a Gatsby's blog. While looking at the doc I came across Mdx, a way to use React component in Markdown file (which is an awesome concept by the way!). However, I quickly ran into a limitation: it seems like at the…
Mr Washington
  • 1,295
  • 14
  • 15
1
2
3
10 11