Skip to content

Commit fbd4401

Browse files
committed
docs: initialize docs with vitepress and typedoc
1 parent fab9d14 commit fbd4401

File tree

154 files changed

+5683
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+5683
-207
lines changed

.github/workflows/main.yml

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: Release and Docs
22

33
env:
44
HUSKY: 0
@@ -22,9 +22,12 @@ concurrency:
2222

2323
permissions:
2424
contents: write
25+
pages: write
26+
id-token: write
2527

2628
jobs:
2729
release:
30+
name: Release
2831
runs-on: ubuntu-latest
2932
steps:
3033
- name: Checkout
@@ -33,7 +36,24 @@ jobs:
3336
uses: oven-sh/setup-bun@v2
3437
- name: Install dependencies
3538
run: bun install
39+
- name: Build docs
40+
run: bun run docs:build
3641
- name: Release
3742
run: bunx changelogen --release --push --${{ github.event.inputs.version }}
3843
env:
3944
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: docs/.vitepress/dist
49+
docs:
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
needs: release
54+
runs-on: ubuntu-latest
55+
name: Deploy
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

.gitignore

+4-46
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ lib-cov
2323
coverage
2424
*.lcov
2525

26-
# nyc test coverage
27-
.nyc_output
28-
29-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30-
.grunt
31-
3226
# Bower dependency directory (https://bower.io/)
3327
bower_components
3428

@@ -57,82 +51,46 @@ web_modules/
5751
# Optional stylelint cache
5852
.stylelintcache
5953

60-
# Microbundle cache
61-
.rpt2_cache/
62-
.rts2_cache_cjs/
63-
.rts2_cache_es/
64-
.rts2_cache_umd/
65-
6654
# Optional REPL history
6755
.node_repl_history
6856

6957
# Output of 'npm pack'
7058
*.tgz
7159

72-
# Yarn Integrity file
73-
.yarn-integrity
74-
7560
# dotenv environment variable files
7661
.env
7762
.env.development.local
7863
.env.test.local
7964
.env.production.local
8065
.env.local
8166

82-
# parcel-bundler cache (https://parceljs.org/)
83-
.cache
84-
.parcel-cache
85-
86-
# Next.js build output
87-
.next
88-
out
89-
9067
# Nuxt.js build / generate output
9168
.nuxt
9269
dist
9370

94-
# Gatsby files
95-
.cache/
96-
# Comment in the public line in if your project uses Gatsby and not Next.js
97-
# https://nextjs.org/blog/next-9-1#public-directory-support
98-
# public
99-
10071
# vuepress build output
10172
.vuepress/dist
10273

10374
# vuepress v2.x temp and cache directory
10475
.temp
10576
.cache
10677

107-
# Serverless directories
108-
.serverless/
109-
110-
# FuseBox cache
111-
.fusebox/
112-
113-
# DynamoDB Local files
114-
.dynamodb/
115-
11678
# TernJS port file
11779
.tern-port
11880

11981
# Stores VSCode versions used for testing VSCode extensions
12082
.vscode-test
12183

