Skip to content

Commit 9e6bc9c

Browse files
committed
Merge branch 'main' of github.com:kktjs/markdown-react-code-preview-loader
2 parents 893bf77 + 8be8c48 commit 9e6bc9c

File tree

4 files changed

+96
-6
lines changed

4 files changed

+96
-6
lines changed

.github/workflows/ci.yml

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,66 @@ jobs:
1818
- run: npm run build
1919
- run: npm run doc
2020

21+
- name: Generate Contributors Images
22+
uses: jaywcjlove/github-action-contributors@main
23+
with:
24+
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
25+
output: ./website/build/CONTRIBUTORS.svg
26+
avatarSize: 42
27+
28+
- name: Create Tag
29+
id: create_tag
30+
uses: jaywcjlove/create-tag-action@v1.3.6
31+
with:
32+
package-path: ./core/package.json
33+
34+
- name: get tag version
35+
id: tag_version
36+
uses: jaywcjlove/changelog-generator@v1.5.3
37+
38+
- name: Deploy Website
39+
uses: peaceiris/actions-gh-pages@v3
40+
with:
41+
user_name: 'github-actions[bot]'
42+
user_email: 'github-actions[bot]@users.noreply.github.com'
43+
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
publish_dir: ./website/build
46+
47+
- name: Generate Changelog
48+
id: changelog
49+
uses: jaywcjlove/changelog-generator@v1.5.3
50+
with:
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot)
53+
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)
54+
55+
- name: Create Release
56+
uses: ncipollo/release-action@v1
57+
if: steps.create_tag.outputs.successful
58+
with:
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
name: ${{ steps.create_tag.outputs.version }}
61+
tag: ${{ steps.create_tag.outputs.version }}
62+
body: |
63+
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/markdown-react-code-preview-loader@${{steps.changelog.outputs.version}}/file/README.md) [![npm version](https://img.shields.io/npm/v/markdown-react-code-preview-loader.svg)](https://www.npmjs.com/package/markdown-react-code-preview-loader)
64+
65+
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/kktjs/markdown-react-code-preview-loader/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
66+
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
67+
68+
```bash
69+
npm i markdown-react-code-preview-loader@${{steps.changelog.outputs.version}}
70+
```
71+
72+
${{ steps.changelog.outputs.changelog }}
73+
2174
- name: Deploy
2275
uses: peaceiris/actions-gh-pages@v3
2376
with:
2477
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
publish_dir: ./website/build
78+
publish_dir: ./website/build
79+
80+
- uses: JS-DevTools/npm-publish@v1
81+
with:
82+
token: ${{ secrets.NPM_TOKEN }}
83+
package: ./core/package.json

core/README-zh.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
markdown-react-code-preview-loader
22
===
33

4+
[![CI](https://github.com/kktjs/markdown-react-code-preview-loader/actions/workflows/ci.yml/badge.svg)](https://github.com/kktjs/markdown-react-code-preview-loader/actions/workflows/ci.yml)
5+
[![npm version](https://img.shields.io/npm/v/markdown-react-code-preview-loader.svg)](https://www.npmjs.com/package/markdown-react-code-preview-loader)
6+
[![npm unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/markdown-react-code-preview-loader/file/README.md)
7+
48
索引 Markdown 中的示例文本,转换为 React 组件。当前包是 `webpack``loader`,通过配置当前 `loader` 加载 `markdown` 文档,返回一个 `JS` 对象,包含 `markdown` 文本,`markdown` 文本中的示例索引。
59

610
## 安装 Loader
@@ -111,8 +115,8 @@ export type CodeBlockData = {
111115
2. `mdx:preview` 控制是否进行进行示例索引,通过对应所在行号,获取需要的示例对象。
112116
3. `mdx:preview:demo12` 通过 `demo12` 唯一标识,准确获取索引的 `示例代码``示例组件对象`
113117

114-
```markdown mdx:preview
115-
\```tsx
118+
```markdown
119+
\```tsx mdx:preview
116120
import React from "react"
117121
const Demo = ()=>{
118122
return <div>测试</div>
@@ -131,7 +135,7 @@ export default Demo
131135
\```
132136
```
133137

134-
## Development
138+
## 开发
135139

136140
```bash
137141
npm install # Install dependencies
@@ -140,6 +144,17 @@ npm run hoist # Install sub packages dependencies
140144
npm run watch:loader
141145
npm run start
142146
```
147+
148+
## 贡献者
149+
150+
一如既往,感谢我们出色的贡献者!
151+
152+
<a href="https://github.com/kktjs/markdown-react-code-preview-loader/graphs/contributors">
153+
<img src="https://kktjs.github.io/markdown-react-code-preview-loader/CONTRIBUTORS.svg" />
154+
</a>
155+
156+
[action-contributors](https://github.com/jaywcjlove/github-action-contributors) 生成。
157+
143158
### License
144159

145160
Licensed under the MIT License.

core/README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
markdown-react-code-preview-loader
22
===
33

4+
[![CI](https://github.com/kktjs/markdown-react-code-preview-loader/actions/workflows/ci.yml/badge.svg)](https://github.com/kktjs/markdown-react-code-preview-loader/actions/workflows/ci.yml)
5+
[![npm version](https://img.shields.io/npm/v/markdown-react-code-preview-loader.svg)](https://www.npmjs.com/package/markdown-react-code-preview-loader)
6+
[![npm unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/markdown-react-code-preview-loader/file/README.md)
7+
48
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.
59

610
## Install Loader
@@ -111,8 +115,8 @@ Note: You need to add a special `meta` identifier to the code block example, and
111115
2. `mdx:preview` Controls whether to perform example indexing, and obtain the required example object through the corresponding line number.
112116
3. `mdx:preview:demo12` Uniquely identified by `demo12`, accurately obtain the `example code` or `example component object` of the index.
113117

114-
```markdown mdx:preview
115-
\```tsx
118+
```markdown
119+
\```tsx mdx:preview
116120
import React from "react"
117121
const Demo = ()=>{
118122
return <div>测试</div>
@@ -140,6 +144,17 @@ npm run hoist # Install sub packages dependencies
140144
npm run watch:loader
141145
npm run start
142146
```
147+
148+
## Contributors
149+
150+
As always, thanks to our amazing contributors!
151+
152+
<a href="https://github.com/kktjs/markdown-react-code-preview-loader/graphs/contributors">
153+
<img src="https://kktjs.github.io/markdown-react-code-preview-loader/CONTRIBUTORS.svg" />
154+
</a>
155+
156+
Made with [action-contributors](https://github.com/jaywcjlove/github-action-contributors).
157+
143158
### License
144159

145160
Licensed under the MIT License.

core/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"module": "esm/index.js",
1414
"types": "lib/index.d.ts",
1515
"files": [
16+
"README-zh.md",
17+
"README.md",
1618
"lib",
1719
"src",
1820
"esm"

0 commit comments

Comments
 (0)