Skip to content

Commit fd0fa48

Browse files
committed
Merge branch 'main' of github.com:uiwjs/react-code-preview-layout
2 parents 7719efc + ef67ac5 commit fd0fa48

File tree

4 files changed

+57
-7
lines changed

4 files changed

+57
-7
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branch:
5+
branches:
66
- main
77

88
jobs:
@@ -29,8 +29,53 @@ jobs:
2929
output: ./website/build/CONTRIBUTORS.svg
3030
avatarSize: 42
3131

32+
- name: Create Tag
33+
id: create_tag
34+
uses: jaywcjlove/[email protected]
35+
with:
36+
package-path: ./core/package.json
37+
38+
- name: get tag version
39+
id: tag_version
40+
uses: jaywcjlove/[email protected]
41+
3242
- name: Deploy Website
3343
uses: peaceiris/actions-gh-pages@v3
3444
with:
45+
user_name: 'github-actions[bot]'
46+
user_email: 'github-actions[bot]@users.noreply.github.com'
47+
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
3548
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: ./website/build
49+
publish_dir: ./website/build
50+
51+
- name: Generate Changelog
52+
id: changelog
53+
uses: jaywcjlove/[email protected]
54+
with:
55+
token: ${{ secrets.GITHUB_TOKEN }}
56+
filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot)
57+
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)
58+
59+
- name: Create Release
60+
uses: ncipollo/release-action@v1
61+
if: steps.create_tag.outputs.successful
62+
with:
63+
token: ${{ secrets.GITHUB_TOKEN }}
64+
name: ${{ steps.create_tag.outputs.version }}
65+
tag: ${{ steps.create_tag.outputs.version }}
66+
body: |
67+
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/react-code-preview-layout@${{steps.changelog.outputs.version}}/file/README.md) [![npm version](https://img.shields.io/npm/v/react-code-preview-layout.svg)](https://www.npmjs.com/package/react-code-preview-layout)
68+
69+
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/uiwjs/react-code-preview-layout/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
70+
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
71+
72+
```bash
73+
npm i idoc@${{steps.changelog.outputs.version}}
74+
```
75+
76+
${{ steps.changelog.outputs.changelog }}
77+
78+
- uses: JS-DevTools/npm-publish@v1
79+
with:
80+
token: ${{ secrets.NPM_TOKEN }}
81+
package: ./core/package.json

core/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
react-code-preview-layout
2-
==========
2+
===
33

4-
用于简化示例代码块与示例预览布局 ,内置`@uiw/react-codepen``@uiw/react-codesandbox`依赖,用于动态地从代码示例生成`codepen`项目和`codesandbox`项目。
4+
[![CI](https://github.com/uiwjs/react-code-preview-layout/actions/workflows/ci.yml/badge.svg)](https://github.com/uiwjs/react-code-preview-layout/actions/workflows/ci.yml)
5+
[![NPM version](https://img.shields.io/npm/v/react-code-preview-layout.svg?style=flat)](https://npmjs.org/package/react-code-preview-layout)
6+
7+
展示 `代码``代码在线预览示例` 布局的一个 react 组件。配合 [markdown-react-code-preview-loader](https://github.com/kktjs/markdown-react-code-preview-loader) Webpack Loader 可很好的用于文档中的 react 示例展示。
8+
9+
组件内置 [`@uiw/react-codepen`](https://github.com/uiwjs/react-codepen)[`@uiw/react-codesandbox`](https://github.com/uiwjs/react-codesandbox) 依赖,用于动态地将代码示例生成 [`codepen`](https://github.com/uiwjs/react-codepen) 项目和 [`codesandbox`](https://codesandbox.io/) 项目。
510

611
```bash
712
npm install react-code-preview-layout --save
@@ -138,7 +143,7 @@ npm run start
138143
一如既往,感谢我们出色的贡献者!
139144

140145
<a href="https://github.com/uiwjs/react-code-preview-layout/graphs/contributors">
141-
<img src="https://github.com/uiwjs/react-code-preview-layout/blob/gh-pages/CONTRIBUTORS.svg />
146+
<img src="https://github.com/uiwjs/react-code-preview-layout/blob/gh-pages/CONTRIBUTORS.svg" />
142147
</a>
143148

144149
[action-contributors](https://github.com/jaywcjlove/github-action-contributors) 生成。

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-code-preview-layout",
33
"version": "1.0.0",
4-
"description": "Code preview layout component",
4+
"description": "A react component showing the layout of `code` and `code preview example`.",
55
"author": "SunLxy <[email protected]>",
66
"contributors": [
77
"SunLxy <[email protected]>",

website/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="theme-color" content="#000000" />
77
<title>markdown-react-code-preview-loader</title>
88
<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." />
9+
<meta name="description" content="A react component showing the layout of code and code preview example." />
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)