export statements are active

Read in 5 min read, written by barbar

Test MDX with Context Consumer

Section 1

Heading For Components

Hello props in scope is working

Context Consumer: "demo started" 10

I am a component coming from outer MDXProvider

I am a dynamic component

Heading For Plugins

SubHeading For Flexible Markers

Marked texts: text with yellow phrase, text with red phrase, text with green phrase, and text with blue phrase.

SubHeading For Emojies

Some markdown content 👍

SubHeading For Flexible Paragraphs

Alert Text Centered

Warning Text Aligned Right

SubHeading For Flexible Containers

Warning

You have to put an empty line after export statements in the mdx files.

Exports May Be Harmful

Can you explain why the exports may cause harmful activities ?

The ways of removing exports
  • You can use disableExports: true option to remove all export statements
  • You can use a custom recma plugin to remove all exports other than default, but the declarations stay and work in the mdx (needs a recma plugin)

    What do you think about that?

Some Useful Tips

Recma Plugins

Recma plugins are very usefull for solving specific mdx issues.

Table of Contents (TOC)

The remark plugin remark-flexible-toc is the tool for creating TOC, especially for the mdx users. You can create a custom <Toc /> component, and use it in the mdx file like <Toc toc={toc} />.

Sample Details-Summary

The remark-flexible-containers can also make this kind of details-summary HTML elements.

Heading For Code Highlighting

demo.ts
typescript
// prettier-ignore
function Text(text: string) {console.log(text)}
const text = "next-mdx-remote-client";
Text(text);
page.tsx
diff
// example for deletion and addition lines
- { MDXRemote } from "next-mdx-remote";
+ { MDXClient } from "next-mdx-remote-client";

Section 2

Heading For GFM

Autolink www.example.com and inline code.

one tilde strikethrough or two tildes strikethrough

Here is deleted text and inserted text

Left Aligned HeaderRight Aligned Header
Content CellContent Cell
Content CellContent Cell

Heading For Miscellenous

SubHeading for Lists

  • List item with normal text
  • List item with bold text
  • List item with italic text

SubHeading For Escapes

"Authorize <GITHUB_USER>"

version of <operation>.<mount> <= 1.3.x

< 8ms (allowed one blank after "<")

escape opening curlybraces "{}"

SubHeading For Centering

Centering text and image is very easy !

cover

cover

SubHeading For Blockquates

blockquate markdown element

The @import is used to import style rules from other valid stylesheets.

custom blockquate element

The @import is used to import style rules from other valid stylesheets.