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

docs: refactor documentation #1744

Merged
merged 36 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3fdce03
init docs v2
maslow Dec 11, 2023
4fbe126
add docs in zh
maslow Dec 12, 2023
bb8c976
add storage docs
maslow Dec 12, 2023
9d31e6b
add storage operation docs
maslow Dec 12, 2023
d21a922
add list files docs
maslow Dec 12, 2023
d184c62
opt storage docs
maslow Dec 12, 2023
88a9658
opt cloud storage doc and quick start
maslow Dec 13, 2023
90899ba
complete cloud storage docs
maslow Dec 13, 2023
b4337f5
add cloud database docs
maslow Dec 13, 2023
bd53903
add db query docs
maslow Dec 14, 2023
b0786b9
docs: add db query docs
maslow Dec 14, 2023
d00078b
chore: update doc styles
maslow Dec 15, 2023
ae9a734
docs: deprecated old docs, upgrade vitepress to rc
maslow Dec 19, 2023
e7fc346
doc: Update README_en.md
maslow Dec 11, 2023
d3ba08b
feat(cloud-sdk): add url api to cloud sdk (#1732)
maslow Dec 12, 2023
f4d2ff2
fix(web): jsonviewer support to render large data (#1731)
newfish-cmyk Dec 12, 2023
c0ca1c8
doc: opt db-ql documents (#1726)
yenche123 Dec 12, 2023
8dfeb5e
fix(services): change runtime exporter penalty rules (#1733)
HUAHUAI23 Dec 12, 2023
3f21ef5
refactor(cloud-sdk): refacct readFile returns in cloud-sdk (#1734)
maslow Dec 12, 2023
290fb3f
refactor(cloud-sdk): refactor listFiles paramsof cloud sdk (#1735)
maslow Dec 12, 2023
838ef0b
refactor(db-proxy): refactor accessor constructor in database-proxy, …
maslow Dec 14, 2023
2b64751
feat(runtime): support LF_NODE_MODULES_CACHE to control if offline de…
maslow Dec 19, 2023
38d8930
chore(cli): fix cli env command description (#1742)
skyoct Dec 19, 2023
bff8b27
chore(web): fix styles & optimize tips & add running cancel (#1740)
newfish-cmyk Dec 19, 2023
150d01f
chore: remove dead links
maslow Dec 19, 2023
cfc93d6
remove custom styles
maslow Dec 19, 2023
edea99a
docs: add cloud function docs
maslow Dec 20, 2023
7115096
add files & auth docs of cloud function
maslow Dec 20, 2023
e470a8f
chore: update auth doc of cloud fn
maslow Dec 20, 2023
bbc32f0
add next steps and toc
maslow Dec 20, 2023
f061750
add fetch, import function docs
maslow Dec 22, 2023
6bbb741
add env docs of cloud fn
maslow Dec 22, 2023
bf7aaa2
add cron, deps, env docs of cloud fn
maslow Dec 22, 2023
e410840
merge remote origin main
maslow Jan 2, 2024
2b64008
chore patch
maslow Jan 2, 2024
2eccc00
update docs
maslow Jan 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 0 additions & 12 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@

node_modules
dist

upload
data/*
tmp

.DS_Store
.idea

coverage
.nyc_

.vitepress/cache
85 changes: 85 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { defineConfig } from 'vitepress'
import { NavItemsInEnglish, SidebarItemsInEnglish } from './en.mts'
import { NavItemsInZh, SidebarItemsInZh } from './zh.mts'

// https://vitepress.dev/reference/site-config
export default defineConfig({
lastUpdated: true,
markdown: {
lineNumbers: true,
},

locales: {
root: {
label: '简体中文',
lang: 'zh-CN',
link: '/zh/',
title: "Laf 开发文档",
description: "laf 开发文档,像写博客一样写函数。",
themeConfig: {
logo: "/logo.png",
footer: {
message: "Apache License V2.0",
copyright: "Copyright © 2021-2024 labring/laf",
},
editLink: {
pattern: "https://github.com/labring/laf/edit/main/docs/:path",
text: "我修改这一页",
},
lastUpdated: {
text: "更新于"
},
docFooter: {
prev: '上一篇',
next: '下一篇'
},
socialLinks: [
{ icon: "github", link: "https://github.com/labring/laf" },
{ icon: "discord", link: "https://discord.gg/KaxHF86CcF" },
{ icon: "twitter", link: "https://twitter.com/laf_dev" },
],
returnToTopLabel: '返回顶部',
externalLinkIcon: true,
outline: 'deep',

// https://vitepress.dev/reference/default-theme-config
nav: NavItemsInZh,

sidebar: SidebarItemsInZh,
},
},
en: {
label: 'English',
lang: 'en',
link: '/en/',
title: "Laf Documentation",
description: "Development documentation of laf, write function like writing blog.",
themeConfig: {
logo: "/logo.png",
footer: {
message: "Apache License V2.0",
copyright: "Copyright © 2021-2024 labring/laf",
},
editLink: {
pattern: "https://github.com/labring/laf/edit/main/docs/:path",
text: "Edit this page on GitHub",
},
socialLinks: [
{ icon: "github", link: "https://github.com/labring/laf" },
{ icon: "discord", link: "https://discord.gg/KaxHF86CcF" },
{ icon: "twitter", link: "https://twitter.com/laf_dev" },
],

outline: 'deep',

externalLinkIcon: true,

// https://vitepress.dev/reference/default-theme-config
nav: NavItemsInEnglish,

sidebar: SidebarItemsInEnglish,
}
},
},

})
17 changes: 17 additions & 0 deletions docs/.vitepress/en.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { DefaultTheme } from 'vitepress'


export const NavItemsInEnglish: DefaultTheme.NavItem[] = [
// { text: 'Guides', link: '/en/' },
// { text: 'Examples', link: './markdown-examples' }
]

export const SidebarItemsInEnglish: DefaultTheme.SidebarItem[] = [
{
text: 'Getting Started',
items: [
{ text: 'Overview', link: '/en/' },
{ text: 'Architecture', link: '/en/architecture' },
]
}
]
37 changes: 12 additions & 25 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
:root {
--vp-c-brand: #646cff;
--vp-c-brand-light: #747bff;
--vp-c-brand-dark: #323cf7;
.VPSidebar::-webkit-scrollbar {
display: none;
}

.inline img {
display: inline;
/*
.VPDocAside .outline-link {
color: rgb(6, 63, 148);
}

.search {
flex-grow: 1;
padding-left: 24px;
.VPDocAside .outline-link {
font-size: 14px;
}

.search button {
justify-content: flex-start;
border: 1px solid transparent;
border-radius: 8px;
padding: 0 10px 0 12px;
width: 100%;
height: 40px;
margin-right: -20px;
background-color: #f6f6f7;
.VPDocAside .outline-link.active {
color: rgb(82, 7, 234);
}

.search button:hover {
border: 1px solid var(--vp-c-brand);
background-color: #f6f6f7;
}

.dark .search button {
background-color: var(--vp-c-bg);
}
.VPDocAside .outline-link:hover {
color: rgb(82, 7, 234);
} */
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import DefaultTheme from 'vitepress/theme'
import './custom.css'

export default DefaultTheme
140 changes: 140 additions & 0 deletions docs/.vitepress/zh.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import { DefaultTheme } from 'vitepress'


function wrapGray(content: string) {
return `<span style='color:darkgray'>${content}</span>`
}

export const NavItemsInZh: DefaultTheme.NavItem[] = [
{ text: '开发指南', link: '/zh/' },
{ text: '使用实例', link: '/zh/examples/' }
]

export const SidebarItemsInZh: DefaultTheme.SidebarItem[] = [
{
text: '入门',
link: '/zh/',
items: [
{
text: 'laf 介绍',
link: '/zh/',
},
{
text: '快速开始',
link: '/zh/quick-start/login'
}
],
},
{
text: '云函数',
collapsed: false,
items: [
{ text: '云函数简介', link: '/zh/cloud-function/' },
{ text: '快速开始', link: '/zh/cloud-function/quick-start' },
{
text: '处理 HTTP',
collapsed: true,
items: [
{ text: '请求', link: '/zh/cloud-function/request' },
{ text: '响应', link: '/zh/cloud-function/response' },
{ text: '认证', link: '/zh/cloud-function/auth' },
{ text: '文件上传', link: '/zh/cloud-function/files' },
]
},
{ text: '发起网络请求', link: '/zh/cloud-function/fetch' },
{ text: '函数引用', link: '/zh/cloud-function/import' },
{ text: '环境变量', link: '/zh/cloud-function/env' },
{ text: '依赖管理', link: '/zh/cloud-function/deps' },
{ text: '定时任务', link: '/zh/cloud-function/cron' },
{
text: '内置云函数',
collapsed: true,
items: [
{ text: '拦截器(TBD)' },
{ text: '初始化(TBD)' },
{ text: 'NotFound(TBD)' },
],
},
{ text: 'WebSocket(TBD)' },
]
},
{
text: '云数据库',
collapsed: false,
items: [
{ text: '云数据库简介', link: '/zh/cloud-database/' },
{ text: '快速开始', link: '/zh/cloud-database/quick-start' },
{ text: '插入文档', link: '/zh/cloud-database/insert' },
{
text: '查询文档',
link: '/zh/cloud-database/find',
collapsed: true,
items: [
{ text: '条件查询', link: '/zh/cloud-database/query/condition' },
{ text: '排序查询', link: '/zh/cloud-database/query/sort' },
{ text: '分页查询', link: '/zh/cloud-database/query/pagination' },
{ text: '嵌套文档查询', link: '/zh/cloud-database/query/nested' },
{ text: '正则模糊查询', link: '/zh/cloud-database/query/regex' },
{ text: '数组查询', link: '/zh/cloud-database/query/array' },
]
},
{ text: '更新文档', link: '/zh/cloud-database/update' },
{ text: '删除文档', link: '/zh/cloud-database/delete' },
{
text: '进阶使用',
collapsed: true,
items: [
{ text: '聚合查询(TBD)' },
{ text: '事务(TBD)' },
{ text: '组合操作(TBD)' },
{ text: '索引(TBD)' },
{ text: '时序集合(TBD)' },
{ text: '变更流(TBD)' },
]
},
{
text: wrapGray('旧版语法'),
collapsed: true,
items: [
{ text: wrapGray('数据库简介'), link: '/zh/cloud-database/database-ql/' },
{ text: wrapGray('数据库入门'), link: '/zh/cloud-database/database-ql/quickstart' },
{ text: wrapGray('新增数据'), link: '/zh/cloud-database/database-ql/add' },
{ text: wrapGray('查询数据'), link: '/zh/cloud-database/database-ql/find' },
{ text: wrapGray('更新数据'), link: '/zh/cloud-database/database-ql/update' },
{ text: wrapGray('删除数据'), link: '/zh/cloud-database/database-ql/del' },
{ text: wrapGray('数据库操作符'), link: '/zh/cloud-database/database-ql/command' },
{ text: wrapGray('数据库聚合操作'), link: '/zh/cloud-database/database-ql/aggregate' },
{ text: wrapGray('数据库运算'), link: '/zh/cloud-database/database-ql/operator' },
]
}
],
},
{
text: '云存储',
collapsed: false,
items: [
{ text: '云存储简介', link: '/zh/cloud-storage/' },
{ text: '上传文件', link: '/zh/cloud-storage/upload' },
{ text: '读取文件', link: '/zh/cloud-storage/read' },
{ text: '删除文件', link: '/zh/cloud-storage/delete' },
{ text: '文件列表', link: '/zh/cloud-storage/list' },
{ text: '生成文件上传地址', link: '/zh/cloud-storage/upload-url' },
{ text: '生成文件下载地址', link: '/zh/cloud-storage/download-url' },
{ text: '网站托管', link: '/zh/cloud-storage/website-hosting' },
{
text: '更多例子',
collapsed: true,
items: [
{ text: '微信小程序上传文件', link: '/zh/examples/wxmp-upload' },
{ text: 'GitHub Action 持续集成网站托管', link: '/zh/examples/website-hosting-ci-cd.md' },
{ text: 'Web 前端上传文件(TBD)' },
{ text: '微信小程序上传文件(TBD)' },
]
}
],
},
{
text: '工具',
items: [{ text: 'laf-cli', link: '/zh/cli/' }],
},
]
2 changes: 2 additions & 0 deletions docs/en/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

> TBD
Binary file added docs/en/ide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading