diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css index ac80f66..0bd0c22 100644 --- a/docs/.vitepress/theme/style.css +++ b/docs/.vitepress/theme/style.css @@ -160,3 +160,31 @@ code { img { border-radius: 8px; } + +.vp-doc [class*="language-"] > span.lang { + display: none; +} + +:root { + --vp-font-family-mono: mono, ui-monospace, "Menlo", "Monaco", "Consolas", + "Liberation Mono", "Courier New", monospace !important; +} + +@font-face { + font-family: mono; + src: url("/mono-normal.woff2"); +} + +@font-face { + font-family: mono; + font-style: italic; + src: url("/mono-italic.woff2"); +} + +.vp-code-group .tabs label { + line-height: 42px; +} + +.vp-code-group .tabs { + padding: 0 8px; +} diff --git a/docs/guide/index.md b/docs/guide/index.md index b45eb9b..5e9e382 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -35,10 +35,7 @@ We're using the latest version of the library here for simplicity, but you shoul Next, add the `` component to your HTML. ```html - + ``` ::: info @@ -91,7 +88,7 @@ Now, you'll need to change your server code to add the routes that Cap needs to ::: code-group -```js [Elysia] +```js [elysia] import { Elysia } from "elysia"; import Cap from "@cap.js/server"; @@ -119,7 +116,7 @@ new Elysia() console.log(`🦊 Elysia is running at http://localhost:3000`); ``` -```js [Fastify] +```js [fastify] import Fastify from "fastify"; import Cap from "@cap.js/server"; @@ -146,7 +143,7 @@ fastify.listen({ port: 3000, host: "0.0.0.0" }).then(() => { }); ``` -```js [Bun.serve] +```js [bun.serve] import Cap from "@cap.js/server"; const cap = new Cap({ @@ -179,7 +176,7 @@ Bun.serve({ console.log(`Server running at http://localhost:3000`); ``` -```js [Express] +```js [express] import express from "express"; import Cap from "@cap.js/server"; @@ -221,4 +218,4 @@ Note that the token will immediately be deleted after this. To prevent this, use ## LLMs -You can use this documentation's [llms.txt](/llms.txt) or [llms-full.txt](/llms-full.txt) (~8k tokens) to give to LLMs. \ No newline at end of file +You can use this documentation's [llms.txt](/llms.txt) or [llms-full.txt](/llms-full.txt) (~8k tokens) to give to LLMs. diff --git a/docs/guide/widget.md b/docs/guide/widget.md index f042aca..91ad6cb 100644 --- a/docs/guide/widget.md +++ b/docs/guide/widget.md @@ -17,6 +17,8 @@ ```html [standalone server] + + ``` ::: @@ -28,13 +30,11 @@ We're using the latest version of the library here for simplicity, but you shoul You can now use the `` component in your HTML. ```html - + ``` -> [!NOTE] You'll need to start a server with the Cap API running at the same URL as specified in the `data-cap-api-endpoint` attribute. In the server-side example we provided, it's set to `/api`, but you can change this by replacing every `app.post('/api/...', ...)` to `app.post('/your endpoint/...', ...)`. +> [!NOTE]. +> You'll need to start a server with an API exposing the Cap methods running at the same URL as specified in the `data-cap-api-endpoint` attribute. > [!TIP] The following attributes are supported: > @@ -71,7 +71,7 @@ You can change the text on each label of the widget by setting the `data-cap-i18 ```html