Skip to content

Commit 8aa5a7a

Browse files
author
shijiashuai
committed
docs: add VitePress documentation site with GitHub Pages deployment
1 parent 3c31b0b commit 8aa5a7a

7 files changed

Lines changed: 2722 additions & 0 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
paths:
7+
- "docs/**"
8+
- ".github/workflows/deploy-docs.yml"
9+
workflow_dispatch:
10+
11+
# 设置 GITHUB_TOKEN 权限以允许部署到 GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# 只允许一个并发部署,跳过正在排队的运行
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 20
35+
cache: npm
36+
cache-dependency-path: docs/package-lock.json
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
working-directory: docs
41+
42+
- name: Build docs
43+
run: npm run docs:build
44+
working-directory: docs
45+
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v5
48+
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: docs/.vitepress/dist
53+
54+
deploy:
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
needs: build
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ venv.bak/
6464
# Sphinx documentation
6565
docs/_build/
6666

67+
# VitePress
68+
docs/.vitepress/dist/
69+
docs/.vitepress/cache/
70+
node_modules/
71+
6772
# PyBuilder
6873
target/
6974

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# CleanBook —— 智能书签清理与分类(中文)
22

3+
[![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://lessup.github.io/bookmarks-cleaner/)
4+
35
KISS:规则 + 机器学习 + 可选 LLM,默认离线可用。统一清理标题 emoji,强力去重,输出 HTML/Markdown/JSON。
46

57
## 特性

docs/.vitepress/config.mts

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import { defineConfig } from "vitepress";
2+
3+
export default defineConfig({
4+
lang: "zh-CN",
5+
title: "CleanBook",
6+
description: "智能书签清理与分类:规则 + ML + LLM(可选)",
7+
8+
// GitHub Pages 部署时的 base 路径
9+
base: "/bookmarks-cleaner/",
10+
11+
lastUpdated: true,
12+
cleanUrls: true,
13+
14+
head: [
15+
["link", { rel: "icon", type: "image/svg+xml", href: "/bookmarks-cleaner/favicon.svg" }],
16+
],
17+
18+
themeConfig: {
19+
logo: "/favicon.svg",
20+
21+
nav: [
22+
{ text: "快速上手", link: "/quickstart_zh" },
23+
{ text: "设计文档", link: "/DESIGN" },
24+
{
25+
text: "深入",
26+
items: [
27+
{ text: "系统架构", link: "/design/system_architecture" },
28+
{ text: "ML 设计", link: "/design/ml_design_zh" },
29+
{ text: "LLM 提示词", link: "/llm_prompt_templates" },
30+
{ text: "技术报告", link: "/technical_report" },
31+
],
32+
},
33+
{
34+
text: "GitHub",
35+
link: "https://github.com/LessUp/bookmarks-cleaner",
36+
},
37+
],
38+
39+
sidebar: [
40+
{
41+
text: "入门",
42+
items: [
43+
{ text: "简介", link: "/" },
44+
{ text: "快速上手", link: "/quickstart_zh" },
45+
],
46+
},
47+
{
48+
text: "设计",
49+
items: [
50+
{ text: "设计说明", link: "/DESIGN" },
51+
{ text: "系统架构", link: "/design/system_architecture" },
52+
{ text: "ML 设计", link: "/design/ml_design_zh" },
53+
{ text: "书签管理最佳实践", link: "/design/bookmark_best_practices_zh" },
54+
],
55+
},
56+
{
57+
text: "进阶",
58+
items: [
59+
{ text: "LLM 提示词模板", link: "/llm_prompt_templates" },
60+
{ text: "技术报告", link: "/technical_report" },
61+
{ text: "开发指南", link: "/guides/development_guide" },
62+
],
63+
},
64+
],
65+
66+
socialLinks: [
67+
{ icon: "github", link: "https://github.com/LessUp/bookmarks-cleaner" },
68+
],
69+
70+
footer: {
71+
message: "MIT License",
72+
copyright: "© 2024-present LessUp",
73+
},
74+
75+
outline: {
76+
level: [2, 3],
77+
label: "页面导航",
78+
},
79+
80+
docFooter: {
81+
prev: "上一篇",
82+
next: "下一篇",
83+
},
84+
85+
lastUpdated: {
86+
text: "最后更新",
87+
},
88+
89+
search: {
90+
provider: "local",
91+
options: {
92+
translations: {
93+
button: { buttonText: "搜索文档", buttonAriaLabel: "搜索文档" },
94+
modal: {
95+
noResultsText: "未找到相关结果",
96+
resetButtonTitle: "清除查询",
97+
footer: { selectText: "选择", navigateText: "切换", closeText: "关闭" },
98+
},
99+
},
100+
},
101+
},
102+
},
103+
});

docs/index.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
layout: home
3+
4+
hero:
5+
name: CleanBook
6+
text: 智能书签清理与分类
7+
tagline: 规则 + 机器学习 + 可选 LLM,默认离线可用
8+
actions:
9+
- theme: brand
10+
text: 快速上手
11+
link: /quickstart_zh
12+
- theme: alt
13+
text: 设计文档
14+
link: /DESIGN
15+
- theme: alt
16+
text: GitHub
17+
link: https://github.com/LessUp/bookmarks-cleaner
18+
19+
features:
20+
- title: 规则优先
21+
details: 基于受控词表与分面分类,配置驱动,无需改代码即可定制规则与权重。
22+
- title: ML 辅助
23+
details: 高置信度样本自动沉淀为训练集,轻量 sklearn 模型增强分类准确率。
24+
- title: LLM 可选
25+
details: 支持 OpenAI 兼容接口(GPT-4o-mini 等),失败自动降级到离线路径。
26+
- title: 多格式导出
27+
details: 输出 HTML(Netscape 格式可导入浏览器)、Markdown、JSON,结构最多两级。
28+
---

0 commit comments

Comments
 (0)