122-
# yarn v2
123-
.yarn/cache
124-
.yarn/unplugged
125-
.yarn/build-state.yml
126-
.yarn/install-state.gz
127-
.pnp.*
12884
**/tmp**
12985
src/mad_hatter/core_plugin/settings.json
13086
src/plugins/*
13187
src/assets/*
13288
data/*
13389
!src/plugins/README.md
13490
!src/assets/README.md
135-
!src/assets/favicon.png
91+
!src/assets/favicon.ico
13692
!src/assets/swagger-ui-theme.css
13793
!data/README.md
138-
ccat
94+
ccat
95+
docs/.vitepress/dist
96+
docs/.vitepress/cache

.vscode/settings.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
2-
// Enable the ESlint flat config support
3-
"eslint.experimental.useFlatConfig": true,
4-
// Disable the default formatter, use eslint instead
5-
"prettier.enable": false,
2+
"eslint.useFlatConfig": true,
63
"editor.formatOnSave": false,
7-
// Auto fix
84
"editor.codeActionsOnSave": {
95
"source.fixAll.eslint": "explicit",
106
"source.organizeImports": "never"
117
},
12-
// Silent the stylistic rules in you IDE, but still auto fix them
138
"eslint.rules.customizations": [
149
{ "rule": "style/*", "severity": "off" },
1510
{ "rule": "format/*", "severity": "off" },
@@ -22,7 +17,6 @@
2217
{ "rule": "*quotes", "severity": "off" },
2318
{ "rule": "*semi", "severity": "off" }
2419
],
25-
// Enable eslint for all supported languages
2620
"eslint.validate": [
2721
"javascript",
2822
"typescript",

bun.lockb

37 KB
Binary file not shown.

docs/.vitepress/config.ts

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import { defineConfig } from 'vitepress'
2+
import typedocSidebar from '../api/typedoc-sidebar.json'
3+
4+
// https://vitepress.dev/reference/site-config
5+
export default defineConfig({
6+
title: 'Home',
7+
titleTemplate: 'Cheshire Cat - :title',
8+
description: 'Hackable and production-ready framework for developing AI agents on top of LLMs',
9+
head: [['link', { rel: 'icon', href: '/favicon.ico' }]],
10+
lastUpdated: true,
11+
cleanUrls: true,
12+
themeConfig: {
13+
logo: {
14+
dark: '/logo-dark.svg',
15+
light: '/logo-light.svg',
16+
alt: 'Cheshire Cat Logo',
17+
},
18+
footer: {
19+
message: 'Released under the GPL-3.0 License.',
20+
copyright: 'Copyright © 2024-present Daniele Nicosia & Contributors',
21+
},
22+
search: {
23+
provider: 'local',
24+
},
25+
nav: [
26+
{ text: 'Home', link: '/' },
27+
{ text: 'Docs', link: '/introduction' },
28+
{ text: 'API', link: '/api/' },
29+
{ text: 'Contributors', link: '/contributors' },
30+
],
31+
sidebar: [
32+
{
33+
text: 'Documentation',
34+
items: [
35+
{
36+
text: 'Introduction',
37+
link: '/introduction',
38+
},
39+
{
40+
text: 'Getting Started',
41+
link: '/getting-started',
42+
},
43+
],
44+
},
45+
{
46+
text: 'API Reference',
47+
items: [
48+
{
49+
text: 'Overview',
50+
link: '/api/',
51+
},
52+
...typedocSidebar,
53+
],
54+
},
55+
{
56+
text: 'Contributors',
57+
link: '/contributors',
58+
},
59+
],
60+
socialLinks: [
61+
{ icon: 'github', link: 'https://github.com/zAlweNy26/ts-cat' },
62+
{ icon: 'discord', link: 'https://discord.gg/bHX5sNFCYU' },
63+
{ icon: 'linkedin', link: 'https://www.linkedin.com/company/cheshire-cat-ai' },
64+
],
65+
},
66+
})

docs/.vitepress/theme/Layout.vue

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<script setup lang="ts">
2+
import { useData } from 'vitepress'
3+
import DefaultTheme from 'vitepress/theme'
4+
import { nextTick, provide } from 'vue'
5+
6+
const { isDark } = useData()
7+
8+
function enableTransitions() {
9+
return 'startViewTransition' in document
10+
&& window.matchMedia('(prefers-reduced-motion: no-preference)').matches
11+
}
12+
13+
provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
14+
if (!enableTransitions()) {
15+
isDark.value = !isDark.value
16+
return
17+
}
18+
19+
const clipPath = [
20+
`circle(0px at ${x}px ${y}px)`,
21+
`circle(${Math.hypot(
22+
Math.max(x, innerWidth - x),
23+
Math.max(y, innerHeight - y),
24+
)}px at ${x}px ${y}px)`,
25+
]
26+
27+
await document.startViewTransition(async () => {
28+
isDark.value = !isDark.value
29+
await nextTick()
30+
}).ready
31+
32+
document.documentElement.animate(
33+
{ clipPath: isDark.value ? clipPath.reverse() : clipPath },
34+
{
35+
duration: 300,
36+
easing: 'ease-in',
37+
pseudoElement: `::view-transition-${isDark.value ? 'old' : 'new'}(root)`,
38+
},
39+
)
40+
})
41+
</script>
42+
43+
<template>
44+
<DefaultTheme.Layout />
45+
</template>
46+
47+
<style>
48+
::view-transition-old(root),
49+
::view-transition-new(root) {
50+
animation: none;
51+
mix-blend-mode: normal;
52+
}
53+
54+
::view-transition-old(root),
55+
.dark::view-transition-new(root) {
56+
z-index: 1;
57+
}
58+
59+
::view-transition-new(root),
60+
.dark::view-transition-old(root) {
61+
z-index: 9999;
62+
}
63+
64+
.VPSwitchAppearance {
65+
width: 22px !important;
66+
}
67+
68+
.VPSwitchAppearance .check {
69+
transform: none !important;
70+
}
71+
</style>

docs/.vitepress/theme/custom.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:root {
2+
--vp-c-brand-1: #3a98a4;
3+
--vp-c-brand-2: #54b1bc;
4+
--vp-c-brand-3: #327a88;
5+
}

docs/.vitepress/theme/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import Layout from './Layout.vue'
3+
import './custom.css'
4+
5+
export default {
6+
extends: DefaultTheme,
7+
Layout,
8+
}

0 commit comments

Comments
 (0)