Skip to content

Commit

Permalink
remove frontmatters
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Oct 20, 2022
1 parent abd4dc3 commit 30d31ea
Show file tree
Hide file tree
Showing 120 changed files with 122 additions and 474 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.png -text
*.jpg -text
*.ico -text
*.webp -text
109 changes: 108 additions & 1 deletion .vitepress/theme/layouts/starter.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,111 @@
<template>
1
<div class="starter-container page">
<div class="content">
<content />
</div>
<div class="chooser">
<div>
<div class="chooser-header">
<span>我使用 Koishi……</span>
</div>
<div class="chooser-select">
<div class="chooser-select-item"
v-for="(value, key) in choices" :key="key"
:class="{ selected: chooserUsage === key }"
@click="chooserUsage = key">
&gt; {{ value.text }}
</div>
</div>
</div>

<div>
<div class="chooser-header">
<span>{{ choices[chooserUsage].caption }}</span>
</div>
<div class="chooser-select">
<div class="chooser-select-item"
v-for="(value, key) in choices[chooserUsage].children" :key="key"
@click="$router.push(value)">
&gt; {{ key }}
</div>
</div>
</div>
</div>
</div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
const chooserUsage = ref('non-dev')
const choices = {
'non-dev': {
text: '用于搭建机器人服务',
caption: '我的运行环境是……',
children: {
'Windows': './desktop',
'macOS': './desktop',
'Linux': './desktop',
'Android': './mobile',
},
},
dev: {
text: '用于开发',
caption: '我希望 Koishi 作为……',
children: {
'一个独立的项目': './boilerplate',
'其他 Node 项目的依赖': './direct',
},
},
}
</script>

<style lang="scss" scoped>
.starter-container {
height: 100vh;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
max-width: 840px;
margin: 0 auto;
}
.content {
padding: 2rem 2.5rem;
@media (max-width: 719px) {
padding: 1rem 2rem;
}
}
.chooser {
&-header {
background-color: var(--c-bg-home);
padding: 12px 36px;
font-size: 1.2rem;
}
&-select {
display: flex;
justify-content: space-between;
&-item {
flex: 1;
padding: 24px 36px;
font-size: 1.2rem;
font-weight: bold;
cursor: pointer;
background-color: var(--c-bg-dark);
transition: background-color 0.3s ease;
&:hover, &.selected {
background-color: var(--c-primary);
}
}
@media (max-width: 719px) {
flex-direction: column;
&-item {
padding: 16px 36px;
}
}
}
}
</style>
4 changes: 0 additions & 4 deletions about/contribute/docs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 文档贡献指南

## 术语表
Expand Down
4 changes: 0 additions & 4 deletions about/contribute/structure.md
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
---
sidebarDepth: 2
---

# 项目结构
6 changes: 0 additions & 6 deletions about/faq.md

This file was deleted.

4 changes: 0 additions & 4 deletions about/history.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 发展史

2019 年 8 月,我开始编写我的第一个基于 Node.js 的聊天机器人,名为四季酱。当时我浏览各种聊天机器人框架,发现并没有自己真正想要的,遂决定从零开始编写。一开始这个机器人只包含了很少的功能,但随着其更多功能的加入,我开始调整起底层架构,并计划逐步将其开源出来。
Expand Down
4 changes: 0 additions & 4 deletions about/migration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 从 v3 迁移

## 包名变更
Expand Down
4 changes: 0 additions & 4 deletions about/releases/v4.1.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# v4.1 版本介绍

