From dd339563bcb5f6649ed021dd52377a25a04767a2 Mon Sep 17 00:00:00 2001 From: dudaodong Date: Fri, 1 Sep 2023 16:47:33 +0800 Subject: [PATCH] doc: add contribution and contributors to doc site --- docs/.vitepress/en.ts | 28 ++++++++++++++++++---- docs/.vitepress/zh.ts | 22 +++++++++++++++-- docs/en/api/overview.md | 2 +- docs/en/guide/contribution_guide.md | 37 +++++++++++++++++++++++++++++ docs/en/guide/contributors.md | 6 +++++ docs/en/index.md | 2 +- docs/guide/contribution_guide.md | 37 +++++++++++++++++++++++++++++ docs/guide/contributors.md | 7 ++++++ 8 files changed, 132 insertions(+), 9 deletions(-) create mode 100644 docs/en/guide/contribution_guide.md create mode 100644 docs/en/guide/contributors.md create mode 100644 docs/guide/contribution_guide.md create mode 100644 docs/guide/contributors.md diff --git a/docs/.vitepress/en.ts b/docs/.vitepress/en.ts index d87b608..11ac016 100644 --- a/docs/.vitepress/en.ts +++ b/docs/.vitepress/en.ts @@ -49,7 +49,7 @@ export const enConfig: LocaleSpecificConfig = { ], sidebar: { - '/en/': [ + '/en/guide/': [ { text: 'Introduction', collapsed: false, @@ -59,19 +59,37 @@ export const enConfig: LocaleSpecificConfig = { link: '/en/guide/introduction', }, { - text: 'getting started', + text: 'Getting started', link: '/en/guide/getting_started', }, ], }, + { + text: 'Contribute Code', + collapsed: false, + items: [ + { + text: 'Contribution guide', + link: '/en/guide/contribution_guide', + }, + { + text: 'Contributors', + link: '/en/guide/contributors', + }, + ], + }, + { + text: 'API Reference', + link: '/en/api/overview' + }, ], '/en/api/': [ { - text: 'overview', - items: [{ text: 'overview of API', link: '/en/api/overview' }], + text: 'Overview', + items: [{ text: 'API overview', link: '/en/api/overview' }], }, { - text: 'packages', + text: 'Packages', collapsed: false, items: [ { text: 'algorithm', link: '/en/api/packages/algorithm' }, diff --git a/docs/.vitepress/zh.ts b/docs/.vitepress/zh.ts index 4803488..1f51442 100644 --- a/docs/.vitepress/zh.ts +++ b/docs/.vitepress/zh.ts @@ -58,10 +58,10 @@ export const zhConfig: LocaleSpecificConfig = { ], sidebar: { - '/': [ + '/guide/': [ { text: '介绍', - collapsed: true, + collapsed: false, items: [ { text: 'Lancet是什么?', @@ -73,6 +73,24 @@ export const zhConfig: LocaleSpecificConfig = { }, ], }, + { + text: '贡献代码', + collapsed: false, + items: [ + { + text: '贡献指南', + link: '/guide/contribution_guide', + }, + { + text: '贡献者', + link: '/guide/contributors', + }, + ], + }, + { + text: 'API手册', + link: '/api/overview' + }, ], '/api/': [ diff --git a/docs/en/api/overview.md b/docs/en/api/overview.md index 782f777..6c56979 100644 --- a/docs/en/api/overview.md +++ b/docs/en/api/overview.md @@ -37,7 +37,7 @@ outline: deep
-

lancet function module

+

Lancet function module

algorithm
compare
diff --git a/docs/en/guide/contribution_guide.md b/docs/en/guide/contribution_guide.md new file mode 100644 index 0000000..f52d5a1 --- /dev/null +++ b/docs/en/guide/contribution_guide.md @@ -0,0 +1,37 @@ +# Lancet Contribution Guide + +Hi! Thank you for choosing Lancet. + +Lancet is a powerful, efficient, and reusable util function library of go. It makes Go dev easier by taking the hassle out of working with concurrency, net, math, slice, string, etc. + +We are excited that you are interested in contributing to lancet. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines. + +## Issue Guidelines + +- Issues are exclusively for bug reports, feature requests and design-related topics. Other questions may be closed directly. + +- Before submitting an issue, please check if similar problems have already been issued. + +- Please specify which version of Lancet and Go you are using, and provide OS information. [Go Playground](https://go.dev/play/) is recommended to build a live demo so that your issue can be reproduced clearly. + +## Pull Request Guidelines + +- Fork this repository to your own account. Do not create branches here. + +- Commit info should be formatted as `type(scope): info about commit`. eg. `fix(package): [scrollbar] fix xxx bug`. + + 1. type: type must be one of [chore, docs, feat, fix, refactor, release, test]. + + 2. scope: scope must be one of [package, file, internal]. + + 3. header: header must not be longer than 72 characters. + +- Rebase before creating a PR to keep commit history clear. + +- Before submitting a PR, please execute the unit test command: `go test -v ./...` to ensure that all unit test tasks should pass. + +- Make sure PRs are created to `v2` branch instead of `master` branch. + +- If your PR fixes a bug, please provide a description about the related bug. + +- If the PR is for a new feature, make sure to complete the relevant documentation (/lancet/docs/en/api/packages). diff --git a/docs/en/guide/contributors.md b/docs/en/guide/contributors.md new file mode 100644 index 0000000..59a7c1c --- /dev/null +++ b/docs/en/guide/contributors.md @@ -0,0 +1,6 @@ +# Contributors +Thank you to all the people who contributed to lancet! + + + + \ No newline at end of file diff --git a/docs/en/index.md b/docs/en/index.md index 2bce9b6..7d08ce2 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -50,4 +50,4 @@ features: text-align: center; font-weight: 600; margin: 0 auto; - width: 140px;" href="/en/sponsor/sponsor.html">Become a sponsor \ No newline at end of file + width: 200px;" href="/en/sponsor/sponsor.html">Become a sponsor \ No newline at end of file diff --git a/docs/guide/contribution_guide.md b/docs/guide/contribution_guide.md new file mode 100644 index 0000000..bb8a9c8 --- /dev/null +++ b/docs/guide/contribution_guide.md @@ -0,0 +1,37 @@ +# Lancet 贡献指南 + +Hi! 首先感谢你使用 Lancet。 + +lancet(柳叶刀)是一个功能强大、全面、高效、可复用的go语言工具函数库。它消除了处理并发、网络、数学、切片、字符串等的麻烦,使 Go 开发变得更容易。 + +Lancet 的成长离不开大家的支持,如果你愿意为 Lancet 贡献代码或提供建议,请阅读以下内容。 + +## Issue 规范 + +- issue 仅用于提交 Bug 或 Feature 以及设计相关的内容,其它内容可能会被直接关闭。 + +- 在提交 issue 之前,请搜索相关内容是否已被提出。 + +- 请说明 Lancet 和 Go 的版本号,并提供操作系统信息。推荐使用 [Go Playground](https://go.dev/play/) 生成在线 demo,这能够更直观地重现问题。 + +## Pull Request 规范 + +- 请先 fork 一份到自己的项目下,不要直接在仓库下建分支。 + +- commit 信息要以 `type(scope): 描述信息` 的形式填写,例如 `fix(package): [scrollbar] fix xxx bug`。 + + 1. type: 必须是 chore, docs, feat, fix, refactor, release, test 其中的一个。 + + 2. scope: 必须是 package, file, internal 其中的一个。 + + 3. header: 描述信息不要超过 72 个字符。 + +- 提交 PR 前请 rebase,确保 commit 记录的整洁。 + +- 提交 PR 前请执行单元测试命令:go test -v ./...,确保所有单元测试任务通过。 + +- 确保 PR 是提交到 `v2` 分支,而不是 `main` 分支。 + +- 如果是修复 bug,请在 PR 中给出描述信息。 + +- 如果PR是新功能,确保完成相关文档(/lancet/docs/api/packages/)。 \ No newline at end of file diff --git a/docs/guide/contributors.md b/docs/guide/contributors.md new file mode 100644 index 0000000..aabf17e --- /dev/null +++ b/docs/guide/contributors.md @@ -0,0 +1,7 @@ +# 贡献者 + +感谢所有为lancet贡献过代码的人! + + + + \ No newline at end of file