docs: improve website theming
parent
1eb22b9768
commit
40460885b0
|
|
@ -18,7 +18,13 @@ use crate::fatal;
|
|||
|
||||
#[derive(OpenApi)]
|
||||
#[openapi(
|
||||
info(title="Tabby Server", description = "OpenAPI documentation for [tabby](https://github.com/TabbyML/tabby), a self-hosted AI coding assistant. ", license(name = "Apache 2.0", url="https://github.com/TabbyML/tabby/blob/main/LICENSE")),
|
||||
info(title="Tabby Server",
|
||||
description = "
|
||||
[](https://github.com/TabbyML/tabby)
|
||||
|
||||
OpenAPI documentation for [tabby](https://github.com/TabbyML/tabby), a self-hosted AI coding assistant.",
|
||||
license(name = "Apache 2.0", url="https://github.com/TabbyML/tabby/blob/main/LICENSE")
|
||||
),
|
||||
servers(
|
||||
(url = "https://app.tabbyml.com/api/workspace/tabbyml/tabby", description = "Local server"),
|
||||
(url = "http://localhost:8080", description = "Local server"),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// @ts-check
|
||||
// Note: type annotations allow type checking and IDEs autocompletion
|
||||
|
||||
const lightCodeTheme = require('prism-react-renderer/themes/github');
|
||||
const lightCodeTheme = require('prism-react-renderer/themes/palenight');
|
||||
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
|
||||
|
||||
/** @type {import('@docusaurus/types').Config} */
|
||||
|
|
@ -140,6 +140,11 @@ const config = {
|
|||
theme: lightCodeTheme,
|
||||
darkTheme: darkCodeTheme,
|
||||
},
|
||||
colorMode: {
|
||||
defaultMode: "light",
|
||||
respectPrefersColorScheme: false,
|
||||
disableSwitch: true
|
||||
}
|
||||
}),
|
||||
|
||||
plugins: [
|
||||
|
|
|
|||
|
|
@ -10,33 +10,31 @@
|
|||
|
||||
/* You can override the default Infima variables here. */
|
||||
:root {
|
||||
--ifm-color-primary: #2e8555;
|
||||
--ifm-color-primary-dark: #29784c;
|
||||
--ifm-color-primary-darker: #277148;
|
||||
--ifm-color-primary-darkest: #205d3b;
|
||||
--ifm-color-primary-light: #33925d;
|
||||
--ifm-color-primary-lighter: #359962;
|
||||
--ifm-color-primary-lightest: #3cad6e;
|
||||
--ifm-code-font-size: 95%;
|
||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
|
||||
--ifm-color-primary: #3b373c;
|
||||
--ifm-color-primary-dark: #353236;
|
||||
--ifm-color-primary-darker: #322f33;
|
||||
--ifm-color-primary-darkest: #29272a;
|
||||
--ifm-color-primary-light: #413d42;
|
||||
--ifm-color-primary-lighter: #443f45;
|
||||
--ifm-color-primary-lightest: #4d484e;
|
||||
|
||||
--ifm-background-color: #e9e1d4;
|
||||
--ifm-background-surface-color: var(--ifm-background-color);
|
||||
|
||||
--ifm-code-background: #FFF8EC;
|
||||
--openapi-monaco-background-color-light: #FFF8EC !important;
|
||||
--openapi-card-background-color: var(--ifm-code-background) !important;
|
||||
}
|
||||
|
||||
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
||||
[data-theme='dark'] {
|
||||
--ifm-color-primary: #25c2a0;
|
||||
--ifm-color-primary-dark: #21af90;
|
||||
--ifm-color-primary-darker: #1fa588;
|
||||
--ifm-color-primary-darkest: #1a8870;
|
||||
--ifm-color-primary-light: #29d5b0;
|
||||
--ifm-color-primary-lighter: #32d8b4;
|
||||
--ifm-color-primary-lightest: #4fddbf;
|
||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
|
||||
.monaco-editor{
|
||||
background-color: var(--openapi-monaco-background-color-light) !important;
|
||||
}
|
||||
|
||||
.post a {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
|
||||
.post a::after {
|
||||
content: "post";
|
||||
margin-left: auto;
|
||||
|
|
@ -55,8 +53,3 @@
|
|||
height: 10px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
[data-theme='dark'] .post a::after {
|
||||
color: var(--ifm-color-warning);
|
||||
background: none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1,189 @@
|
|||
{"openapi":"3.0.3","info":{"title":"Tabby Server","description":"OpenAPI documentation for [tabby](https://github.com/TabbyML/tabby), a self-hosted AI coding assistant. ","license":{"name":"Apache 2.0","url":"https://github.com/TabbyML/tabby/blob/main/LICENSE"},"version":"0.1.0"},"servers":[{"url":"https://app.tabbyml.com/api/workspace/tabbyml/tabby","description":"Local server"},{"url":"http://localhost:8080","description":"Local server"}],"paths":{"/v1/completions":{"post":{"tags":["v1"],"operationId":"completion","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionResponse"}}}},"400":{"description":"Bad Request"}}}},"/v1/events":{"post":{"tags":["v1"],"operationId":"event","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogEventRequest"}}},"required":true},"responses":{"200":{"description":"Success"},"400":{"description":"Bad Request"}}}}},"components":{"schemas":{"Choice":{"type":"object","required":["index","text"],"properties":{"index":{"type":"integer","format":"int32","minimum":0.0},"text":{"type":"string"}}},"CompletionRequest":{"type":"object","properties":{"prompt":{"type":"string","deprecated":true,"example":"def fib(n):","nullable":true},"language":{"type":"string","description":"Language identifier, full list is maintained at\nhttps://code.visualstudio.com/docs/languages/identifiers","example":"python","nullable":true},"segments":{"allOf":[{"$ref":"#/components/schemas/Segments"}],"nullable":true}}},"CompletionResponse":{"type":"object","required":["id","choices"],"properties":{"id":{"type":"string"},"choices":{"type":"array","items":{"$ref":"#/components/schemas/Choice"}}}},"LogEventRequest":{"type":"object","required":["type","completion_id","choice_index"],"properties":{"type":{"type":"string","description":"Event type, should be `view` or `select`.","example":"view"},"completion_id":{"type":"string"},"choice_index":{"type":"integer","format":"int32","minimum":0.0}}},"Segments":{"type":"object","required":["prefix"],"properties":{"prefix":{"type":"string","description":"Content that appears before the cursor in the editor window.","example":"def fib(n):\n "},"suffix":{"type":"string","description":"Content that appears after the cursor in the editor window.","example":"\n return fib(n - 1) + fib(n - 2)","nullable":true}}}}}}
|
||||
{
|
||||
"openapi": "3.0.3",
|
||||
"info": {
|
||||
"title": "Tabby Server",
|
||||
"description": "\n[](https://github.com/TabbyML/tabby)\n\nOpenAPI documentation for [tabby](https://github.com/TabbyML/tabby), a self-hosted AI coding assistant.",
|
||||
"license": {
|
||||
"name": "Apache 2.0",
|
||||
"url": "https://github.com/TabbyML/tabby/blob/main/LICENSE"
|
||||
},
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https://app.tabbyml.com/api/workspace/tabbyml/tabby",
|
||||
"description": "Local server"
|
||||
},
|
||||
{
|
||||
"url": "http://localhost:8080",
|
||||
"description": "Local server"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/v1/completions": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"v1"
|
||||
],
|
||||
"operationId": "completion",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/CompletionRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/CompletionResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/events": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"v1"
|
||||
],
|
||||
"operationId": "event",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/LogEventRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success"
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"Choice": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"index",
|
||||
"text"
|
||||
],
|
||||
"properties": {
|
||||
"index": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"minimum": 0
|
||||
},
|
||||
"text": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"CompletionRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"prompt": {
|
||||
"type": "string",
|
||||
"deprecated": true,
|
||||
"example": "def fib(n):",
|
||||
"nullable": true
|
||||
},
|
||||
"language": {
|
||||
"type": "string",
|
||||
"description": "Language identifier, full list is maintained at\nhttps://code.visualstudio.com/docs/languages/identifiers",
|
||||
"example": "python",
|
||||
"nullable": true
|
||||
},
|
||||
"segments": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Segments"
|
||||
}
|
||||
],
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"CompletionResponse": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"choices"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"choices": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Choice"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"LogEventRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type",
|
||||
"completion_id",
|
||||
"choice_index"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Event type, should be `view` or `select`.",
|
||||
"example": "view"
|
||||
},
|
||||
"completion_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"choice_index": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"minimum": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"Segments": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"prefix"
|
||||
],
|
||||
"properties": {
|
||||
"prefix": {
|
||||
"type": "string",
|
||||
"description": "Content that appears before the cursor in the editor window.",
|
||||
"example": "def fib(n):\n "
|
||||
},
|
||||
"suffix": {
|
||||
"type": "string",
|
||||
"description": "Content that appears after the cursor in the editor window.",
|
||||
"example": "\n return fib(n - 1) + fib(n - 2)",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue