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
Markdown 与 jsx 混用
cs
fdfgdfg
fdsfs
一级引用
二级引用
三级引用
四级引用
五级引用
六级引用
//无序列表嵌套
- 123
- abc
- bcd
- cde
- 465
- 789 //有序列表嵌套
- abcd
- abcde
- abcde
- abcde
- bcde
- cdef
shaoliangdaima,danhangshiyong
表格
| 123 | 234 | 345 |
|---|---|---|
| abc | bcd | cde |
| abc | bcd | cde |
| abc | bcd | cde |
tab 栏
- Apple
- Orange
- Banana
This is an apple 🍎
This is an orange 🍊
This is a banana 🍌
- Windows
- macOS
Use Ctrl + C to copy.
Use Command + C to copy.
- Windows
- macOS
- Linux
I am Windows.
I am macOS.
I am Linux.
3.在线实时编辑器
实时编辑器
结果
Loading...
实时编辑器
结果
Loading...