From 23b09c0e91874ac8dad9a4b496a82c684c391a09 Mon Sep 17 00:00:00 2001 From: tackchen Date: Thu, 10 Dec 2020 11:43:30 +0800 Subject: [PATCH] docs: readme --- .eslintignore | 4 +- .eslintrc.js | 31 +++++----- README.md | 142 ++++++++++++++++++++++---------------------- helper/README.en.md | 4 +- helper/README.md | 4 +- 5 files changed, 94 insertions(+), 91 deletions(-) diff --git a/.eslintignore b/.eslintignore index af68ca7..d82a90c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,4 +5,6 @@ cnchar.min.js src_import_version !.vuepress docs -vuepress/config.js \ No newline at end of file +vuepress/config.js +**/*.vue +**/*.html \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index a9dd75f..f5e4916 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,7 +7,8 @@ module.exports = { }, "extends": [ // "standard", - "plugin:vue/essential" + // "plugin:vue", + // "plugin:html" ], "parserOptions": { "parser": "babel-eslint", @@ -37,10 +38,6 @@ module.exports = { "indent": ["error", 4, { "SwitchCase": 1 }], - "vue/script-indent": ["warn", 4, { - "baseIndent": 1, - "switchCase": 1 - }], "space-infix-ops": ["error", {"int32Hint": false}], "space-before-function-paren": ["error", { "anonymous": "always", @@ -66,15 +63,19 @@ module.exports = { "comma-spacing": "error", "key-spacing": "error", "no-undef": "error", - "vue/html-indent": ["error", 4], - "vue/html-quotes": ["error", "single", { "avoidEscape": true }], + // "vue/script-indent": ["warn", 4, { + // "baseIndent": 1, + // "switchCase": 1 + // }], + // "vue/html-indent": ["error", 4], + // "vue/html-quotes": ["error", "single", { "avoidEscape": true }], }, - "overrides": [ - { - "files": ["*.vue"], - "rules": { - "indent": "off" - } - } - ] + // "overrides": [ + // { + // "files": ["*.vue"], + // "rules": { + // "indent": "off" + // } + // } + // ] } \ No newline at end of file diff --git a/README.md b/README.md index d32455f..00c4caa 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@

🚀 功能全面、多端支持的汉字拼音笔画 js 库

-**[English](https://github.com/theajack/cnchar/blob/master/helper/README.en.md) | [在线试用/文档](https://theajack.gitee.io/cnchar) | [备用文档地址](https://theajack.com/cnchar) | [更新日志](https://github.com/theajack/cnchar/blob/master/helper/version.md) | [应用:打字游戏](https://theajack.gitee.io/type/) | [反馈错误/缺漏](https://github.com/theajack/cnchar/issues/new) | [Gitee](https://gitee.com/theajack/cnchar)** +**[English](https://github.com/theajack/cnchar/blob/master/helper/README.en.md) | [在线试用/文档](https://cnchar.js.org) | [备用文档地址](https://theajack.gitee.io/cnchar) | [更新日志](https://github.com/theajack/cnchar/blob/master/helper/version.md) | [应用:打字游戏](https://theajack.gitee.io/type/) | [反馈错误/缺漏](https://github.com/theajack/cnchar/issues/new) | [Gitee](https://gitee.com/theajack/cnchar)** --- @@ -29,75 +29,75 @@ -- [前言](#%E5%89%8D%E8%A8%80) -- [0.快速使用](#0%E5%BF%AB%E9%80%9F%E4%BD%BF%E7%94%A8) -- [1.功能](#1%E5%8A%9F%E8%83%BD) -- [2.概览](#2%E6%A6%82%E8%A7%88) -- [3.安装](#3%E5%AE%89%E8%A3%85) - * [3.1 使用 npm 安装](#31-%E4%BD%BF%E7%94%A8-npm-%E5%AE%89%E8%A3%85) - * [3.2 cdn 引入](#32-cdn-%E5%BC%95%E5%85%A5) -- [4.使用](#4%E4%BD%BF%E7%94%A8) - * [4.1 webpack浏览器环境(有window对象)](#41-webpack%E6%B5%8F%E8%A7%88%E5%99%A8%E7%8E%AF%E5%A2%83%E6%9C%89window%E5%AF%B9%E8%B1%A1) - * [4.2 nodejs 等非浏览器环境](#42-nodejs-%E7%AD%89%E9%9D%9E%E6%B5%8F%E8%A7%88%E5%99%A8%E7%8E%AF%E5%A2%83) - * [4.3 原生浏览器环境](#43-%E5%8E%9F%E7%94%9F%E6%B5%8F%E8%A7%88%E5%99%A8%E7%8E%AF%E5%A2%83) +- [前言](#前言) +- [0.快速使用](#0快速使用) +- [1.功能](#1功能) +- [2.概览](#2概览) +- [3.安装](#3安装) + - [3.1 使用 npm 安装](#31-使用-npm-安装) + - [3.2 cdn 引入](#32-cdn-引入) +- [4.使用](#4使用) + - [4.1 webpack浏览器环境(有window对象)](#41-webpack浏览器环境有window对象) + - [4.2 nodejs 等非浏览器环境](#42-nodejs-等非浏览器环境) + - [4.3 原生浏览器环境](#43-原生浏览器环境) - [5.API](#5api) - * [5.1 拼音笔画基础 API: spell & stroke](#51-%E6%8B%BC%E9%9F%B3%E7%AC%94%E7%94%BB%E5%9F%BA%E7%A1%80-api-spell--stroke) - * [5.2 可视化绘制汉字: draw](#52-%E5%8F%AF%E8%A7%86%E5%8C%96%E7%BB%98%E5%88%B6%E6%B1%89%E5%AD%97-draw) - + [5.2.1 使用](#521-%E4%BD%BF%E7%94%A8) - + [5.2.2 参数](#522-%E5%8F%82%E6%95%B0) - + [5.2.3 微信小程序中使用](#523-%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F%E4%B8%AD%E4%BD%BF%E7%94%A8) - * [5.3 繁体、简体、火星文互转: convert](#53-%E7%B9%81%E4%BD%93%E7%AE%80%E4%BD%93%E7%81%AB%E6%98%9F%E6%96%87%E4%BA%92%E8%BD%AC-convert) - * [5.4 笔画序列推出原汉字: orderToWord](#54-%E7%AC%94%E7%94%BB%E5%BA%8F%E5%88%97%E6%8E%A8%E5%87%BA%E5%8E%9F%E6%B1%89%E5%AD%97-ordertoword) - * [5.5 通过拼音查询原汉字: spellToWord](#55-%E9%80%9A%E8%BF%87%E6%8B%BC%E9%9F%B3%E6%9F%A5%E8%AF%A2%E5%8E%9F%E6%B1%89%E5%AD%97-spelltoword) - * [5.6 通过笔画数查询原汉字: strokeToWord](#56-%E9%80%9A%E8%BF%87%E7%AC%94%E7%94%BB%E6%95%B0%E6%9F%A5%E8%AF%A2%E5%8E%9F%E6%B1%89%E5%AD%97-stroketoword) - * [5.7 成语功能](#57-%E6%88%90%E8%AF%AD%E5%8A%9F%E8%83%BD) - * [5.8 歇后语功能](#58-%E6%AD%87%E5%90%8E%E8%AF%AD%E5%8A%9F%E8%83%BD) - * [5.9 偏旁部首功能](#59-%E5%81%8F%E6%97%81%E9%83%A8%E9%A6%96%E5%8A%9F%E8%83%BD) - * [5.10 汉字、拼音工具方法](#510-%E6%B1%89%E5%AD%97%E6%8B%BC%E9%9F%B3%E5%B7%A5%E5%85%B7%E6%96%B9%E6%B3%95) - + [5.10.1 查询拼音详细信息: spellInfo](#5101-%E6%9F%A5%E8%AF%A2%E6%8B%BC%E9%9F%B3%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF-spellinfo) - + [5.10.2 拼音音调操作: transformTone](#5102-%E6%8B%BC%E9%9F%B3%E9%9F%B3%E8%B0%83%E6%93%8D%E4%BD%9C-transformtone) - + [5.10.3 是否是汉字: isCnChar](#5103-%E6%98%AF%E5%90%A6%E6%98%AF%E6%B1%89%E5%AD%97-iscnchar) - + [5.10.4 是否是多音字: isPolyWord](#5104-%E6%98%AF%E5%90%A6%E6%98%AF%E5%A4%9A%E9%9F%B3%E5%AD%97-ispolyword) - + [5.10.5 比较拼音(汉字)大小: compareSpell](#5105-%E6%AF%94%E8%BE%83%E6%8B%BC%E9%9F%B3%E6%B1%89%E5%AD%97%E5%A4%A7%E5%B0%8F-comparespell) - + [5.10.6 比较汉字笔画数大小: compareStroke](#5106-%E6%AF%94%E8%BE%83%E6%B1%89%E5%AD%97%E7%AC%94%E7%94%BB%E6%95%B0%E5%A4%A7%E5%B0%8F-comparestroke) - + [5.10.7 根据拼音排序: sortSpell](#5107-%E6%A0%B9%E6%8D%AE%E6%8B%BC%E9%9F%B3%E6%8E%92%E5%BA%8F-sortspell) - + [5.10.8 根据笔画数排序: sortStroke](#5108-%E6%A0%B9%E6%8D%AE%E7%AC%94%E7%94%BB%E6%95%B0%E6%8E%92%E5%BA%8F-sortstroke) - + [5.10.9 将数字表示的声调转为拼音声调: shapeSpell](#5109-%E5%B0%86%E6%95%B0%E5%AD%97%E8%A1%A8%E7%A4%BA%E7%9A%84%E5%A3%B0%E8%B0%83%E8%BD%AC%E4%B8%BA%E6%8B%BC%E9%9F%B3%E5%A3%B0%E8%B0%83-shapespell) - * [5.11 自定义数据](#511-%E8%87%AA%E5%AE%9A%E4%B9%89%E6%95%B0%E6%8D%AE) - + [5.11.1 setSpell](#5111-setspell) - + [5.11.2 setSpellDefault](#5112-setspelldefault) - + [5.11.3 setStrokeCount](#5113-setstrokecount) - + [5.11.4 setPolyPhrase](#5114-setpolyphrase) - + [5.11.5 setOrder](#5115-setorder) - + [5.11.6 setRadical](#5116-setradical) - + [5.11.7 addXhy](#5117-addxhy) - * [5.12 其他 api](#512-%E5%85%B6%E4%BB%96-api) - + [5.12.1 .use()](#5121-use) - + [5.12.2 .type](#5122-type) - + [5.12.3 .check](#5123-check) - + [5.12.4 .version](#5124-version) - + [5.12.5 .plugins](#5125-plugins) -- [6.参数介绍](#6%E5%8F%82%E6%95%B0%E4%BB%8B%E7%BB%8D) - * [6.1 spell 参数](#61-spell-%E5%8F%82%E6%95%B0) - * [6.2 stroke 参数](#62-stroke-%E5%8F%82%E6%95%B0) - * [6.3 orderToWord 参数](#63-ordertoword-%E5%8F%82%E6%95%B0) - * [6.4 spellToWord 参数](#64-spelltoword-%E5%8F%82%E6%95%B0) - * [6.5 strokeToWord 参数](#65-stroketoword-%E5%8F%82%E6%95%B0) - * [6.6 idiom 参数](#66-idiom-%E5%8F%82%E6%95%B0) - * [6.7 xhy 参数](#67-xhy-%E5%8F%82%E6%95%B0) - * [6.8 radical 参数](#68-radical-%E5%8F%82%E6%95%B0) - * [6.9 使用实例大全:](#69-%E4%BD%BF%E7%94%A8%E5%AE%9E%E4%BE%8B%E5%A4%A7%E5%85%A8) - + [6.9.0 安装使用](#690-%E5%AE%89%E8%A3%85%E4%BD%BF%E7%94%A8) - + [6.9.1 cnchar 基础库功能](#691-cnchar-%E5%9F%BA%E7%A1%80%E5%BA%93%E5%8A%9F%E8%83%BD) - + [6.9.2 cnchar-poly 库功能](#692-cnchar-poly-%E5%BA%93%E5%8A%9F%E8%83%BD) - + [6.9.3 cnchar-order 库功能](#693-cnchar-order-%E5%BA%93%E5%8A%9F%E8%83%BD) - + [6.9.4 cnchar-trad 库功能](#694-cnchar-trad-%E5%BA%93%E5%8A%9F%E8%83%BD) - - [6.9.4.1 convert 字体转换](#6941-convert-%E5%AD%97%E4%BD%93%E8%BD%AC%E6%8D%A2) - - [6.9.4.2 spell 和 stroke 方法](#6942-spell-%E5%92%8C-stroke-%E6%96%B9%E6%B3%95) - + [6.9.5 cnchar-idiom 库功能](#695-cnchar-idiom-%E5%BA%93%E5%8A%9F%E8%83%BD) - + [6.9.6 cnchar-xhy 库功能](#696-cnchar-xhy-%E5%BA%93%E5%8A%9F%E8%83%BD) - + [6.9.7 cnchar-radical 库功能](#697-cnchar-radical-%E5%BA%93%E5%8A%9F%E8%83%BD) - + [6.9.8 工具方法](#698-%E5%B7%A5%E5%85%B7%E6%96%B9%E6%B3%95) + - [5.1 拼音笔画基础 API: spell & stroke](#51-拼音笔画基础-api-spell--stroke) + - [5.2 可视化绘制汉字: draw](#52-可视化绘制汉字-draw) + - [5.2.1 使用](#521-使用) + - [5.2.2 参数](#522-参数) + - [5.2.3 微信小程序中使用](#523-微信小程序中使用) + - [5.3 繁体、简体、火星文互转: convert](#53-繁体简体火星文互转-convert) + - [5.4 笔画序列推出原汉字: orderToWord](#54-笔画序列推出原汉字-ordertoword) + - [5.5 通过拼音查询原汉字: spellToWord](#55-通过拼音查询原汉字-spelltoword) + - [5.6 通过笔画数查询原汉字: strokeToWord](#56-通过笔画数查询原汉字-stroketoword) + - [5.7 成语功能](#57-成语功能) + - [5.8 歇后语功能](#58-歇后语功能) + - [5.9 偏旁部首功能](#59-偏旁部首功能) + - [5.10 汉字、拼音工具方法](#510-汉字拼音工具方法) + - [5.10.1 查询拼音详细信息: spellInfo](#5101-查询拼音详细信息-spellinfo) + - [5.10.2 拼音音调操作: transformTone](#5102-拼音音调操作-transformtone) + - [5.10.3 是否是汉字: isCnChar](#5103-是否是汉字-iscnchar) + - [5.10.4 是否是多音字: isPolyWord](#5104-是否是多音字-ispolyword) + - [5.10.5 比较拼音(汉字)大小: compareSpell](#5105-比较拼音汉字大小-comparespell) + - [5.10.6 比较汉字笔画数大小: compareStroke](#5106-比较汉字笔画数大小-comparestroke) + - [5.10.7 根据拼音排序: sortSpell](#5107-根据拼音排序-sortspell) + - [5.10.8 根据笔画数排序: sortStroke](#5108-根据笔画数排序-sortstroke) + - [5.10.9 将数字表示的声调转为拼音声调: shapeSpell](#5109-将数字表示的声调转为拼音声调-shapespell) + - [5.11 自定义数据](#511-自定义数据) + - [5.11.1 setSpell](#5111-setspell) + - [5.11.2 setSpellDefault](#5112-setspelldefault) + - [5.11.3 setStrokeCount](#5113-setstrokecount) + - [5.11.4 setPolyPhrase](#5114-setpolyphrase) + - [5.11.5 setOrder](#5115-setorder) + - [5.11.6 setRadical](#5116-setradical) + - [5.11.7 addXhy](#5117-addxhy) + - [5.12 其他 api](#512-其他-api) + - [5.12.1 .use()](#5121-use) + - [5.12.2 .type](#5122-type) + - [5.12.3 .check](#5123-check) + - [5.12.4 .version](#5124-version) + - [5.12.5 .plugins](#5125-plugins) +- [6.参数介绍](#6参数介绍) + - [6.1 spell 参数](#61-spell-参数) + - [6.2 stroke 参数](#62-stroke-参数) + - [6.3 orderToWord 参数](#63-ordertoword-参数) + - [6.4 spellToWord 参数](#64-spelltoword-参数) + - [6.5 strokeToWord 参数](#65-stroketoword-参数) + - [6.6 idiom 参数](#66-idiom-参数) + - [6.7 xhy 参数](#67-xhy-参数) + - [6.8 radical 参数](#68-radical-参数) + - [6.9 使用实例大全:](#69-使用实例大全) + - [6.9.0 安装使用](#690-安装使用) + - [6.9.1 cnchar 基础库功能](#691-cnchar-基础库功能) + - [6.9.2 cnchar-poly 库功能](#692-cnchar-poly-库功能) + - [6.9.3 cnchar-order 库功能](#693-cnchar-order-库功能) + - [6.9.4 cnchar-trad 库功能](#694-cnchar-trad-库功能) + - [6.9.4.1 convert 字体转换](#6941-convert-字体转换) + - [6.9.4.2 spell 和 stroke 方法](#6942-spell-和-stroke-方法) + - [6.9.5 cnchar-idiom 库功能](#695-cnchar-idiom-库功能) + - [6.9.6 cnchar-xhy 库功能](#696-cnchar-xhy-库功能) + - [6.9.7 cnchar-radical 库功能](#697-cnchar-radical-库功能) + - [6.9.8 工具方法](#698-工具方法) - [6.9.8.1 spellInfo](#6981-spellinfo) - [6.9.8.2 isCnChar](#6982-iscnchar) - [6.9.8.3 transformTone](#6983-transformtone) @@ -114,7 +114,7 @@ - [6.9.8.14 setPolyPhrase](#69814-setpolyphrase) - [6.9.8.15 setRadical](#69815-setradical) - [6.9.8.16 addXhy](#69816-addxhy) -- [7.应用例子](#7%E5%BA%94%E7%94%A8%E4%BE%8B%E5%AD%90) +- [7.应用例子](#7应用例子) @@ -375,7 +375,7 @@ draw 的参数比较繁多,首先需要理解的是,draw 分为四种绘制 3. stroke: 按汉字笔顺单步绘制 4. test: 测试模式,用户可以在容器内绘制汉字,cnchar-draw会检测是否绘制正确 -以下是 options 的所有可选参数及描述,使用详情请参考[在线文档](https://theajack.gitee.io/cnchar): +以下是 options 的所有可选参数及描述,使用详情请参考[在线文档](https://cnchar.js.org): ```ts declare interface DrawOption { diff --git a/helper/README.en.md b/helper/README.en.md index 9a4a036..67b49c7 100644 --- a/helper/README.en.md +++ b/helper/README.en.md @@ -19,7 +19,7 @@

🚀 Full-featured, multi-end support for hanyu pinyin strokes js library

-**[中文](https://github.com/theajack/cnchar#cnchar--) | [Online trial / documentation](https://theajack.gitee.io/cnchar) | [Update log](https://theajack.gitee.io/cnchar/v2/guide/version.html) | [Application: Typing game](https://theajack.gitee.io/type/) | [Feedback error / missing](https://github.com/theajack/cnchar/issues/new) | [Gitee](https://gitee.com/theajack/cnchar)** +**[中文](https://github.com/theajack/cnchar#cnchar--) | [Online trial / documentation](https://cnchar.js.org) | [Update log](https://theajack.gitee.io/cnchar/v2/guide/version.html) | [Application: Typing game](https://theajack.gitee.io/type/) | [Feedback error / missing](https://github.com/theajack/cnchar/issues/new) | [Gitee](https://gitee.com/theajack/cnchar)** --- @@ -282,7 +282,7 @@ There are many parameters of draw, the first thing to understand is that draw is 3. stroke: draw in a single step according to Chinese characters 4. test: Test mode, the user can draw Chinese characters in the container, cnchar-draw will detect whether it is drawn correctly -The following are all optional parameters and descriptions of options, please refer to [online documentation](https://theajack.gitee.io/cnchar) for usage details: +The following are all optional parameters and descriptions of options, please refer to [online documentation](https://cnchar.js.org) for usage details: ```ts declare interface DrawOption { diff --git a/helper/README.md b/helper/README.md index 44a4b0d..5b4275a 100644 --- a/helper/README.md +++ b/helper/README.md @@ -19,7 +19,7 @@

🚀 功能全面、多端支持的汉字拼音笔画 js 库

-**[English](https://github.com/theajack/cnchar/blob/master/helper/README.en.md) | [在线试用/文档](https://theajack.gitee.io/cnchar) | [备用文档地址](https://theajack.com/cnchar) | [更新日志](https://github.com/theajack/cnchar/blob/master/helper/version.md) | [应用:打字游戏](https://theajack.gitee.io/type/) | [反馈错误/缺漏](https://github.com/theajack/cnchar/issues/new) | [Gitee](https://gitee.com/theajack/cnchar)** +**[English](https://github.com/theajack/cnchar/blob/master/helper/README.en.md) | [在线试用/文档](https://cnchar.js.org/) | [备用文档地址](https://theajack.gitee.io/cnchar) | [更新日志](https://github.com/theajack/cnchar/blob/master/helper/version.md) | [应用:打字游戏](https://theajack.gitee.io/type/) | [反馈错误/缺漏](https://github.com/theajack/cnchar/issues/new) | [Gitee](https://gitee.com/theajack/cnchar)** --- @@ -286,7 +286,7 @@ draw 的参数比较繁多,首先需要理解的是,draw 分为四种绘制 3. stroke: 按汉字笔顺单步绘制 4. test: 测试模式,用户可以在容器内绘制汉字,cnchar-draw会检测是否绘制正确 -以下是 options 的所有可选参数及描述,使用详情请参考[在线文档](https://theajack.gitee.io/cnchar): +以下是 options 的所有可选参数及描述,使用详情请参考[在线文档](https://cnchar.js.org): ```ts declare interface DrawOption {