diff --git a/docs/docs/example/demo.tsx b/docs/docs/example/demo.tsx new file mode 100644 index 0000000000000000000000000000000000000000..e1db7d2099cce5724ee0eef39d827b92a2a0240a --- /dev/null +++ b/docs/docs/example/demo.tsx @@ -0,0 +1,9 @@ +import { Editor } from "@mini-markdown-rc/editor"; + +export default function () { + return ( +
\ No newline at end of file
diff --git a/docs/guide/api.mdx b/docs/docs/guide/api.mdx
similarity index 100%
rename from docs/guide/api.mdx
rename to docs/docs/guide/api.mdx
diff --git a/docs/guide/ast-parser.mdx b/docs/docs/guide/ast-parser.mdx
similarity index 95%
rename from docs/guide/ast-parser.mdx
rename to docs/docs/guide/ast-parser.mdx
index f33ea5650d106c767515a7f9f6607f703f1f70da..867de55bc4572fd53c91148cb6df2bf710b661c2 100644
--- a/docs/guide/ast-parser.mdx
+++ b/docs/docs/guide/ast-parser.mdx
@@ -1,4 +1,4 @@
-import { PackageManagerTabs } from "@theme";
+import { PackageManagerTabs } from "@rspress/theme-default";
# AST 解析
@@ -141,6 +141,18 @@ import { parseMarkdown, transformHtml } from "@mini-markdown-rc/ast-parser";
const { parseMarkdown, transformHtml } = require("@mini-markdown-rc/ast-parser");
```
+## 样式
+
+该库导出了一个默认样式文件,用于渲染转换后的html样式。
+
+> 对于代码块的样式,需要手动引入样式文件。
+>
+> `import "highlight.js/styles/atom-one-dark.css";`
+
+```ts
+import '@mini-markdown-rc/ast-parser/style/index.css'
+```
+
## 案例
```js
diff --git a/docs/guide/custom-preview.mdx b/docs/docs/guide/custom-preview.mdx
similarity index 100%
rename from docs/guide/custom-preview.mdx
rename to docs/docs/guide/custom-preview.mdx
diff --git a/docs/guide/grammar.mdx b/docs/docs/guide/grammar.mdx
similarity index 100%
rename from docs/guide/grammar.mdx
rename to docs/docs/guide/grammar.mdx
diff --git "a/docs/guide/img/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267\346\240\217-component.png" "b/docs/docs/guide/img/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267\346\240\217-component.png"
similarity index 100%
rename from "docs/guide/img/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267\346\240\217-component.png"
rename to "docs/docs/guide/img/\350\207\252\345\256\232\344\271\211\345\267\245\345\205\267\346\240\217-component.png"
diff --git a/docs/guide/index.mdx b/docs/docs/guide/index.mdx
similarity index 100%
rename from docs/guide/index.mdx
rename to docs/docs/guide/index.mdx
diff --git a/docs/guide/shortcut-keys.mdx b/docs/docs/guide/shortcut-keys.mdx
similarity index 100%
rename from docs/guide/shortcut-keys.mdx
rename to docs/docs/guide/shortcut-keys.mdx
diff --git a/docs/guide/start.mdx b/docs/docs/guide/start.mdx
similarity index 78%
rename from docs/guide/start.mdx
rename to docs/docs/guide/start.mdx
index 8b5edf145a24faeb3e800d08e59793fa3aa9a6a6..5261d73153c9f93c4d9b2170f10cfaef16174a1f 100644
--- a/docs/guide/start.mdx
+++ b/docs/docs/guide/start.mdx
@@ -1,4 +1,4 @@
-import { PackageManagerTabs } from '@theme';
+import { PackageManagerTabs } from '@rspress/theme-default';
# 快速开始
@@ -12,7 +12,7 @@ import { PackageManagerTabs } from '@theme';
## 使用
-```tsx [src/App.tsx]
+```tsx title="App.tsx"
import { Editor } from "@mini-markdown-rc/editor";
export default function App() {
diff --git a/docs/index.md b/docs/docs/index.md
similarity index 100%
rename from docs/index.md
rename to docs/docs/index.md
diff --git a/docs/public/gitee.svg b/docs/docs/public/gitee.svg
similarity index 100%
rename from docs/public/gitee.svg
rename to docs/docs/public/gitee.svg
diff --git a/docs/public/logo.svg b/docs/docs/public/logo.svg
similarity index 100%
rename from docs/public/logo.svg
rename to docs/docs/public/logo.svg
diff --git a/docs/public/react_light.svg b/docs/docs/public/react_light.svg
similarity index 100%
rename from docs/public/react_light.svg
rename to docs/docs/public/react_light.svg
diff --git a/docs/example/index.tsx b/docs/example/index.tsx
deleted file mode 100644
index d35fb38e370a20a684be1dbb7635260bb3c750fc..0000000000000000000000000000000000000000
--- a/docs/example/index.tsx
+++ /dev/null
@@ -1,152 +0,0 @@
-import React, { FC, useEffect, useRef, useState } from "react";
-import { Editor, insertContent, ToolbarManager } from "@mini-markdown-rc/editor";
-import type { Callback, EditorRef } from "@mini-markdown-rc/editor";
-import { Button, message } from "antd";
-// 可根据需要引入不同的主题
-import "highlight.js/styles/atom-one-dark.css";
-import { ViewUpdate } from "@mini-markdown-rc/editor";
-
-export const frontmatter = {
- // 声明布局类型
- pageType: "page",
-};
-
-const App: FC = () => {
- // 请求测试
- const handleUpload = async (file: File, callback: Callback) => {
- await new Promise((resolve) => {
- setTimeout(() => {
- console.log("settimeout 上传成功", file);
- resolve({});
- }, 1500);
- });
- callback({
- url: "https://www.baidu.com/img/flexible/logo/pc/result@2.png",
- alt: "alt",
- });
- message.success("上传成功");
- };
-
- const [theme, setTheme] = useState<"light" | "dark">("light");
- const changeTheme = () => {
- setTheme(theme === "light" ? "dark" : "light");
- };
-
- const handleChange = (val: string, view: ViewUpdate) => {
- console.log(val, view);
- };
-
- const handlePatseUpload = async (file: File, callback: Callback) => {
- await new Promise((resolve) => {
- setTimeout(() => {
- console.log("settimeout 上传成功", file);
- resolve({});
- }, 1500);
- });
- callback({
- url: "https://www.baidu.com/img/flexible/logo/pc/result@2.png",
- alt: "123",
- });
- message.success("上传成功");
- };
-
- const editorRef = useRefhellored
+ +```python +def hello(): + print('hello') + return +``` + +`hello
` + +| 姓名 | 年龄 | 地址 | +| ------ | ------- | ------- | +| 张三 | 18 | `北京` | +| 李四 | 20 | `上海` | + +----- + +asdss**asd**asd_123_ + +**asd** + +asd`code``code`asd--uder--~~bolang~~ + +--uder--[link](./demo.md) + +--- + +# h1 `code` _bolang_ +## h2 `code` --bolang-- + +> blockquote `code` + +> blockquote `code` +> +> blockquote _bolang_ + + + + +- 1 + - asd + - 啊啥的、2 + - 啊啥的、2 + - 啊啥的、asdsa +- 2 + - 2asd +- 3 + +```html + + + ${html} + + +