Skip to content

Commit

Permalink
Merge pull request #103 from ant-design/docs/zh-to-en
Browse files Browse the repository at this point in the history
 📝 docs: add english document
  • Loading branch information
ONLY-yours authored Nov 24, 2023
2 parents 2d5a006 + 8aa83e5 commit 172b64d
Show file tree
Hide file tree
Showing 87 changed files with 2,609 additions and 43 deletions.
4 changes: 4 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,8 @@ export default defineConfig({
name: '@ant-design/pro-editor',
},
extraBabelPlugins: ['antd-style'],
locales: [
{ name: 'English', id: 'en-US' },
{ name: '简体中文', id: 'zh-CN' },
],
});
13 changes: 13 additions & 0 deletions .i18nrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* @type {import("@lobehub/i18n-cli").Config}
*/
module.exports = {
markdown: {
entry: ['docs/**/**.md', 'src/**/**.md'],
entryLocale: 'zh-CN',
exclude: ['docs/index.zh-CN.md'],
entryExtension: '.zh-CN.md',
outputLocales: ['en-US'],
},
modelName: 'gpt-3.5-turbo-1106',
};
73 changes: 32 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,68 +26,35 @@

<!-- gitpod url -->

[gitpod-badge]: https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod
[gitpod-url]: https://gitpod.io/#https://github.com/ant-design/@ant-design/pro-editor

<!-- umi url -->

[dumi-url]: https://img.shields.io/badge/docs%20by-dumi-blue
[father-url]: https://img.shields.io/badge/build%20with-father-028fe4.svg

<!-- npm url -->

[npm-image]: https://img.shields.io/npm/v/@ant-design/pro-editor.svg?style=flat-square&color=deepgreen&label=latest
[npm-url]: https://npmjs.org/package/@ant-design/pro-editor
[npm-size]: https://img.shields.io/bundlephobia/minzip/@ant-design/pro-editor?color=deepgreen&label=gizpped%20size&style=flat-square
[npm-size-url]: https://packagephobia.com/result?p=@ant-design/pro-editor

<!-- coverage -->

[coverage]: https://codecov.io/gh/ant-design/pro-editor/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/ant-design/pro-editor/branch/main

<!-- Github CI -->

[test-ci]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml/badge.svg
[test-ci-url]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml
[release-ci]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml/badge.svg
[release-ci-url]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml/
[download-image]: https://img.shields.io/npm/dm/@ant-design/pro-editor.svg?style=flat-square
[download-url]: https://npmjs.org/package/@ant-design/pro-editor

<!-- contributors -->

[contributors-shield]: https://img.shields.io/github/contributors/ant-design/pro-editor.svg?style=flat
[contributors-url]: https://github.com/ant-design/pro-editor/graphs/contributors

<!-- forks -->

[forks-shield]: https://img.shields.io/github/forks/ant-design/pro-editor.svg?style=flat
[forks-url]: https://github.com/ant-design/pro-editor/network/members

<!-- stargazers -->

[stargazers-shield]: https://img.shields.io/github/stars/ant-design/pro-editor.svg?style=flat
[stargazers-url]: https://github.com/ant-design/pro-editor/stargazers

<!-- issues -->

[issues-shield]: https://img.shields.io/github/issues/ant-design/pro-editor.svg?style=flat
[issues-url]: https://github.com/ant-design/pro-editor/issues/new/choose

</div>

## 📦 Install

本组件库为 [ ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
This component library is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).

使用 npm 安装:
Install via npm:

```bash
$ npm install @ant-design/pro-editor
```

使用 pnpm 安装:
Install via pnpm:

```bash
$ pnpm add @ant-design/pro-editor
Expand All @@ -101,18 +68,18 @@ import { ActionIcon } from '@ant-design/pro-editor';

export default () => (
<ActionIcon
title={'功能按钮的说明'}
title={'Function button description'}
icon={<SmileOutlined />}
onClick={() => {
alert('触发动作');
alert('Trigger action');
}}
/>
);
```

### 适配 NextJS
### Adapt to NextJS

为适配 nextjs 的 SSR 模式, 需要将本包的相关依赖添加到 `next.config.js``transpilePackages` 配置中:
To adapt to nextjs's SSR mode, you need to add the relevant dependencies of this package to the `transpilePackages` configuration in `next.config.js`:

