Skip to content

Commit

Permalink
docs: initialize docs with vitepress and typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
zAlweNy26 committed Oct 22, 2024
1 parent fab9d14 commit fbd4401
Show file tree
Hide file tree
Showing 154 changed files with 5,683 additions and 207 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release and Docs

env:
HUSKY: 0
Expand All @@ -22,9 +22,12 @@ concurrency:

permissions:
contents: write
pages: write
id-token: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -33,7 +36,24 @@ jobs:
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Build docs
run: bun run docs:build
- name: Release
run: bunx changelogen --release --push --${{ github.event.inputs.version }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: release
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
50 changes: 4 additions & 46 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ lib-cov
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

Expand Down Expand Up @@ -57,82 +51,46 @@ web_modules/
# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

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

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
**/tmp**
src/mad_hatter/core_plugin/settings.json
src/plugins/*
src/assets/*
data/*
!src/plugins/README.md
!src/assets/README.md
!src/assets/favicon.png
!src/assets/favicon.ico
!src/assets/swagger-ui-theme.css
!data/README.md
ccat
ccat
docs/.vitepress/dist
docs/.vitepress/cache
8 changes: 1 addition & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"eslint.useFlatConfig": true,
"editor.formatOnSave": false,
// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
Expand All @@ -22,7 +17,6 @@
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],
// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"typescript",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
66 changes: 66 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { defineConfig } from 'vitepress'
import typedocSidebar from '../api/typedoc-sidebar.json'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Home',
titleTemplate: 'Cheshire Cat - :title',
description: 'Hackable and production-ready framework for developing AI agents on top of LLMs',
head: [['link', { rel: 'icon', href: '/favicon.ico' }]],
lastUpdated: true,
cleanUrls: true,
themeConfig: {
logo: {
dark: '/logo-dark.svg',
light: '/logo-light.svg',
alt: 'Cheshire Cat Logo',
},
footer: {
message: 'Released under the GPL-3.0 License.',
copyright: 'Copyright © 2024-present Daniele Nicosia & Contributors',
},
search: {
provider: 'local',
},
nav: [
{ text: 'Home', link: '/' },
{ text: 'Docs', link: '/introduction' },
{ text: 'API', link: '/api/' },
{ text: 'Contributors', link: '/contributors' },
],
sidebar: [
{
text: 'Documentation',
items: [
{
text: 'Introduction',
link: '/introduction',
},
{
text: 'Getting Started',
link: '/getting-started',
},
],
},
{
text: 'API Reference',
items: [
{
text: 'Overview',
link: '/api/',
},
...typedocSidebar,
],
},
{
text: 'Contributors',
link: '/contributors',
},
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/zAlweNy26/ts-cat' },
{ icon: 'discord', link: 'https://discord.gg/bHX5sNFCYU' },
{ icon: 'linkedin', link: 'https://www.linkedin.com/company/cheshire-cat-ai' },
],
},
})
71 changes: 71 additions & 0 deletions docs/.vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<script setup lang="ts">
import { useData } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import { nextTick, provide } from 'vue'
const { isDark } = useData()
function enableTransitions() {
return 'startViewTransition' in document
&& window.matchMedia('(prefers-reduced-motion: no-preference)').matches
}
provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
if (!enableTransitions()) {
isDark.value = !isDark.value
return
}
const clipPath = [
`circle(0px at ${x}px ${y}px)`,
`circle(${Math.hypot(
Math.max(x, innerWidth - x),
Math.max(y, innerHeight - y),
)}px at ${x}px ${y}px)`,
]
await document.startViewTransition(async () => {
isDark.value = !isDark.value
await nextTick()
}).ready
document.documentElement.animate(
{ clipPath: isDark.value ? clipPath.reverse() : clipPath },
{
duration: 300,
easing: 'ease-in',
pseudoElement: `::view-transition-${isDark.value ? 'old' : 'new'}(root)`,
},
)
})
</script>

<template>
<DefaultTheme.Layout />
</template>

<style>
::view-transition-old(root),
::view-transition-new(root) {
animation: none;
mix-blend-mode: normal;
}
::view-transition-old(root),
.dark::view-transition-new(root) {
z-index: 1;
}
::view-transition-new(root),
.dark::view-transition-old(root) {
z-index: 9999;
}
.VPSwitchAppearance {
width: 22px !important;
}
.VPSwitchAppearance .check {
transform: none !important;
}
</style>
5 changes: 5 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:root {
--vp-c-brand-1: #3a98a4;
--vp-c-brand-2: #54b1bc;
--vp-c-brand-3: #327a88;
}
8 changes: 8 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import DefaultTheme from 'vitepress/theme'
import Layout from './Layout.vue'
import './custom.css'

export default {
extends: DefaultTheme,
Layout,
}
Loading

0 comments on commit fbd4401

Please sign in to comment.