MDX语法示例

一、tab标签#

二、文本背景#

Docusaurus green and Facebook blue are my favorite colors.

I can write Markdown alongside my JSX!

三、代码高亮#

console.log('Every repo must come with a mascot.');

3.1 代码标题#

/src/components/HelloCodeTitle.js
function HelloCodeTitle(props) {
return <h1>Hello, {props.name}</h1>;
}

3.2 指定某一行选中#

function HighlightSomeText(highlight) {
if (highlight) {
return 'This text is highlighted!';
}
return 'Nothing highlighted';
}
import React from 'react';
function MyComponent(props) {
if (props.isBar) {
return <div>Bar</div>;
}
return <div>Foo</div>;
}
export default MyComponent;

四、背景标签#

note

The content and title can include markdown.

You can specify an optional title

Heads up! Here's a pro-tip.

info

Useful information.

caution

Warning! You better pay attention!

danger

Danger danger, mayday!

Your Title

The content and title can include markdown.