From 7d8802ce2a2b6008829867f1f7afcdb1a178ec5c Mon Sep 17 00:00:00 2001 From: angpt Date: Thu, 30 Apr 2026 11:20:02 -0500 Subject: [PATCH] Creating gitbook docs Adding configuration + github action to create docs for Gitbook on merge. --- .gitbook.yaml | 5 +++ .github/workflows/sync-gitbook-docs.yaml | 47 ++++++++++++++++++++++++ docs/SUMMARY.md | 21 +++++++++++ 3 files changed, 73 insertions(+) create mode 100644 .gitbook.yaml create mode 100644 .github/workflows/sync-gitbook-docs.yaml create mode 100644 docs/SUMMARY.md diff --git a/.gitbook.yaml b/.gitbook.yaml new file mode 100644 index 0000000..9f0e873 --- /dev/null +++ b/.gitbook.yaml @@ -0,0 +1,5 @@ +root: ./docs/ + +structure: + readme: index.md + summary: SUMMARY.md diff --git a/.github/workflows/sync-gitbook-docs.yaml b/.github/workflows/sync-gitbook-docs.yaml new file mode 100644 index 0000000..8c41ac9 --- /dev/null +++ b/.github/workflows/sync-gitbook-docs.yaml @@ -0,0 +1,47 @@ +name: Sync docs to gitbook-docs + +on: + push: + branches: [main] + paths: + - 'docs/**' + - '.gitbook.yaml' + workflow_dispatch: + +jobs: + sync: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Sync docs to gitbook-docs branch + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + cp -r docs /tmp/docs + cp .gitbook.yaml /tmp/.gitbook.yaml + + if git ls-remote --exit-code --heads origin gitbook-docs; then + git checkout gitbook-docs + else + git checkout --orphan gitbook-docs + git rm -rf . --quiet || true + fi + + rm -rf docs .gitbook.yaml + cp -r /tmp/docs . + cp /tmp/.gitbook.yaml . + + git add docs/ .gitbook.yaml + if git diff --cached --quiet; then + echo "No changes to sync." + exit 0 + fi + git commit -m "sync: update docs from main" + git push origin gitbook-docs diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md new file mode 100644 index 0000000..45384ca --- /dev/null +++ b/docs/SUMMARY.md @@ -0,0 +1,21 @@ +# Summary + +* [Introduction](index.md) + +## Guides + +* [Models](models.md) +* [Tools](tools.md) +* [Callbacks](callbacks.md) +* [Tracing](tracing.md) +* [Serving](serving.md) +* [Evaluation](evaluation.md) + +## Cookbook + +* [Your first agent](cookbook/your-first-agent.md) +* [Evaluating an agent](cookbook/your-first-agent-evaluation.md) +* [MCP agent](cookbook/mcp-agent.md) +* [Callbacks](cookbook/callbacks.md) +* [Serve over A2A](cookbook/serve-a2a.md) +* [Local LLM](cookbook/agent-with-local-llm.md)