MDX is an authorable format that lets users write JSX in markdown documents.
Questions tagged [mdxjs]
153 questions
0
votes
1 answer
Next App can reach a file while in localhost but not in production
I am trying to build a page that reads some content mdx files inside the src/bounties/content/bounties folder, and my app can make it work while in localhost.
But, everytime I upload and host it in Vercel or in Netlify, it gives me the ENOET…

Duca
- 25
- 4
0
votes
0 answers
Docusaurus: Getting a syntax error on straight forward link
I'm getting the following syntax errors:
3:02:58 PM: SyntaxError: /opt/build/repo/docs/Flow/c-flo-Pages_Components_Checkbox_2005eb3f-280e-48da-94aa-5075bc92edb6.md: Unterminated JSX contents. (125:16)
3:02:58 PM: 123 |
0
votes
0 answers
Can JavaScript variables be used for dynamic MDX headings, in Docusaurus?
Question
Suppose I have a string variable, e.g. const variable="foo";
Is there a way to create dynamic headings in Docusaurus, by using MD syntax. For example something like:
# Heading {variable}
Problem
For a variable: const…
0
votes
1 answer
MDX custom components using data-attributes
Is it possible to define custom MDX components using a data-attribute of the HTML element?
I'm working on a Next.js blog using contentlayer for MDX and Rehype Pretty Code for syntax highlighting code blocks. Below is the HTML output structure from…

Gangula
- 5,193
- 4
- 30
- 59
0
votes
1 answer
onVisitHighlightedLine cannot push classname using Rehype Pretty code
I'm using Rehype Pretty code to add syntax highlighting to my MDX blog. But I'm not able to get the line highlighting to work.
As per the documentation and few other resources, below is the configuration that should work, but I'm getting the…

Gangula
- 5,193
- 4
- 30
- 59
0
votes
0 answers
Code snippets in MDX files of storybook stories
I am using Storybook 7 and want to add some tutorials to my storybook. In these tutorials I would like to show some code snippets as examples.
But when I add code like that I get various linter errors (e.g. XML element expected). Despite the errors…

Hansi Hansenbaum
- 117
- 13
0
votes
0 answers
Language Translation of Markdown file using Docusaurus
Is it possible to implement a SIDEBAR_LABEL language translation of Markdown/mdx file using Docusaurus?
https://docusaurus.io/docs/i18n/git#translate-the-files
mkdir -p i18n/fr/docusaurus-plugin-content-docs/current
cp -r…

Miracle
- 1
- 1
0
votes
1 answer
how do i put a splatter image in between mdx content like a mdx blog?
i have an mdx blog that renders a blog post.
pages/index.tsx
…

deadcoder0904
- 7,232
- 12
- 66
- 163
0
votes
1 answer
Astro: Shiki syntax highlighting with remark-code-extra plugin doesn't work
I have the following config in my astro.config.mjs file but the syntax highlighting doesn't work after I added the remark-code-extra plugin. Not sure how should I configure it to make it work. Thanks in advance!
import tokyoStorm from…

icube
- 2,578
- 1
- 30
- 63
0
votes
0 answers
How to use component props from MDX with Codehike Bright in NextJS
I am using Codehike Bright with NextJS 13.2 and the app directory (using React Server Components).
I am also using MDX.
This is the TSX file that loads the MDX content and passes a version prop - page.tsx:
import Content from './content.mdx'
export…

caprica
- 3,902
- 4
- 19
- 39
0
votes
1 answer
How to get remark plugins to work in Next13 MDX?
Summary
I'm trying to get remark plugins to work. In this example, github flavored markdown.
I'm following these docs: https://beta.nextjs.org/docs/guides/mdx#remark-and-rehype-plugins
My next.config.mjs looks like this..
import { remarkPlugins }…

wongz
- 3,255
- 2
- 28
- 55
0
votes
2 answers
mui typography overide table format
I have a site that imports markdown or mdx files and renders them.
I have formatted the normal markdown tables using
table: (props) => {props.children}
this works fine.
however, I have a component that wraps…

Rob
- 1
0
votes
2 answers
How to obtain frontmatter (meta) from .mdx in nextjs?
I set up nextjs13 with ts support and mdx according to the docs.
Now I want to import the frontmatter in one file which was exported from another file. Is that possible?
pages/post.mdx contains
export const meta = {
title: "some…

Page not found
- 2,454
- 2
- 10
- 19
0
votes
1 answer
MDX-Bundler in Nextjs: Importing Components that import Components?
Using mdx-bundler, can I not import a file which imports another file?
Right now, in my .mdx file I do:
import MyComponent from './MyComponent'
This is my *mdx* file.
This works, when looks like this:
const…

antonwilhelm
- 5,768
- 4
- 19
- 45
0
votes
1 answer
I need to know how to render the html iframe element from a rich text format
I am reviewing the Strapi tutorial on building a blog with Nextjs with Strapi. tutorial here
They indicate that a package for the markdown format must be downloaded.
And here is where it is used:
And the result is this:
I just took a screenshot…

Cesar Mejias
- 191
- 1
- 7