- [Roadmap](https://github.com/koishijs/koishi/issues/472)
Expand Down
4 changes: 0 additions & 4 deletions about/releases/v4.2.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# v4.2 版本介绍

- [Roadmap](https://github.com/koishijs/koishi/issues/482)
Expand Down
4 changes: 0 additions & 4 deletions about/releases/v4.3.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# v4.3 版本介绍

- [Roadmap](https://github.com/koishijs/koishi/issues/501)
Expand Down
4 changes: 0 additions & 4 deletions about/releases/v4.4.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# v4.4 版本介绍

- [Roadmap](https://github.com/koishijs/koishi/issues/522)
Expand Down
4 changes: 0 additions & 4 deletions about/releases/v4.5.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# v4.5 版本介绍

- [Roadmap](https://github.com/koishijs/koishi/issues/552)
Expand Down
4 changes: 0 additions & 4 deletions about/releases/v4.6.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# v4.6 版本介绍

- [Roadmap](https://github.com/koishijs/koishi/issues/578)
Expand Down
4 changes: 0 additions & 4 deletions about/releases/v4.7.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# v4.7 版本介绍

- [Roadmap](https://github.com/koishijs/koishi/issues/625)
Expand Down
4 changes: 0 additions & 4 deletions about/releases/v4.8.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# v4.8 版本介绍

- [Roadmap](https://github.com/koishijs/koishi/issues/662)
Expand Down
4 changes: 0 additions & 4 deletions api/core/adapter.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 适配器 (Adapter)

本章将介绍与适配器相关的内容,这是一个相当底层的概念,因此如果你并不打算编写一个平台实现,你完全可以跳过本章节。
Expand Down
4 changes: 0 additions & 4 deletions api/core/app.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 应用 (App)

**应用 (App)**[Context](./context.md) 的一个子类,它是程序的入口,管理着全部机器人的信息。除了 Context 中已有的属性和方法以外,App 还提供了下面的属性和方法:
Expand Down
4 changes: 0 additions & 4 deletions api/core/bot.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 机器人 (Bot)

**机器人 (Bot)** 是适配器的核心,它将不同平台的 API 封装成统一的格式供 Koishi 使用。而不同的适配器也可以自行扩展 Bot 实例上的属性和方法。
Expand Down
4 changes: 0 additions & 4 deletions api/core/command.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 指令 (Command)

指令系统是 Koishi 的核心功能之一。通过 `ctx.command()` 方法获得的是指令的实例,它含有下面的方法:
Expand Down
4 changes: 0 additions & 4 deletions api/core/context.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 上下文 (Context)

**上下文 (Context)** 是 Koishi 的重要概念。你的每一个插件,中间件,监听器和指令都被绑定在上下文上。
Expand Down
4 changes: 0 additions & 4 deletions api/core/events.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 事件 (Events)

Koishi 封装了一套事件系统。其基本用法与 Node.js 自带的 [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) 类似,但支持更多的功能,比如多达 6 种的触发形式以及会话事件等。在了解下面的内容之前,建议你先阅读下面的章节:
Expand Down
4 changes: 0 additions & 4 deletions api/core/session.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 会话 (Session)

会话来源于 Koishi v1 的元信息对象,并在后续的版本中发展成了专门的类并大幅扩展了功能。目前的会话已经参与到了 Koishi 的绝大部分工作。
Expand Down
4 changes: 0 additions & 4 deletions api/database/built-in.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 内置数据结构

Koishi 的数据库 API 实际上分为两部分:
Expand Down
4 changes: 0 additions & 4 deletions api/database/database.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 数据库操作 (Database)

一个 Database 对象代理了 Koishi 上下文绑定的应用实例有关的所有数据库访问。同时它具有注入特性,任何插件都可以自己定义数据库上的方法。本章主要介绍数据库的官方接口。注意:**它们并不由 Koishi 自身实现,而是由每个数据库分别实现的**。Koishi 只是提供了一套标准。
Expand Down
4 changes: 0 additions & 4 deletions api/database/evaluation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 求值表达式 (Evaluation)

## 数值运算
Expand Down
4 changes: 0 additions & 4 deletions api/database/model.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 数据模型 (Model)

## 数据类型
Expand Down
4 changes: 0 additions & 4 deletions api/database/query.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 查询表达式 (Query)

## 逻辑运算
Expand Down
4 changes: 0 additions & 4 deletions api/glossary.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 术语表

本页收集了一些 Koishi 设计中的重要概念,按字母表序排列。如果你在阅读文档时对某个概念感到迷惑,可以随时回到这里查看解释。
Expand Down
4 changes: 0 additions & 4 deletions api/service/assets.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 资源存储 (Assets)

::: warning
Expand Down
4 changes: 0 additions & 4 deletions api/service/bots.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 机器人管理 (Bots)

::: warning
Expand Down
4 changes: 0 additions & 4 deletions api/service/http.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 网络请求 (HTTP)

`ctx.http` 是 Koishi 的内置服务,其上封装了一套基于 [axios](https://github.com/axios/axios) 的网络请求 API。
Expand Down
4 changes: 0 additions & 4 deletions api/service/i18n.md
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
---
sidebarDepth: 2
---

# 国际化 (I18n)
4 changes: 0 additions & 4 deletions api/service/lifecycle.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 事件系统 (Lifecycle)

::: tip
Expand Down
4 changes: 0 additions & 4 deletions api/service/logger.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 输出与日志

::: danger 注意
Expand Down
4 changes: 0 additions & 4 deletions api/service/registry.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 插件系统 (Registry)

## 实例属性
Expand Down
4 changes: 0 additions & 4 deletions api/service/router.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebarDepth: 2
---

# 网络服务 (Router)

::: tip
Expand Down
Loading

0 comments on commit 30d31ea

Please sign in to comment.