markdownmdxjs

How to include markdown file (md) inside mdx file


plain.md

# plain markdown

some.mdx

# some mdx file

include './plain.md'

Result file

# some mdx file

# plain markdown

How to do something like this with mdxjs?


Solution

  • Oh, that's actually right in their docs. Was known as transclusion some time ago.

    import License from './license.md'
    import Contributing from './docs/contributing.mdx'
    
    # Hello, world!
    
    <License />
    
    ---
    
    <Contributing />