Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,44 @@ pīnyīn, 汉字拼音转换工具。
|- package.json
`- README.md
```

## pinyin.js.org

pīnyīn 项目主站,网址 [pinyin.js.org](https://pinyin.js.org),代码仓库
[@hotoo/pinyin/apps/website](https://github.com/hotoo/pinyin/tree/master/apps/website),
主要展示 pinyin 项目的文档、演示、工具等。

## pinyin

pinyin 项目核心代码,npm 安装:

```bash
npm install pinyin
```

使用:

```typescript
import { pinyin } from 'pinyin';

const py = pinyin('中文');
```

更多用法请参考 [API 文档](https://pinyin.js.org/api/v4/index.html),
源码 [@hotoo/pinyin/packages/pinyin](https://github.com/hotoo/pinyin/tree/master/packages/pinyin)

## pinyin-cli

pinyin 命令行工具,可以全局安装在本地随时随处使用。

安装:

```bash
npm install pinyin-cli -g
```

使用:
```bash
pinyin 中文
pinyin --help
```
2 changes: 1 addition & 1 deletion apps/website/components/example/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function(props?: IExampleProps) {
const han = "中文汉字";
const [text, setText] = useState(han);
const [style, setStyle] = useState("TONE");
const [segment, setSegment] = useState("");
const [segment, setSegment] = useState("segmentit");
const [group, setGroup] = useState(false);
const [compact, setCompact] = useState(false);
const [heteronym, setHeteronym] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/en-US/EXAMPLE.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Example from '../../components/example/index.tsx';

# Example
# Check pinyin

<Example i18n={{
inputLabel: "Please input chinese",
Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/en-US/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"position": "left"
},
{
"text": "✏️ EXAMPLE",
"text": "🔍 Check Pinyin",
"link": "/example/",
"activeMatch": "^/(?:en-US/|ko-KR/|zh-TW/)?example/",
"position": "left"
Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/ko-KR/EXAMPLE.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Example from '../../components/example/index.tsx';

# 데모
# 병음 확인

<Example i18n={{
inputLabel: "중국어를 입력해주세요",
Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/ko-KR/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"position": "left"
},
{
"text": "✏️ 데모",
"text": "🔍 병음 확인",
"link": "/example/",
"activeMatch": "^/(?:en-US/|ko-KR/|zh-TW/)?example/",
"position": "left"
Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/zh-CN/EXAMPLE.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Example from '../../components/example/index.tsx';

# 演示
# 查拼音

<Example i18n={{
inputLabel: "输入汉字",
Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/zh-CN/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"position": "left"
},
{
"text": "✏️ 演示",
"text": "🔍️ 查拼音",
Comment thread
hotoo marked this conversation as resolved.
"link": "/example/",
"activeMatch": "^/(?:en-US/|ko-KR/|zh-TW/)?example/",
"position": "left"
Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/zh-TW/EXAMPLE.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Example from '../../components/example/index.tsx';

# 演示
# 查拼音

<Example i18n={{
inputLabel: "輸入漢字",
Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/zh-TW/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"position": "left"
},
{
"text": "✏️ 演示",
"text": "🔍 查拼音",
"link": "/example/",
"activeMatch": "^/(?:en-US/|ko-KR/|zh-TW/)?example/",
"position": "left"
Expand Down
2 changes: 2 additions & 0 deletions apps/website/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare module '*.module.css';
declare module '*.module.scss';
4 changes: 2 additions & 2 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
"dependencies": {
"pinyin": "workspace:^",
"@textea/json-viewer": "^4.0.1",
"@types/react": "^18.3.12",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@rsbuild/plugin-sass": "^1.4.0",
"rsbuild-plugin-google-analytics": "^1.0.4",
"rspress": "^1.45.5",
"rspress-plugin-sitemap": "^1.2.1",
"gh-pages": "^3.2.3"
"rspress-plugin-sitemap": "^1.2.1"
}
}
2 changes: 1 addition & 1 deletion packages/pinyin-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pinyin-cli",
"version": "4.0.0",
"version": "4.0.1",
"description": "汉语拼音转换命令行工具。",
"bin": {
"pinyin": "./bin/pinyin"
Expand Down
Loading
Loading