Skip to content

Commit

Permalink
doc: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 12, 2022
1 parent b92b053 commit 337e82b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,18 @@ export default Demo

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

```
Meta Tag Meta ID Meta Param
┈┈┈┈┈┈┈┈ ┈┈┈┈┈┈┈ ┈┈┈┈┈┈┈┈┈┈
╭┈┈┈┈┈┈┈┈╲‥‥‥‥‥‥‥‥‥‥‥‥‥‥╱‥‥‥‥‥‥‥╱‥‥‥‥┈┈┈┈╮
┆ ```jsx mdx:preview:demo12&boreder=0 ┆
┆ import React from "react" ┆
┆ const Demo = () => <div>Test</div> ┆
┆ export default Demo ┆
┆ ``` ┆
╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯
```

1. `mdx:` 特殊标识前缀
2. `mdx:preview` 控制是否进行进行示例索引,通过对应所在行号,获取需要的示例对象。
3. `mdx:preview:demo12` 通过 `demo12` 唯一标识,准确获取索引的 `示例代码``示例组件对象`
Expand Down
12 changes: 12 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,18 @@ const getCodeBlock: (child: MarkdownParseData['children'], opts?: Options) => Co

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

```
Meta Tag Meta ID Meta Param
┈┈┈┈┈┈┈┈ ┈┈┈┈┈┈┈ ┈┈┈┈┈┈┈┈┈┈
╭┈┈┈┈┈┈┈┈╲‥‥‥‥‥‥‥‥‥‥‥‥‥‥╱‥‥‥‥‥‥‥╱‥‥‥‥┈┈┈┈╮
┆ ```jsx mdx:preview:demo12&boreder=0 ┆
┆ import React from "react" ┆
┆ const Demo = () => <div>Test</div> ┆
┆ export default Demo ┆
┆ ``` ┆
╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯
```

1. `mdx:` special identifier prefix
2. `mdx:preview` Controls whether to perform example indexing, and obtain the required example object through the corresponding line number.
3. `mdx:preview:demo12` Uniquely identified by `demo12`, accurately obtain the `example code` or `example component object` of the index.
Expand Down

0 comments on commit 337e82b

Please sign in to comment.