Skip to content

Commit 68b9ece

Browse files
authored
feat: docs book (#16)
1 parent b0e87f4 commit 68b9ece

31 files changed

+2922
-160
lines changed

.github/workflows/deploy.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- dev
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write # To push a branch
12+
pull-requests: write # To create a PR from that branch
13+
steps:
14+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
15+
with:
16+
fetch-depth: 0
17+
- name: Install latest mdbook
18+
run: |
19+
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
20+
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
21+
mkdir mdbook
22+
curl -sSL $url | tar -xz --directory=./mdbook
23+
echo `pwd`/mdbook >> $GITHUB_PATH
24+
cargo install mdbook-mermaid
25+
- name: Deploy GitHub Pages
26+
run: |
27+
# This assumes your book is in the root of your repository.
28+
# Just add a `cd` here if you need to change to another directory.
29+
cd docs
30+
mdbook build
31+
git worktree add gh-pages
32+
git config user.name "Deploy from CI"
33+
git config user.email ""
34+
cd gh-pages
35+
# Delete the ref to avoid keeping history.
36+
git update-ref -d refs/heads/gh-pages
37+
rm -rf *
38+
mv ../book/* .
39+
git add .
40+
git commit -m "Deploy $GITHUB_SHA to gh-pages"
41+
git push --force --set-upstream origin gh-pages

.github/workflows/docs-test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
on: [push, pull_request]
3+
permissions:
4+
contents: read
5+
6+
jobs:
7+
test:
8+
name: Test
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
12+
- name: Install Rust
13+
run: |
14+
rustup set profile minimal
15+
rustup toolchain install stable
16+
rustup default stable
17+
- name: Install latest mdbook
18+
run: |
19+
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
20+
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
21+
mkdir bin
22+
curl -sSL $url | tar -xz --directory=bin
23+
echo "$(pwd)/bin" >> $GITHUB_PATH
24+
cargo install mdbook-mermaid
25+
- name: Run tests
26+
run: |
27+
cd docs
28+
mdbook test

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,9 @@ apps/server/api/*.wav
6161
asr_result*.wav
6262

6363
# FVM Version Cache
64-
.fvm/
64+
.fvm/
65+
66+
# book
67+
/index.html
68+
docs/book/
69+
docs/index.html

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 lastsunday
3+
Copyright (c) 2026 lastsunday
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ To make an self contained chatbot(self host all component,eg: llm,tts etc..), li
2828

2929
## Documentation
3030

31-
You can find user guide documentation on [here](./docs/guide/README.md).
31+
You can find user guide documentation on [here](./docs/src/guide/README.md).
3232

33-
You can find user development documentation on [here](/docs/development/README.md).
33+
You can find user development documentation on [here](/docs/src/development/README.md).
3434

3535
## Quick start
3636

@@ -87,7 +87,7 @@ Expected workflow is: Fork -> Patch -> Push -> Pull Request
8787
8888
## FAQ
8989

90-
See the [FAQ](./docs/guide/faq.md) file
90+
See the [FAQ](./docs/src/faq.md) file
9191

9292
## License
9393

docs/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/book.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[book]
2+
title = "Chobits"
3+
authors = ["lastsunday"]
4+
language = "zh"
5+
src = "src"
6+
7+
[preprocessor]
8+
9+
[preprocessor.mermaid]
10+
command = "mdbook-mermaid"
11+
12+
[output]
13+
14+
[output.html]
15+
additional-js = ["mermaid.min.js", "mermaid-init.js"]

docs/development/server.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

docs/guide/README.md

Whitespace-only changes.

docs/guide/api.md

Whitespace-only changes.

0 commit comments

Comments
 (0)