Skip to content

Commit f8735c1

Browse files
committed
Merge branch 'main' of github.com:kktjs/markdown-react-code-preview-loader
2 parents 52d6339 + 4082343 commit f8735c1

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

core/README-zh.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ mdObj.codeBlock // => 组件源码索引对象,从 markdown 索引到的示
8686
codeBlock: {
8787
17: 'import React from ...',
8888
77: 'import React from ...',
89-
base23: 'import React from ...'
89+
demo12: 'import React from ...'
9090
},
91-
components: { 17: ƒ, 77: ƒ, base23: ƒ },
92-
languages: { 17: 'jsx', 77: 'jsx', base23: 'jsx'},
91+
components: { 17: ƒ, 77: ƒ, demo12: ƒ },
92+
languages: { 17: 'jsx', 77: 'jsx', demo12: 'jsx'},
9393
source: "# Alert 确认对话框...."
9494
}
9595
```
@@ -109,7 +109,7 @@ export type CodeBlockData = {
109109

110110
## 配置 meta 标识
111111

112-
注意:需要在代码块示例中添加特殊的 `meta` 标识,`loader` 才会去索引对于的 `react` 示例,进行代码转换。
112+
注意 ⚠️:需要在代码块示例中添加特殊的 `meta` 标识,`loader` 才会去索引对于的 `react` 示例,进行代码转换。
113113

114114
1. `mdx:` 特殊标识前缀
115115
2. `mdx:preview` 控制是否进行进行示例索引,通过对应所在行号,获取需要的示例对象。
@@ -123,8 +123,10 @@ const Demo = ()=>{
123123
}
124124

125125
export default Demo
126-
\```
126+
\```
127+
```
127128

129+
```markdown
128130
\```tsx mdx:preview:demo12
129131
import React from "react"
130132
const Demo = ()=>{

core/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ mdObj.codeBlock // => The component source code index object, the sample sour
8686
codeBlock: {
8787
17: 'import React from ...',
8888
77: 'import React from ...',
89-
base23: 'import React from ...'
89+
demo12: 'import React from ...'
9090
},
91-
components: { 17: ƒ, 77: ƒ, base23: ƒ },
92-
languages: { 17: 'jsx', 77: 'jsx', base23: 'jsx'},
91+
components: { 17: ƒ, 77: ƒ, demo12: ƒ },
92+
languages: { 17: 'jsx', 77: 'jsx', demo12: 'jsx'},
9393
source: "# Alert 确认对话框...."
9494
}
9595
```
@@ -109,7 +109,7 @@ Pass the `markdown` file content string, and return the converted code block par
109109

110110
## Configure meta ID
111111

112-
Note: You need to add a special `meta` identifier to the code block example, and `loader` will index the `react` example for code conversion.
112+
Note ⚠️: You need to add a special `meta` identifier to the code block example, and `loader` will index the `react` example for code conversion.
113113

114114
1. `mdx:` special identifier prefix
115115
2. `mdx:preview` Controls whether to perform example indexing, and obtain the required example object through the corresponding line number.
@@ -123,8 +123,10 @@ const Demo = ()=>{
123123
}
124124

125125
export default Demo
126-
\```
126+
\```
127+
```
127128

129+
```markdown
128130
\```tsx mdx:preview:demo12
129131
import React from "react"
130132
const Demo = ()=>{

website/public/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<meta charset="utf-8" />
55
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
66
<meta name="theme-color" content="#000000" />
7-
<title>React Monorepo Template</title>
8-
<meta name="keywords" content="react,simple,monorepo,template,component,project,package,development" />
9-
<meta name="description" content="Simple React package development project example template." />
7+
<title>markdown-react-code-preview-loader</title>
8+
<meta name="keywords" content="react,loader,monorepo,react-component,component,webpack-loader,webpack5,webpack" />
9+
<meta name="description" content="Index example text in Markdown, converted to React components. The current package is the `loader` of `webpack`, which loads the `markdown` document by configuring the current `loader`, returning a `JS` object containing the `markdown` text, the example index in the `markdown` text." />
1010
<link rel="icon" href="%PUBLIC_URL%favicon.ico" />
1111
<!-- <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🦖</text></svg>"> -->
1212
</head>

0 commit comments

Comments
 (0)