docs: add dedicated docs website

This commit is contained in:
Johann Schopplich
2025-11-18 07:23:10 +01:00
parent 3e08f3b72b
commit 4b4f7c05f9
38 changed files with 4399 additions and 541 deletions

134
docs/.vitepress/config.ts Normal file
View File

@@ -0,0 +1,134 @@
import type { DefaultTheme } from 'vitepress'
import UnoCSS from 'unocss/vite'
import { defineConfig } from 'vitepress'
import { description, github, name, ogImage, ogUrl, releases, twitterImage, version } from './meta'
export default defineConfig({
title: name,
description,
head: [
['link', { rel: 'icon', href: '/favicon.svg', type: 'image/svg+xml' }],
['meta', { name: 'author', content: 'Johann Schopplich' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:url', content: ogUrl }],
['meta', { property: 'og:title', content: name }],
['meta', { property: 'og:description', content: description }],
['meta', { property: 'og:image', content: ogImage }],
['meta', { name: 'twitter:title', content: name }],
['meta', { name: 'twitter:description', content: description }],
['meta', { name: 'twitter:image', content: twitterImage }],
['meta', { name: 'twitter:site', content: '@jschopplich' }],
['meta', { name: 'twitter:creator', content: '@jschopplich' }],
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
],
vite: {
// @ts-expect-error UnoCSS types are not compatible with Vite yet
plugins: [UnoCSS()],
},
themeConfig: {
logo: {
dark: '/logo-nav-dark.svg',
light: '/logo-nav-light.svg',
},
nav: [
{
text: 'Guide',
activeMatch: '^/guide/',
items: [
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Format Overview', link: '/guide/format-overview' },
{ text: 'Using TOON with LLMs', link: '/guide/llm-prompts' },
{ text: 'Benchmarks', link: '/guide/benchmarks' },
],
},
{
text: 'CLI',
link: '/cli/',
},
{
text: 'Reference',
activeMatch: '^/reference/',
items: [
{ text: 'API', link: '/reference/api' },
{ text: 'Syntax Cheatsheet', link: '/reference/syntax-cheatsheet' },
{ text: 'Specification', link: '/reference/spec' },
],
},
{
text: 'Ecosystem',
activeMatch: '^/ecosystem/',
items: [
{ text: 'Tools & Playgrounds', link: '/ecosystem/tools-and-playgrounds' },
{ text: 'Implementations', link: '/ecosystem/implementations' },
],
},
{
text: `v${version}`,
items: [
{
text: 'Release Notes',
link: releases,
},
],
},
],
sidebar: {
'/guide/': sidebarPrimary(),
'/cli/': sidebarPrimary(),
'/reference/': sidebarPrimary(),
'/ecosystem/': sidebarPrimary(),
},
socialLinks: [
{ icon: 'github', link: github },
],
footer: {
message: 'Released under the <a href="https://opensource.org/licenses/MIT" target="_blank">MIT License</a>.',
copyright: 'Copyright © 2025-PRESENT <a href="https://github.com/johannschopplich" target="_blank">Johann Schopplich</a>',
},
search: {
provider: 'local',
},
},
})
function sidebarPrimary(): DefaultTheme.SidebarItem[] {
return [
{
text: 'Guide',
items: [
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Format Overview', link: '/guide/format-overview' },
{ text: 'Using TOON with LLMs', link: '/guide/llm-prompts' },
{ text: 'Benchmarks', link: '/guide/benchmarks' },
],
},
{
text: 'Tooling',
items: [
{ text: 'CLI Reference', link: '/cli/' },
{ text: 'Tools & Playgrounds', link: '/ecosystem/tools-and-playgrounds' },
],
},
{
text: 'Ecosystem',
items: [
{ text: 'Implementations', link: '/ecosystem/implementations' },
],
},
{
text: 'Reference',
items: [
{ text: 'API (TypeScript)', link: '/reference/api' },
{ text: 'Syntax Cheatsheet', link: '/reference/syntax-cheatsheet' },
{ text: 'Specification', link: '/reference/spec' },
],
},
]
}