```js
// next.config.js
Expand All @@ -131,7 +98,7 @@ $ npm install
$ npm start
```

Open your browser and visit http://localhost:8000
Open your browser and visit <http://localhost:8000>

<div align="right">

Expand Down Expand Up @@ -184,4 +151,28 @@ This project is [MIT](./LICENSE) licensed.

<!-- SHIELD LINK GROUP -->

[gitpod-badge]: https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod
[gitpod-url]: https://gitpod.io/#https://github.com/ant-design/@ant-design/pro-editor
[dumi-url]: https://img.shields.io/badge/docs%20by-dumi-blue
[father-url]: https://img.shields.io/badge/build%20with-father-028fe4.svg
[npm-image]: https://img.shields.io/npm/v/@ant-design/pro-editor.svg?style=flat-square&color=deepgreen&label=latest
[npm-url]: https://npmjs.org/package/@ant-design/pro-editor
[npm-size]: https://img.shields.io/bundlephobia/minzip/@ant-design/pro-editor?color=deepgreen&label=gizpped%20size&style=flat-square
[npm-size-url]: https://packagephobia.com/result?p=@ant-design/pro-editor
[coverage]: https://codecov.io/gh/ant-design/pro-editor/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/ant-design/pro-editor/branch/main
[test-ci]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml/badge.svg
[test-ci-url]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml
[release-ci]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml/badge.svg
[release-ci-url]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml/
[download-image]: https://img.shields.io/npm/dm/@ant-design/pro-editor.svg?style=flat-square
[download-url]: https://npmjs.org/package/@ant-design/pro-editor
[contributors-shield]: https://img.shields.io/github/contributors/ant-design/pro-editor.svg?style=flat
[contributors-url]: https://github.com/ant-design/pro-editor/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/ant-design/pro-editor.svg?style=flat
[forks-url]: https://github.com/ant-design/pro-editor/network/members
[stargazers-shield]: https://img.shields.io/github/stars/ant-design/pro-editor.svg?style=flat
[stargazers-url]: https://github.com/ant-design/pro-editor/stargazers
[issues-shield]: https://img.shields.io/github/issues/ant-design/pro-editor.svg?style=flat
[issues-url]: https://github.com/ant-design/pro-editor/issues/new/choose
[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
187 changes: 187 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
<a name="readme-top"></a>

<p align="center">
<a href="#">
<img width="200" src="https://gw.alipayobjects.com/zos/antfincdn/upvrAjAPQX/Logo_Tech%252520UI.svg">
</a>
</p>

<h1 align="center">Ant Design ProEditor</h1>

<div align="center">

🌟 An Editor UI Framework and Components

[Changelog](./CHANGELOG.md) · [Report Bug][issues-url] · [Request Feature][issues-url]

<!-- SHIELD GROUP -->

[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url] [![install size][npm-size]][npm-size-url]

[![Test CI status][test-ci]][test-ci-url] [![Deploy CI][release-ci]][release-ci-url] [![Coverage][coverage]][codecov-url]

[![contributors][contributors-shield]][contributors-url] [![forks][forks-shield]][forks-url] [![stargazers][stargazers-shield]][stargazers-url] [![issues][issues-shield]][issues-url]

[![ docs by dumi][dumi-url]](https://d.umijs.org/) [![Build With father][father-url]](https://github.com/umijs/father/)

<!-- gitpod url -->

[gitpod-badge]: https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod
[gitpod-url]: https://gitpod.io/#https://github.com/ant-design/@ant-design/pro-editor

<!-- umi url -->

[dumi-url]: https://img.shields.io/badge/docs%20by-dumi-blue
[father-url]: https://img.shields.io/badge/build%20with-father-028fe4.svg

<!-- npm url -->

[npm-image]: https://img.shields.io/npm/v/@ant-design/pro-editor.svg?style=flat-square&color=deepgreen&label=latest
[npm-url]: https://npmjs.org/package/@ant-design/pro-editor
[npm-size]: https://img.shields.io/bundlephobia/minzip/@ant-design/pro-editor?color=deepgreen&label=gizpped%20size&style=flat-square
[npm-size-url]: https://packagephobia.com/result?p=@ant-design/pro-editor

<!-- coverage -->

[coverage]: https://codecov.io/gh/ant-design/pro-editor/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/ant-design/pro-editor/branch/main

<!-- Github CI -->

[test-ci]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml/badge.svg
[test-ci-url]: https://github.com/ant-design/pro-editor/actions/workflows/test.yml
[release-ci]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml/badge.svg
[release-ci-url]: https://github.com/ant-design/pro-editor/actions/workflows/release.yml/
[download-image]: https://img.shields.io/npm/dm/@ant-design/pro-editor.svg?style=flat-square
[download-url]: https://npmjs.org/package/@ant-design/pro-editor

<!-- contributors -->

[contributors-shield]: https://img.shields.io/github/contributors/ant-design/pro-editor.svg?style=flat
[contributors-url]: https://github.com/ant-design/pro-editor/graphs/contributors

<!-- forks -->

[forks-shield]: https://img.shields.io/github/forks/ant-design/pro-editor.svg?style=flat
[forks-url]: https://github.com/ant-design/pro-editor/network/members

<!-- stargazers -->

[stargazers-shield]: https://img.shields.io/github/stars/ant-design/pro-editor.svg?style=flat
[stargazers-url]: https://github.com/ant-design/pro-editor/stargazers

<!-- issues -->

[issues-shield]: https://img.shields.io/github/issues/ant-design/pro-editor.svg?style=flat
[issues-url]: https://github.com/ant-design/pro-editor/issues/new/choose

</div>

## 📦 Install

本组件库为 [纯 ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)

使用 npm 安装:

```bash
$ npm install @ant-design/pro-editor
```

使用 pnpm 安装:

```bash
$ pnpm add @ant-design/pro-editor
```

## 🔨 Usage

```jsx
import { SmileOutlined } from '@ant-design/icons';
import { ActionIcon } from '@ant-design/pro-editor';

export default () => (
<ActionIcon
title={'功能按钮的说明'}
icon={<SmileOutlined />}
onClick={() => {
alert('触发动作');
}}
/>
);
```

### 适配 NextJS

为适配 nextjs 的 SSR 模式, 需要将本包的相关依赖添加到 `next.config.js``transpilePackages` 配置中:

```js
// next.config.js
const nextConfig = {
// ...other config
transpilePackages: ['@ant-design/pro-editor', 'leva'],
};
```

## ⌨️ Development

```bash
$ git clone [email protected]:ant-design/pro-editor.git
$ cd pro-editor
$ npm install
$ npm start
```

Open your browser and visit http://localhost:8000

<div align="right">

[![][back-to-top]](#readme-top)

</div>

## 🤝 Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

- [Release Guide](https://github.com/ant-design/pro-editor/wiki/release)

<!-- CONTRIBUTION GROUP -->

> 📊 Total: <kbd>**7**</kbd>
<a href="https://github.com/arvinxx" title="arvinxx">
<img src="https://avatars.githubusercontent.com/u/28616219?v=4" width="50" />
</a>
<a href="https://github.com/rdmclin2" title="rdmclin2">
<img src="https://avatars.githubusercontent.com/u/4705237?v=4" width="50" />
</a>
<a href="https://github.com/ONLY-yours" title="ONLY-yours">
<img src="https://avatars.githubusercontent.com/u/52664827?v=4" width="50" />
</a>
<a href="https://github.com/actions-user" title="actions-user">
<img src="https://avatars.githubusercontent.com/u/65916846?v=4" width="50" />
</a>
<a href="https://github.com/chenshuai2144" title="chenshuai2144">
<img src="https://avatars.githubusercontent.com/u/8186664?v=4" width="50" />
</a>
<a href="https://github.com/meganjohnson96" title="meganjohnson96">
<img src="https://avatars.githubusercontent.com/u/136729222?v=4" width="50" />
</a>
<a href="https://github.com/xlkang" title="xlkang">
<img src="https://avatars.githubusercontent.com/u/36946503?v=4" width="50" />
</a>

<!-- CONTRIBUTION END -->

<div align="right">

[![][back-to-top]](#readme-top)

</div>

#### 📝 License

Copyright © 2023 - present AFX & [Ant Digital](antdigital.com) <br />
This project is [MIT](./LICENSE) licensed.

<!-- SHIELD LINK GROUP -->

[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
Loading

0 comments on commit 172b64d

Please sign in to comment.