From 72dd9cf7ce145c373290fb6575fde49b1d92b4e4 Mon Sep 17 00:00:00 2001 From: lenconda Date: Wed, 30 Jun 2021 14:16:34 +0800 Subject: [PATCH] feat: add and optimize docs --- .gitignore | 1 + .umirc.ts | 17 +++-- CODE_OF_CONDUCT.md | 76 +++++++++++++++++++ docs/README.zh-CN.md | 52 +++++++++++++ docs/README.zh.md | 62 --------------- docs/api/{README.zh.md => README.zh-CN.md} | 0 docs/guide/{README.zh.md => README.zh-CN.md} | 0 .../{advanced.zh.md => advanced.zh-CN.md} | 0 docs/guide/{basic.zh.md => basic.zh-CN.md} | 0 docs/guide/{faq.zh.md => faq.zh-CN.md} | 0 10 files changed, 141 insertions(+), 67 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 docs/README.zh-CN.md delete mode 100644 docs/README.zh.md rename docs/api/{README.zh.md => README.zh-CN.md} (100%) rename docs/guide/{README.zh.md => README.zh-CN.md} (100%) rename docs/guide/{advanced.zh.md => advanced.zh-CN.md} (100%) rename docs/guide/{basic.zh.md => basic.zh-CN.md} (100%) rename docs/guide/{faq.zh.md => faq.zh-CN.md} (100%) diff --git a/.gitignore b/.gitignore index fd4e939..8690b5b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ lib .npmrc checksum.txt .umi +.umi-production diff --git a/.umirc.ts b/.umirc.ts index de40eb6..cd1080d 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -8,8 +8,8 @@ export default defineConfig({ base: 'docs', hash: true, locales: [ - ['en', 'English'], - ['zh', '中文'], + ['en-US', 'English'], + ['zh-CN', '中文'], ], copy: [ { @@ -38,10 +38,17 @@ export default defineConfig({ '.__dumi-default-menu-inner ul li a::before, .__dumi-default-menu-inner ul li > span::before { display: none !important; }', '.__dumi-default-layout-hero button { border-radius: 4px !important; }', '.__dumi-default-menu[data-mode=\'site\'] { background: white !important; }', - 'code, pre { color: #844d28 !important; font-family: Menlo, Consolas, Courier, monospace !important; font-size: 14px; background: transparent !important; }', + 'code, pre { font-family: Menlo, Consolas, Courier, monospace !important; font-size: 14px; background: transparent !important; }', + '[data-prefers-color=dark] .markdown a { color: #844d28 !important; }', 'pre { color: #333 !important; }', 'h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { font-size: inherit; }', 'https://cdn.jsdelivr.net/npm/prism-themes@1.5.0/themes/prism-vs.css', + '[data-prefers-color=dark] .__dumi-default-menu-inner ul li a:hover, [data-prefers-color=dark] .__dumi-default-menu-inner ul li > span:hover, [data-prefers-color=dark] .__dumi-default-menu-inner ul li a.active, [data-prefers-color=dark] .__dumi-default-menu-inner ul li > span.active { color: #844d28 !important; }', + '[data-prefers-color=dark] code[class*="language-"], [data-prefers-color=dark] pre[class*="language-"] { color: white !important; }', + '[data-prefers-color=dark] .markdown *:not(pre) code { color: #844d28 !important; }', + '.__dumi-default-menu[data-mode=\'site\'] { padding-top: 0 !important; }', + '[data-prefers-color=dark] .__dumi-default-navbar nav > span > a:hover, [data-prefers-color=dark] .__dumi-default-navbar nav > span > a.active, [data-prefers-color=dark] .__dumi-default-layout-footer-meta, [data-prefers-color=dark] .__dumi-default-layout-footer-meta > span:last-child::before { color: #844d28 !important; }', + '.__dumi-default-menu[data-mode=\'site\'] .__dumi-default-menu-list { margin-top: 50px; }', ], favicon: '/public/images/favicon.ico', resolve: { @@ -49,14 +56,14 @@ export default defineConfig({ previewLangs: [], }, navs: { - en: [ + 'en-US': [ null, { title: 'GitHub', path: 'https://github.com/dolliejs/dollie-core', }, ], - zh: [ + 'zh-CN': [ null, { title: 'GitHub', diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..06b009c --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at dolliejs@lenconda.top. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/docs/README.zh-CN.md b/docs/README.zh-CN.md new file mode 100644 index 0000000..7c02376 --- /dev/null +++ b/docs/README.zh-CN.md @@ -0,0 +1,52 @@ +--- +title: Dollie.js +hero: + title: Dollie.js + desc: Dollie 是初始化工程代码的工具链,它可以帮助你构建成熟的工程化方案。 + actions: + - text: 快速上手 + link: /zh-CN/guide + - text: CLI 入门 +features: + - title: 云端化 + desc: 通过云端托管模板,以及模板与生成器分离的设计,极大提升模板升级迭代的灵活性 + - title: 易上手 + desc: 模板配置项简单,易于理解,较短的学习时间即可上手;编写极少代码甚至无需编写代码即可快速制作脚手架 + - title: 增量覆盖 + desc: 支持通过扩展模板增量覆盖,从而使定制与选择模板技术栈更加方便快捷 +footer: + 遵循 MIT 开源协议 +
版权所有 © 2021 至今,Dollie.js 及其贡献者 +
由 [dumi](https://d.umijs.org) 提供支持 +--- + +## 谁在使用 + + + + +
+ + +
+ 南昌大学家园工作室 +
+
+ +## 参与项目开发 + +我们提供参与 Dollie.js 开发工作的机会,并欢迎任何有意愿参与到这项工作当中的人。但在此之前,请先阅读 Dollie.js 的[行为准则](https://github.com/dolliejs/dollie/blob/master/CODE_OF_CONDUCT.md)。 + +## 赞助 + +我们接受赞助,并承诺将 100% 的赞助费用都用于维护 Dollie.js,包括但不限于购买、维护 Dollie.js 文档的域名、服务器,以及支付部分核心贡献者的津贴。 + +在发起赞助前,请将带有你的姓名、国籍、所在国家或地区的证件号码(可以提供身份证明编号、所在国家或地区的驾驶证编号、VISA 卡号、护照编号等)、Dollie.js 帮助你解决了什么问题(可选)、感谢语(可选)等信息发送给 [dolliejs@lenconda.top](mailto:dolliejs@lenconda.top),在审核通过后我们将会回复一封带有收款方式的电子邮件,你可以通过这封邮件完成赞助。 + +非常感谢你对 Dollie.js 项目及其开发者的支持! + + \ No newline at end of file diff --git a/docs/README.zh.md b/docs/README.zh.md deleted file mode 100644 index f7d9a91..0000000 --- a/docs/README.zh.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Dollie.js -hero: - title: Dollie.js - desc: Dollie 是一款初始化工程代码的工具链,它可以帮助你构建成熟的工程化方案 - actions: - - text: 用户文档 - link: /zh/guide -footer: - 遵循 MIT 开源协议 -
版权所有 © 2021 至今,Dollie.js 及其贡献者 -
由 [dumi](https://d.umijs.org) 提供支持 ---- - -
- -# 安装 - -```bash -$ npm i @dollie/cli -g -``` - -# 使用 - -## 使用 CLI - -在 Shell 中执行 - -```bash -$ dollie -``` - -或 - -```bash -$ dollie compose ./config.yml -``` - -## 使用 API - -在项目中安装包含 Dollie API 的 NPM 依赖 - -```bash -$ npm i @dollie/core -S -``` - -引入依赖,并调用合适的 API 来运行 Dollie 的核心功能 - -```js -const dollie = require('@dollie/core'); - -async function app() { - try { - await dollie.interactive(); - } catch (e) { - dollie.log(e.toString()); - process.exit(1); - } -} - -app(); -``` diff --git a/docs/api/README.zh.md b/docs/api/README.zh-CN.md similarity index 100% rename from docs/api/README.zh.md rename to docs/api/README.zh-CN.md diff --git a/docs/guide/README.zh.md b/docs/guide/README.zh-CN.md similarity index 100% rename from docs/guide/README.zh.md rename to docs/guide/README.zh-CN.md diff --git a/docs/guide/advanced.zh.md b/docs/guide/advanced.zh-CN.md similarity index 100% rename from docs/guide/advanced.zh.md rename to docs/guide/advanced.zh-CN.md diff --git a/docs/guide/basic.zh.md b/docs/guide/basic.zh-CN.md similarity index 100% rename from docs/guide/basic.zh.md rename to docs/guide/basic.zh-CN.md diff --git a/docs/guide/faq.zh.md b/docs/guide/faq.zh-CN.md similarity index 100% rename from docs/guide/faq.zh.md rename to docs/guide/faq.zh-CN.md