跳到主要内容

· 阅读需 1 分钟
fool

md 文档与 jsx 混写记录,具体使用见:mdx 示例

提示

Use the power of React to create interactive blog posts.

<button onClick={() => alert("button clicked!")}>Click me!</button>

· 阅读需 1 分钟
fool

Docusaurus blogging features are powered by the blog plugin.

Simply add Markdown files (or folders) to the blog directory.

Regular blog authors can be added to authors.yml.

The blog post date can be extracted from filenames, such as:

  • 2019-05-30-welcome.md
  • 2019-05-30-welcome/index.md

A blog post folder can be convenient to co-locate blog post images:

Docusaurus Plushie

The blog supports tags as well!

And if you don't want a blog: just delete this directory, and use blog: false in your Docusaurus config.

· 阅读需 2 分钟

1.引入组件代码

直接引用组件代码
/src/pages/index
import React from "react";
import clsx from "clsx";
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Layout from "@theme/Layout";
import HomepageFeatures from "@site/src/components/HomepageFeatures";

import styles from "./index.module.css";
// import SearchBarWrapper from "../theme/SearchBar";

function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();
return (
<header className={clsx("hero hero--primary", styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/docs/intro"
>
JUST GONE FOR 5MIN ⏱️
</Link>
</div>
</div>
{/* <SearchBarWrapper></SearchBarWrapper> */}
</header>
);
}

export default function Home() {
const { siteConfig } = useDocusaurusContext();
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />"
>
<HomepageHeader />
<main>
<HomepageFeatures />
</main>
</Layout>
);
}

2.混用 mdx

Markdownjsx 混用

  • cs

  • fdfgdfg

  • fdsfs

一级引用

二级引用

三级引用

四级引用

五级引用

六级引用

//无序列表嵌套

  • 123
    • abc
    • bcd
    • cde
  • 465
  • 789 //有序列表嵌套
  1. abcd
    1. abcde
    2. abcde
    3. abcde
  2. bcde
  3. cdef

shaoliangdaima,danhangshiyong


表格

123234345
abcbcdcde
abcbcdcde
abcbcdcde

tab 栏

This is an orange 🍊
Use Ctrl + C to copy.
I am Windows.

3.在线实时编辑器

实时编辑器
结果
Loading...
实时编辑器
结果
Loading...

4.美人鱼图

5.CodeSandBox