Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docs #98

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
#
name: Deploy VitePress site to Pages

on:
# 在针对 `main` 分支的推送上运行。如果你
# 使用 `master` 分支作为默认分支,请将其更改为 `master`
push:
branches: [main]

# 允许你从 Actions 选项卡手动运行此工作流程
workflow_dispatch:

# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
concurrency:
group: pages
cancel-in-progress: false

jobs:
# 构建工作
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
# - uses: pnpm/action-setup@v3 # 如果使用 pnpm,请取消注释
# - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm # 或 pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci
- name: Build with VitePress
run: npm run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# 部署工作
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ dist

lib
src/__tests__/mock/json/*.json
!src/__tests__/mock/json/mock*.json
!src/__tests__/mock/json/mock*.json
docs/.vitepress/cache
35 changes: 35 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// .vitepress/config.js
export default {
// 站点级选项
title: 'TinyCRUD Docs',
description: 'Just playing around.',

locales: {
root: {
label: '简体中文',
lang: '/'
},
en: {
label: 'English',
lang: 'en',
}
},

themeConfig: {
nav: [
{ text: "首页", link: "/" },
{ text: "指南", link: "/guide/intro/what-is-tinycrud" }
],
sidebar: {
"/guide/": [
{
text: "简介",
items: [{
text: "什么是 TinyCRUD",
link: "/intro/what-is-tinycrud"
}]
}
]
}
}
}
57 changes: 57 additions & 0 deletions docs/en/guide/intro/what-is-tinycrud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Introduction

## What is TinyCRUD

TinyCRUD is a lightweight data storage library based on the Issue API of code hosting platform, which can use Issue as a database table, Issue comments as data table records, and serialize/deserialize data through Issue API to realize data CRUD.

## Application Scenarios

TinyCRUD is suitable for small teams or personal projects that need simple and lightweight data storage, but do not want or need to set up a complex database system.

## Supported Code Hosting Platforms

<table style="text-align:center">
<tr>
<td>
<img src="/github.svg" />
</td>
<td>
<img src="/gitlab.svg" />
</td>
<td>
<img src="/gitee.svg" />
</td>
</tr>
<tr>
<td>
Github API latest
</td>
<td>
Gitlab API v4
</td>
<td>
Gitee API v5
</td>
</tr>
</table>

## Supported Request Libraries

<table style="text-align:center">
<tr>
<td>
<img src="https://axios-http.com/assets/logo.svg" />
</td>
<td>
<img src="/wechat.svg" />
</td>
</tr>
<tr>
<td>
axios
</td>
<td>
wx(WeChat Mini Program)
</td>
</tr>
</table>
57 changes: 57 additions & 0 deletions docs/guide/intro/what-is-tinycrud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 基本介绍

## 什么是 TinyCRUD

TinyCRUD 是一个基于代码托管平台 Issue API 的轻量级数据存储库,它可以将 Issue 作为数据库表,Issue 的评论作为数据表记录,通过 Issue API 将数据序列化/反序列化,实现数据的增删改查。

## 适用场景

TinyCRUD 适合用于满足小型团队或个人项目中需要简单、轻量级数据存储,但又不想或不需要设置复杂数据库系统的情况。

## 支持的代码托管平台

<table style="text-align:center">
<tr>
<td>
<img src="/github.svg" />
</td>
<td>
<img src="/gitlab.svg" />
</td>
<td>
<img src="/gitee.svg" />
</td>
</tr>
<tr>
<td>
Github API latest
</td>
<td>
Gitlab API v4
</td>
<td>
Gitee API v5
</td>
</tr>
</table>

## 支持的请求库

<table style="text-align:center">
<tr>
<td>
<img src="https://axios-http.com/assets/logo.svg" />
</td>
<td>
<img src="/wechat.svg" />
</td>
</tr>
<tr>
<td>
axios
</td>
<td>
wx(微信小程序)
</td>
</tr>
</table>
Empty file added docs/index.md
Empty file.
1 change: 1 addition & 0 deletions docs/public/gitee.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/public/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/public/gitlab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/tiny-crud-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/public/wechat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading