doc: add docs (#145)

This commit is contained in:
Medcl
2025-02-18 10:44:50 +08:00
committed by GitHub
parent e9ec1be42f
commit 26c6de74ac
21 changed files with 468 additions and 0 deletions

12
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,12 @@
## What does this PR do
## Rationale for this change
## Standards checklist
- [ ] The PR title is descriptive
- [ ] The commit messages are [semantic](https://www.conventionalcommits.org/)
- [ ] Necessary tests are added
- [ ] Updated the release notes
- [ ] Necessary documents have been added if this is a new feature
- [ ] Performance tests checked, no obvious performance degradation

119
.github/workflows/build-docs.yml vendored Normal file
View File

@@ -0,0 +1,119 @@
name: Build and Deploy Docs
on:
push:
branches:
- main
- 'v*'
tags:
- 'v*'
jobs:
build-deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Product Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set Variables Based on Ref
id: vars
run: |
PRODUCT_NAME=$(basename $(pwd)) # Get the directory name as the product name
echo "PRODUCT_NAME=$PRODUCT_NAME" >> $GITHUB_ENV
CURRENT_REF=${GITHUB_REF##*/}
IS_SEMVER=false
SEMVER_REGEX="^v([0-9]+)\.([0-9]+)\.([0-9]+)$"
if [[ "${GITHUB_REF_TYPE}" == "branch" ]]; then
if [[ "$CURRENT_REF" == "main" ]]; then
echo "VERSION=main" >> $GITHUB_ENV
echo "BRANCH=main" >> $GITHUB_ENV
elif [[ "$CURRENT_REF" =~ $SEMVER_REGEX ]]; then
IS_SEMVER=true
echo "VERSION=$CURRENT_REF" >> $GITHUB_ENV
echo "BRANCH=$CURRENT_REF" >> $GITHUB_ENV
else
echo "Branch '$CURRENT_REF' is not a valid semantic version. Skipping build."
exit 0
fi
elif [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
if [[ "$CURRENT_REF" =~ $SEMVER_REGEX ]]; then
IS_SEMVER=true
echo "VERSION=$CURRENT_REF" >> $GITHUB_ENV
echo "BRANCH=main" >> $GITHUB_ENV # Set BRANCH to 'main' for tags
else
echo "Tag '$CURRENT_REF' is not a valid semantic version. Skipping build."
exit 0
fi
fi
# Gather branches and tags, filter for semantic versions, sort, remove duplicates
VERSIONS=$(git for-each-ref refs/remotes/origin refs/tags --format="%(refname:short)" | \
grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$" | sort -Vr | uniq | tr '\n' ',' | sed 's/,$//')
echo "VERSIONS=main,$VERSIONS" >> $GITHUB_ENV
- name: Install Hugo
run: |
wget https://github.com/gohugoio/hugo/releases/download/v0.79.1/hugo_extended_0.79.1_Linux-64bit.tar.gz
tar -xzvf hugo_extended_0.79.1_Linux-64bit.tar.gz
sudo mv hugo /usr/local/bin/
- name: Checkout Docs Repo
uses: actions/checkout@v2
with:
repository: infinilabs/docs
path: docs-output
token: ${{ secrets.DOCS_DEPLOYMENT_TOKEN }}
- name: Build Documentation
run: |
(cd docs && OUTPUT=$(pwd)/../docs-output make docs-build docs-place-redirect)
- name: Commit and Push Changes to Docs Repo
working-directory: docs-output
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
if [[ -n $(git status --porcelain) ]]; then
git add .
git commit -m "Rebuild $PRODUCT_NAME docs for version $VERSION"
git push origin main
else
echo "No changes to commit."
fi
- name: Rebuild Docs for Latest Version (main), if not already on main
run: |
# Only rebuild the main branch docs if the current ref is not "main"
if [[ "$CURRENT_REF" != "main" ]]; then
echo "Switching to main branch and rebuilding docs for 'latest'"
# Checkout the main branch of the product repo to rebuild docs for "latest"
git checkout main
# Ensure the latest changes are pulled
git pull origin main
# Build Docs for Main Branch (latest)
(cd docs && OUTPUT=$(pwd)/../docs-output VERSION="main" BRANCH="main" make docs-build docs-place-redirect)
# Commit and Push Latest Docs to Main
cd docs-output
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
if [[ -n $(git status --porcelain) ]]; then
git add .
git commit -m "Rebuild $PRODUCT_NAME docs for main branch with latest version"
git push origin main
else
echo "No changes to commit for main."
fi
else
echo "Current ref is 'main', skipping rebuild for 'latest'."
fi
working-directory: ./ # Working in the product repo

4
docs/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
/public/
resources/_gen/
/themes/
/config.bak

54
docs/Makefile Normal file
View File

@@ -0,0 +1,54 @@
SHELL=/bin/bash
# Basic info
PRODUCT?= $(shell basename "$(shell cd .. && pwd)")
BRANCH?= main
VERSION?= $(shell [[ "$(BRANCH)" == "main" ]] && echo "main" || echo "$(BRANCH)")
CURRENT_VERSION?= $(VERSION)
VERSIONS?= "main"
OUTPUT?= "/tmp/docs"
THEME_FOLDER?= "themes/book"
THEME_REPO?= "https://github.com/infinilabs/docs-theme.git"
THEME_BRANCH?= "main"
.PHONY: docs-build
default: docs-build
docs-init:
@if [ ! -d $(THEME_FOLDER) ]; then echo "theme does not exist";(git clone -b $(THEME_BRANCH) $(THEME_REPO) $(THEME_FOLDER) ) fi
docs-env:
@echo "Debugging Variables:"
@echo "PRODUCT: $(PRODUCT)"
@echo "BRANCH: $(BRANCH)"
@echo "VERSION: $(VERSION)"
@echo "CURRENT_VERSION: $(CURRENT_VERSION)"
@echo "VERSIONS: $(VERSIONS)"
@echo "OUTPUT: $(OUTPUT)"
docs-config: docs-init
cp config.yaml config.bak
# Detect OS and apply the appropriate sed command
@if [ "$$(uname)" = "Darwin" ]; then \
echo "Running on macOS"; \
sed -i '' "s/BRANCH/$(VERSION)/g" config.yaml; \
else \
echo "Running on Linux"; \
sed -i 's/BRANCH/$(VERSION)/g' config.yaml; \
fi
docs-build: docs-config
hugo --minify --theme book --destination="$(OUTPUT)/$(PRODUCT)/$(VERSION)" \
--baseURL="/$(PRODUCT)/$(VERSION)"
@$(MAKE) docs-restore-generated-file
docs-serve: docs-config
hugo serve
@$(MAKE) docs-restore-generated-file
docs-place-redirect:
echo "<!DOCTYPE html> <html> <head> <meta http-equiv=refresh content=0;url=main /> </head> <body> <p><a href=main />REDIRECT TO THE LATEST_VERSION</a>.</p> </body> </html>" > $(OUTPUT)/$(PRODUCT)/index.html
docs-restore-generated-file:
mv config.bak config.yaml

93
docs/config.yaml Normal file
View File

@@ -0,0 +1,93 @@
# VERSIONS=latest,v1.0 hugo --minify --baseURL="/product/v1.0/" -d public/product/v1.0
title: Coco AI App
theme: book
# Book configuration
disablePathToLower: true
enableGitInfo: false
# Needed for mermaid/katex shortcodes
markup:
goldmark:
renderer:
unsafe: true
tableOfContents:
startLevel: 1
# Multi-lingual mode config
# There are different options to translate files
# See https://gohugo.io/content-management/multilingual/#translation-by-filename
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
defaultContentLanguage: en
languages:
en:
languageName: English
contentDir: content.en
weight: 3
menu:
before: []
after:
- name: "Github"
url: "https://github.com/infinilabs/coco-app"
weight: 10
params:
# (Optional, default light) Sets color theme: light, dark or auto.
# Theme 'auto' switches between dark and light modes based on browser/os preferences
BookTheme: "auto"
# (Optional, default true) Controls table of contents visibility on right side of pages.
# Start and end levels can be controlled with markup.tableOfContents setting.
# You can also specify this parameter per page in front matter.
BookToC: true
# (Optional, default none) Set the path to a logo for the book. If the logo is
# /static/logo.png then the path would be logo.png
BookLogo: img/logo
# (Optional, default none) Set leaf bundle to render as side menu
# When not specified file structure and weights will be used
# BookMenuBundle: /menu
# (Optional, default docs) Specify root page to render child pages as menu.
# Page is resoled by .GetPage function: https://gohugo.io/functions/getpage/
# For backward compatibility you can set '*' to render all sections to menu. Acts same as '/'
BookSection: docs
# Set source repository location.
# Used for 'Last Modified' and 'Edit this page' links.
BookRepo: https://github.com/infinilabs/coco-app
# Enable "Edit this page" links for 'doc' page type.
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
# Edit path must point to root directory of repo.
BookEditPath: edit/BRANCH/docs
# Configure the date format used on the pages
# - In git information
# - In blog posts
BookDateFormat: "January 2, 2006"
# (Optional, default true) Enables search function with flexsearch,
# Index is built on fly, therefore it might slowdown your website.
# Configuration for indexing can be adjusted in i18n folder per language.
BookSearch: false
# (Optional, default true) Enables comments template on pages
# By default partals/docs/comments.html includes Disqus template
# See https://gohugo.io/content-management/comments/#configure-disqus
# Can be overwritten by same param in page frontmatter
BookComments: false
# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
# Theme will print warning if page referenced in markdown does not exists.
BookPortableLinks: true
# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
BookServiceWorker: false

25
docs/content.en/_index.md Normal file
View File

@@ -0,0 +1,25 @@
---
title: Coco AI App
type: docs
---
# Coco AI - **Co**nnect & **Co**llaborate
Coco AI is a fully open-source, cross-platform unified search and productivity tool that connects and searches across various data sources, including applications, files, Google Drive, Notion, Yuque, Hugo, and more, both local and cloud-based. By integrating with large models like DeepSeek, Coco AI enables intelligent personal knowledge management, emphasizing privacy and supporting private deployment, helping users quickly and intelligently access their information.
![](/img/screenshot/fusion-search-across-datasources.png)
![](/img/screenshot/coco-chat.png)
For more details on Coco Server, visit: [https://docs.infinilabs.com/coco-app/](https://docs.infinilabs.com/coco-app/).
## Community
Feel free to join the Discord server to discuss anything related to this project:
👉 [Join the INFINI Community on Discord](https://discord.gg/4tKTMkkvVX)
## License
Coco AI is a truly open-source project, licensed under the [MIT License](https://github.com/infinilabs/coco-app/blob/main/LICENSE).
We also offer a commercially supported, enterprise-ready version of the software.

View File

@@ -0,0 +1,24 @@
---
title: Coco AI App
type: docs
---
# Coco AI - **Co**nnect & **Co**llaborate
Coco AI is a fully open-source, cross-platform unified search and productivity tool that connects and searches across various data sources, including applications, files, Google Drive, Notion, Yuque, Hugo, and more, both local and cloud-based. By integrating with large models like DeepSeek, Coco AI enables intelligent personal knowledge management, emphasizing privacy and supporting private deployment, helping users quickly and intelligently access their information.
![](/img/screenshot/coco-chat.png)
For more details on Coco Server, visit: [https://docs.infinilabs.com/coco-app/](https://docs.infinilabs.com/coco-app/).
## Community
Feel free to join the Discord server to discuss anything related to this project:
👉 [Join the INFINI Community on Discord](https://discord.gg/4tKTMkkvVX)
## License
Coco AI is a truly open-source project, licensed under the [MIT License](https://github.com/infinilabs/coco-app/blob/main/LICENSE).
We also offer a commercially supported, enterprise-ready version of the software.

View File

@@ -0,0 +1,5 @@
---
weight: 10
title: "Getting Started"
bookCollapseSection: false
---

View File

@@ -0,0 +1,5 @@
---
weight: 10
title: "Installation"
bookCollapseSection: true
---

View File

@@ -0,0 +1,21 @@
---
weight: 10
title: "Mac OS"
asciinema: true
---
# Mac OS
## Download Coco AI
Goto [https://coco.rs/](https://coco.rs/)
![](/img/download-mac-app.png)
## Unzip DMG file
![](/img/unzip-dmg-file.png)
## Drag to Application Folder
![](/img/drag-to-application-folder.png)

View File

@@ -0,0 +1,36 @@
---
weight: 10
title: "Screenshot"
asciinema: true
---
# Screenshot
## Screenshot Gallery
Here are some screenshots showcasing the user interface:
**Search Local Desktop Applications**
![Search Local Desktop Applications](/img/screenshot/coco-search-local-apps.png)
Seamlessly search through your local apps directly from Coco AI.
**Search Across Personal & Enterprise Knowledge Bases**
![Chat with Your AI Assistant](/img/screenshot/fusion-search-across-datasources.png)
Perform hybrid searches across multiple data sources, including personal and company knowledge bases.
**Chat with Your AI Assistant**
![Chat with Your AI Assistant](/img/screenshot/coco-chat.png)
Interact with the AI assistant, which leverages your personal knowledge base to provide detailed and intelligent answers.
**Chat History View**
![Chat History View](/img/screenshot/chat-history-view.png)
The AI Assistant allows you to review past conversations, ensuring context-aware responses.
**Private Deployment Support**
![Private Deployment Support](/img/screenshot/coco-connector-to-your-own-server.png)
You can deploy Coco Server privately, ensuring data security and privacy.

View File

@@ -0,0 +1,35 @@
---
weight: 80
title: "Release Notes"
---
# Release Notes
Information about release notes of Coco Server is provided here.
## Latest (In development)
### Features
### Breaking changes
### Bug fix
### Improvements
## 0.1.0 (2015-02-16)
### Features
- Fusion Search
- Chat with AI Assistant
- RAG-based AI Chat
- General Settings
- Global Shortcut
- Auto Start on Startup
- Shortcut to Features
- Application Search for macOS
- Option to Connect to Self-Hosted Coco Server
### Breaking changes
### Bug fix
### Improvements

BIN
docs/static/img/download-mac-app.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

35
docs/static/img/logo-en.svg vendored Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

BIN
docs/static/img/screenshot/coco-chat.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

BIN
docs/static/img/unzip-dmg-file.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB