Import and show file content in MDX code blocks

Viewed 52

I'm using Docusaurus to build doc. Docusaurus use MDX.
I would like to show a .json file in the doc using a code block without needing to copy/past the file content.

Instead of writting this in my md doc:

Let see the content of the `helloworld.json` file :
'''json title="helloworld.json"
{
  "hello":"world"
}
'''

I would like to have a asserts/helloworld.json file and do something like:

Let see the content of the `helloworld.json` file :
'''json title="helloworld.json" from "asserts/helloworld.json"
'''
1 Answers
Related