Skip to content

Commit

Permalink
๐Ÿ“ ๆ›ดๆ–ฐๆ–‡ๆกฃ
Browse files Browse the repository at this point in the history
  • Loading branch information
KomoriDev committed Aug 19, 2023
1 parent 00950d3 commit 2be7dca
Show file tree
Hide file tree
Showing 18 changed files with 381 additions and 130 deletions.
44 changes: 6 additions & 38 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ SoraBot ่ฟ˜ๆœช่ฟ›ๅ…ฅๆญฃๅผ็‰ˆ๏ผŒๆฌข่ฟŽๅœจ Issue ไธญๆ่ฎฎ่ฆๅŠ ๅ…ฅๅ“ชไบ›ๆ–ฐๅŠŸ

## Pull Request

SoraBot ไฝฟ็”จ poetry ็ฎก็†้กน็›ฎไพ่ต–๏ผŒ็”ฑไบŽ pre-commit ไนŸ็ปๅ…ถ็ฎก็†๏ผŒๆ‰€ไปฅๅœจๆญคไธ€ๅนถ่ฏดๆ˜Žใ€‚
SoraBot ไฝฟ็”จ PDM ็ฎก็†้กน็›ฎไพ่ต–๏ผŒ็”ฑไบŽ pre-commit ไนŸ็ปๅ…ถ็ฎก็†๏ผŒๆ‰€ไปฅๅœจๆญคไธ€ๅนถ่ฏดๆ˜Žใ€‚

ไธ‹้ข็š„ๅ‘ฝไปค่ƒฝๅœจๅทฒๅฎ‰่ฃ… poetry ๅ’Œ pnpm ็š„ๆƒ…ๅ†ตไธ‹ๅธฎไฝ ๅฟซ้€Ÿ้…็ฝฎๅผ€ๅ‘็Žฏๅขƒใ€‚
ไธ‹้ข็š„ๅ‘ฝไปค่ƒฝๅœจๅทฒๅฎ‰่ฃ… PDM ๅ’Œ pnpm ็š„ๆƒ…ๅ†ตไธ‹ๅธฎไฝ ๅฟซ้€Ÿ้…็ฝฎๅผ€ๅ‘็Žฏๅขƒใ€‚

```bash
# ๅฎ‰่ฃ… pipx ๅทฅๅ…ท
pip install pipx
# ๅฎ‰่ฃ… poetry ่™šๆ‹Ÿ็Žฏๅขƒ
pipx install poetry
# ๅฎ‰่ฃ… PDM ่™šๆ‹Ÿ็Žฏๅขƒ
pipx install pdm
# ๅฎ‰่ฃ… python ไพ่ต–
poetry install
pdm install
# ๅฎ‰่ฃ… pre-commit git hook
pre-commit install
```
Expand All @@ -46,7 +46,7 @@ pre-commit install

่ฏท็กฎไฟไฝ ็š„ๆฏไธ€ไธช commit ้ƒฝ่ƒฝๆธ…ๆ™ฐๅœฐๆ่ฟฐๅ…ถๆ„ๅ›พ๏ผŒไธ€ไธช commit ๅฐฝ้‡ๅชๆœ‰ไธ€ไธชๆ„ๅ›พใ€‚

SoraBot ็š„ commit message ๆ ผๅผ้ตๅพช gitmoji ่ง„่Œƒ๏ผŒๅœจๅˆ›ๅปบ commit ๆ—ถ่ฏท็‰ข่ฎฐ่ฟ™ไธ€็‚นใ€‚
SoraBot ็š„ commit message ๆ ผๅผ้ตๅพช [gitmoji](https://gitmoji.dev/) ่ง„่Œƒ๏ผŒๅœจๅˆ›ๅปบ commit ๆ—ถ่ฏท็‰ข่ฎฐ่ฟ™ไธ€็‚นใ€‚

### ๅทฅไฝœๆตๆฆ‚่ฟฐ

Expand Down Expand Up @@ -79,38 +79,6 @@ SoraBot ๆ–‡ๆกฃๅนถๆฒกๆœ‰ๅ…ทไฝ“็š„่กŒๆ–‡้ฃŽๆ ผ่ง„่Œƒ๏ผŒไฝ†ๆˆ‘ไปฌๅปบ่ฎฎไฝ ๅฐฝ้‡ๅ†™

ๅฆ‚ๆžœไฝ ้œ€่ฆ็ผ–่พ‘ๅ™จๆฃ€ๆŸฅ Markdown ่ง„่Œƒ๏ผŒๅฏไปฅๅœจ VSCode ไธญๅฎ‰่ฃ… markdownlint ๆ‰ฉๅฑ•ใ€‚

### ๆ–‡ไปถๅคน่ง„่Œƒ

ๅฎž้™…ไธŠ๏ผŒ่‹ฅๆ— ๅผ€ๅ‘้œ€ๆฑ‚๏ผŒๆ‚จๆš‚ๆ—ถไธ็”จไบ†่งฃๆฏไธ€ไธชๆ–‡ไปถ็š„ไฝœ็”จ

```bash
๐Ÿ“ฆ SoraBot
โ”œโ”€โ”€ ๐Ÿ“‚ go-cqhttp
โ”‚ โ””โ”€โ”€ ......
โ”œโ”€โ”€ ๐Ÿ“‚ SoraBot
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ sora
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ configs // ้…็ฝฎ
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ database // ๆ•ฐๆฎๅบ“
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ plugins // ๆ’ไปถ
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ utils // ๅทฅๅ…ท
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ ...
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ website
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ .vitepress
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ config.ts // ้…็ฝฎๆ–‡ไปถ
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ develop // ๅผ€ๅ‘ๆ–‡ๆกฃ
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ module // ไฝฟ็”จๆ–‡ๆกฃ
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ package.json
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ README.md
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ .env // ้…็ฝฎๆ–‡ไปถ
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ .env.prod // ้…็ฝฎๆ–‡ไปถ
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ bot.py // ๅฏๅŠจๆ–‡ไปถ
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ matcher_patch.py
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ poetry.lock // ไพ่ต–็ฎก็†
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ pyproject.toml
| โ””โ”€โ”€ ๐Ÿ“œ README.md
| โ””โ”€โ”€ ๐Ÿ“œ requirements.txt // ไพ่ต–ๅˆ—่กจ
```

### ๅ‚ไธŽๅผ€ๅ‘

SoraBot ็š„ไปฃ็ ้ฃŽๆ ผ้ตๅพช [PEP 8](https://www.python.org/dev/peps/pep-0008/) ไธŽ [PEP 484](https://www.python.org/dev/peps/pep-0484/) ่ง„่Œƒ๏ผŒ่ฏท็กฎไฟไฝ ็š„ไปฃ็ ้ฃŽๆ ผๅ’Œ้กน็›ฎๅทฒๆœ‰็š„ไปฃ็ ไฟๆŒไธ€่‡ด๏ผŒๅ˜้‡ๅ‘ฝๅๆธ…ๆ™ฐ๏ผŒๆœ‰้€‚ๅฝ“็š„ๆณจ้‡ŠไธŽๆต‹่ฏ•ไปฃ็ ใ€‚
112 changes: 112 additions & 0 deletions docs/.vitepress/components/VPBadge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!-- ไฟฎๆ”น่‡ช Vitepress -->

<script setup lang="ts">
defineProps<{
text?: string
type?: 'new' | 'update' | 'info' | 'tip' | 'warning' | 'danger' | 'private' | 'owner' | 'helper' | 'telegram'
}>()
</script>

<template>
<span class="VPBadge" :class="type ?? 'tip'">
<slot>{{ text }}</slot>
</span>
</template>
<style scoped>
.VPBadge {
display: inline-block;
margin-left: 2px;
border: 1px solid transparent;
border-radius: 12px;
padding: 0 10px;
line-height: 22px;
font-size: 12px;
font-weight: 600;
transform: translateY(-2px);
}
.vp-doc h1>.VPBadge {
margin-top: 4px;
vertical-align: top;
}
.vp-doc h2>.VPBadge {
margin-top: 3px;
line-height: 20px;
padding: 0 8px;
vertical-align: top;
}
.vp-doc h3>.VPBadge {
line-height: 20px;
vertical-align: middle;
}
.vp-doc h4>.VPBadge,
.vp-doc h5>.VPBadge,
.vp-doc h6>.VPBadge {
vertical-align: middle;
line-height: 18px;
}
.VPBadge.info {
border-color: var(--vp-badge-info-border);
color: var(--vp-badge-info-text);
background-color: var(--vp-badge-info-bg);
}
.VPBadge.tip {
border-color: var(--vp-badge-tip-border);
color: var(--vp-badge-tip-text);
background-color: var(--vp-badge-tip-bg);
}
.VPBadge.warning {
border-color: var(--vp-badge-warning-border);
color: var(--vp-badge-warning-text);
background-color: var(--vp-badge-warning-bg);
}
.VPBadge.danger {
border-color: var(--vp-badge-danger-border);
color: var(--vp-badge-danger-text);
background-color: var(--vp-badge-danger-bg);
}
.VPBadge.private {
border-color: var(--vp-badge-private-border);
color: var(--vp-badge-private-text);
background-color: var(--vp-badge-private-bg);
}
.VPBadge.owner {
border-color: var(--vp-badge-owner-border);
color: var(--vp-badge-owner-text);
background-color: var(--vp-badge-owner-bg);
}
.VPBadge.helper {
border-color: var(--vp-badge-helper-border);
color: var(--vp-badge-helper-text);
background-color: var(--vp-badge-helper-bg);
}
.VPBadge.telegram {
border-color: var(--vp-badge-telegram-border);
color: var(--vp-badge-telegram-text);
background-color: var(--vp-badge-telegram-bg);
}
.VPBadge.new {
border-color: var(--vp-badge-new-border);
color: var(--vp-badge-new-text);
background-color: var(--vp-badge-new-bg);
}
.VPBadge.update {
border-color: var(--vp-badge-update-border);
color: var(--vp-badge-update-text);
background-color: var(--vp-badge-update-bg);
}
</style>
4 changes: 2 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default defineConfig({
cleanUrls: true,

head: [
['link', { rel: 'shortcut icon', href: '/favicon.png' }],
['link', { rel: 'shortcut icon', href: '/logo.jpg' }],
['script', { src: 'https://cdn.bootcdn.net/ajax/libs/mermaid/10.3.0/mermaid.min.js' }]
],

Expand All @@ -31,7 +31,7 @@ export default defineConfig({
pattern: 'https://github.com/netsora/SoraBot-website/edit/remake/docs/:path',
text: 'ๅœจ GitHub ไธŠ็ผ–่พ‘ๆญค้กต'
},
socialLinks: [{ icon: 'github', link: 'https://github.com/netsora/SoraBot-website' }],
socialLinks: [{ icon: 'github', link: 'https://github.com/netsora/SoraBot' }],
footer: {
message: 'AGPL-3.0 License',
copyright: 'Copyright ยฉ 2023 Sora Network'
Expand Down
5 changes: 3 additions & 2 deletions docs/.vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const module = [
{
text: 'ๅŸบ็ก€',
items: [
{ text: 'ๆ›ดๆ–ฐ', link: '/module/base/manager' },
{ text: 'ๅธฎๅŠฉ', link: '/module/base/help' },
{ text: '็ฎก็†', link: '/module/base/manager' },
]
},
{
Expand Down Expand Up @@ -38,7 +39,7 @@ const guide = [
{
text: '้ƒจ็ฝฒ',
items: [
{ text: 'ไฝฟ็”จ Docker ้ƒจ็ฝฒ', link: '/guide/deploy/' },
{ text: 'ไฝฟ็”จ Docker ้ƒจ็ฝฒ', link: '/guide/deploy/docker' },
]
},
]
Expand Down
33 changes: 33 additions & 0 deletions docs/.vitepress/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@
}

:root {
--vp-badge-new-border: #52c41a;
--vp-badge-new-text: #52c41a;
--vp-badge-new-bg: #f6ffed;

--vp-badge-update-border: #c796ff;
--vp-badge-update-text: #b97efc;
--vp-badge-update-bg: #eaeaff;

--vp-badge-owner-border: #fd8637;
--vp-badge-owner-text: #FF8D40;
--vp-badge-owner-bg: #fff0e7;

--vp-badge-private-border: #0070bb;
--vp-badge-private-text: #007EC6;
--vp-badge-private-bg: #e0f3ff;

--vp-badge-helper-border: #f95050;
--vp-badge-helper-text: #e75a5a;
--vp-badge-helper-bg: #ffcdcd2c;

--vp-badge-telegram-border: #1fa5ff;
--vp-badge-telegram-text: #2a96df;
--vp-badge-telegram-bg: #def3ff;

--vp-font-family-base: 'HarmonyOSHans', 'HarmonyOS Sans SC', -apple-system, BlinkMacSystemFont,
'Segoe UI', Oxygen, Ubuntu, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Microsoft YaHei,
sans-serif;
Expand All @@ -17,6 +41,15 @@ html {
scroll-behavior: smooth;
}

.dark {
--vp-badge-new-bg: #aeff9620;
--vp-badge-update-bg: #333342;
--vp-badge-private-bg: #6cc7ff0d;
--vp-badge-owner-bg: #ffa56916;
--vp-badge-helper-bg: #ffdede00;
--vp-badge-telegram-bg: #ff84990d;
}

// ๆป‘็จฝ่กจๆƒ…
.face {
display: inline;
Expand Down
2 changes: 2 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import MoreInfo from '../components/MoreInfo.vue'
import ProjectInfo from '../components/ProjectInfo.vue'
import RubyCurtain from '../components/RubyCurtain.vue'
import VolumeBar from '../components/VolumeBar.vue'
import VPBadge from '../components/VPBadge.vue'

import '../styles/index.scss'

Expand Down Expand Up @@ -55,6 +56,7 @@ const theme: Theme = {
app.component('ProjectInfo', ProjectInfo)
app.component('RubyCurtain', RubyCurtain)
app.component('VolumeBar', VolumeBar)
app.component('Badge', VPBadge)

app.component('CodeGroup', CodeGroup)
app.component('CodeGroupItem', CodeGroupItem)
Expand Down
44 changes: 6 additions & 38 deletions docs/about/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ SoraBot ่ฟ˜ๆœช่ฟ›ๅ…ฅๆญฃๅผ็‰ˆ๏ผŒๆฌข่ฟŽๅœจ Issue ไธญๆ่ฎฎ่ฆๅŠ ๅ…ฅๅ“ชไบ›ๆ–ฐๅŠŸ

## Pull Request

SoraBot ไฝฟ็”จ poetry ็ฎก็†้กน็›ฎไพ่ต–๏ผŒ็”ฑไบŽ pre-commit ไนŸ็ปๅ…ถ็ฎก็†๏ผŒๆ‰€ไปฅๅœจๆญคไธ€ๅนถ่ฏดๆ˜Žใ€‚
SoraBot ไฝฟ็”จ PDM ็ฎก็†้กน็›ฎไพ่ต–๏ผŒ็”ฑไบŽ pre-commit ไนŸ็ปๅ…ถ็ฎก็†๏ผŒๆ‰€ไปฅๅœจๆญคไธ€ๅนถ่ฏดๆ˜Žใ€‚

ไธ‹้ข็š„ๅ‘ฝไปค่ƒฝๅœจๅทฒๅฎ‰่ฃ… poetry ๅ’Œ pnpm ็š„ๆƒ…ๅ†ตไธ‹ๅธฎไฝ ๅฟซ้€Ÿ้…็ฝฎๅผ€ๅ‘็Žฏๅขƒใ€‚
ไธ‹้ข็š„ๅ‘ฝไปค่ƒฝๅœจๅทฒๅฎ‰่ฃ… PDM ๅ’Œ pnpm ็š„ๆƒ…ๅ†ตไธ‹ๅธฎไฝ ๅฟซ้€Ÿ้…็ฝฎๅผ€ๅ‘็Žฏๅขƒใ€‚

```bash
# ๅฎ‰่ฃ… pipx ๅทฅๅ…ท
pip install pipx
# ๅฎ‰่ฃ… poetry ่™šๆ‹Ÿ็Žฏๅขƒ
pipx install poetry
# ๅฎ‰่ฃ… PDM ่™šๆ‹Ÿ็Žฏๅขƒ
pipx install pdm
# ๅฎ‰่ฃ… python ไพ่ต–
poetry install
pdm install
# ๅฎ‰่ฃ… pre-commit git hook
pre-commit install
```
Expand All @@ -55,7 +55,7 @@ pre-commit install

่ฏท็กฎไฟไฝ ็š„ๆฏไธ€ไธช commit ้ƒฝ่ƒฝๆธ…ๆ™ฐๅœฐๆ่ฟฐๅ…ถๆ„ๅ›พ๏ผŒไธ€ไธช commit ๅฐฝ้‡ๅชๆœ‰ไธ€ไธชๆ„ๅ›พใ€‚

SoraBot ็š„ commit message ๆ ผๅผ้ตๅพช gitmoji ่ง„่Œƒ๏ผŒๅœจๅˆ›ๅปบ commit ๆ—ถ่ฏท็‰ข่ฎฐ่ฟ™ไธ€็‚นใ€‚
SoraBot ็š„ commit message ๆ ผๅผ้ตๅพช [gitmoji](https://gitmoji.dev/) ่ง„่Œƒ๏ผŒๅœจๅˆ›ๅปบ commit ๆ—ถ่ฏท็‰ข่ฎฐ่ฟ™ไธ€็‚นใ€‚

### ๅทฅไฝœๆตๆฆ‚่ฟฐ

Expand Down Expand Up @@ -88,38 +88,6 @@ SoraBot ๆ–‡ๆกฃๅนถๆฒกๆœ‰ๅ…ทไฝ“็š„่กŒๆ–‡้ฃŽๆ ผ่ง„่Œƒ๏ผŒไฝ†ๆˆ‘ไปฌๅปบ่ฎฎไฝ ๅฐฝ้‡ๅ†™

ๅฆ‚ๆžœไฝ ้œ€่ฆ็ผ–่พ‘ๅ™จๆฃ€ๆŸฅ Markdown ่ง„่Œƒ๏ผŒๅฏไปฅๅœจ VSCode ไธญๅฎ‰่ฃ… markdownlint ๆ‰ฉๅฑ•ใ€‚

### ๆ–‡ไปถๅคน่ง„่Œƒ

ๅฎž้™…ไธŠ๏ผŒ่‹ฅๆ— ๅผ€ๅ‘้œ€ๆฑ‚๏ผŒๆ‚จๆš‚ๆ—ถไธ็”จไบ†่งฃๆฏไธ€ไธชๆ–‡ไปถ็š„ไฝœ็”จ

```bash
๐Ÿ“ฆ SoraBot
โ”œโ”€โ”€ ๐Ÿ“‚ go-cqhttp
โ”‚ โ””โ”€โ”€ ......
โ”œโ”€โ”€ ๐Ÿ“‚ SoraBot
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ sora
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ configs // ้…็ฝฎ
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ database // ๆ•ฐๆฎๅบ“
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ plugins // ๆ’ไปถ
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ utils // ๅทฅๅ…ท
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ ...
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ website
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ .vitepress
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ config.ts // ้…็ฝฎๆ–‡ไปถ
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ develop // ๅผ€ๅ‘ๆ–‡ๆกฃ
โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ module // ไฝฟ็”จๆ–‡ๆกฃ
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ package.json
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ README.md
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ .env // ้…็ฝฎๆ–‡ไปถ
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ .env.prod // ้…็ฝฎๆ–‡ไปถ
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ bot.py // ๅฏๅŠจๆ–‡ไปถ
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ matcher_patch.py
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ poetry.lock // ไพ่ต–็ฎก็†
โ”‚ โ””โ”€โ”€ ๐Ÿ“œ pyproject.toml
| โ””โ”€โ”€ ๐Ÿ“œ README.md
| โ””โ”€โ”€ ๐Ÿ“œ requirements.txt // ไพ่ต–ๅˆ—่กจ
```

### ๅ‚ไธŽๅผ€ๅ‘

SoraBot ็š„ไปฃ็ ้ฃŽๆ ผ้ตๅพช [PEP 8](https://www.python.org/dev/peps/pep-0008/) ไธŽ [PEP 484](https://www.python.org/dev/peps/pep-0484/) ่ง„่Œƒ๏ผŒ่ฏท็กฎไฟไฝ ็š„ไปฃ็ ้ฃŽๆ ผๅ’Œ้กน็›ฎๅทฒๆœ‰็š„ไปฃ็ ไฟๆŒไธ€่‡ด๏ผŒๅ˜้‡ๅ‘ฝๅๆธ…ๆ™ฐ๏ผŒๆœ‰้€‚ๅฝ“็š„ๆณจ้‡ŠไธŽๆต‹่ฏ•ไปฃ็ ใ€‚
2 changes: 1 addition & 1 deletion docs/guide/before/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: ไป‹็ป
prev: false
next:
text: "ๅ‡†ๅค‡ๅทฅไฝœ โ†’"
link: "develop/forward/prepare"
link: "guide/before/prepare"
---

# ไป‹็ป
Expand Down
Loading

0 comments on commit 2be7dca

Please sign in to comment.