Skip to content

Commit fbff7e0

Browse files
authored
docs: add comprehensive VitePress documentation site (#22)
1 parent 0a03dc7 commit fbff7e0

22 files changed

+7803
-4
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
3737

3838
# Finder (MacOS) folder config
3939
.DS_Store
40+
41+
# VitePress
42+
docs/.vitepress/dist
43+
docs/.vitepress/cache

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"editor.formatOnSave": true,
33
"editor.defaultFormatter": "esbenp.prettier-vscode",
44
"cSpell.words": [
5+
"bunx",
56
"konstantin",
67
"kriasoft",
78
"modelcontextprotocol",

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ bun test
413413
# Build
414414
bun run build
415415

416+
# Run documentation locally
417+
bun run docs:dev # Start VitePress dev server at http://localhost:5173
418+
416419
# Run examples
417420
bun run example:demo # Interactive demo
418421
bun run example:github # GitHub OAuth example

bun.lock

Lines changed: 610 additions & 1 deletion
Large diffs are not rendered by default.

docs/.vitepress/config.ts

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/* SPDX-FileCopyrightText: 2025-present Kriasoft */
2+
/* SPDX-License-Identifier: MIT */
3+
4+
import { withMermaid } from "vitepress-plugin-mermaid";
5+
6+
// https://vitepress.dev/reference/site-config
7+
export default withMermaid({
8+
base: "/oauth-callback/",
9+
title: "🔐 \u00A0OAuth Callback",
10+
description:
11+
"OAuth 2.0 callback handler for CLI tools & desktop apps. Cross-runtime (Node.js/Deno/Bun), MCP SDK integration, minimal deps, TypeScript-first.",
12+
themeConfig: {
13+
// https://vitepress.dev/reference/default-theme-config
14+
nav: [
15+
{ text: "Guide", link: "/getting-started" },
16+
{ text: "API", link: "/api/get-auth-code" },
17+
{ text: "Examples", link: "/examples/notion" },
18+
{
19+
text: "v1.2.0",
20+
items: [
21+
{
22+
text: "Release Notes",
23+
link: "https://github.com/kriasoft/oauth-callback/releases",
24+
},
25+
{
26+
text: "npm",
27+
link: "https://www.npmjs.com/package/oauth-callback",
28+
},
29+
],
30+
},
31+
],
32+
33+
sidebar: [
34+
{
35+
text: "Introduction",
36+
items: [
37+
{ text: "What is OAuth Callback?", link: "/what-is-oauth-callback" },
38+
{ text: "Getting Started", link: "/getting-started" },
39+
{ text: "Core Concepts", link: "/core-concepts" },
40+
],
41+
},
42+
{
43+
text: "API Reference",
44+
items: [
45+
{ text: "getAuthCode", link: "/api/get-auth-code" },
46+
{ text: "browserAuth", link: "/api/browser-auth" },
47+
{ text: "Storage Providers", link: "/api/storage-providers" },
48+
{ text: "OAuthError", link: "/api/oauth-error" },
49+
{ text: "TypeScript Types", link: "/api/types" },
50+
],
51+
},
52+
{
53+
text: "Examples",
54+
items: [
55+
{ text: "Notion MCP", link: "/examples/notion" },
56+
{ text: "Linear MCP", link: "/examples/linear" },
57+
],
58+
},
59+
],
60+
61+
search: {
62+
provider: "local",
63+
},
64+
65+
editLink: {
66+
pattern:
67+
"https://github.com/kriasoft/oauth-callback/edit/main/docs/:path",
68+
text: "Edit this page on GitHub",
69+
},
70+
71+
socialLinks: [
72+
{ icon: "github", link: "https://github.com/kriasoft/oauth-callback" },
73+
{ icon: "npm", link: "https://www.npmjs.com/package/oauth-callback" },
74+
{ icon: "discord", link: "https://discord.gg/bSsv7XM" },
75+
],
76+
77+
footer: {
78+
message: "Released under the MIT License.",
79+
copyright: "Copyright © 2025-present Konstantin Tarkus",
80+
},
81+
},
82+
});

docs/api-examples.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Runtime API Examples
6+
7+
This page demonstrates usage of some of the runtime APIs provided by VitePress.
8+
9+
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
10+
11+
```md
12+
<script setup>
13+
import { useData } from 'vitepress'
14+
15+
const { theme, page, frontmatter } = useData()
16+
</script>
17+
18+
## Results
19+
20+
### Theme Data
21+
22+
<pre>{{ theme }}</pre>
23+
24+
### Page Data
25+
26+
<pre>{{ page }}</pre>
27+
28+
### Page Frontmatter
29+
30+
<pre>{{ frontmatter }}</pre>
31+
```
32+
33+
<script setup>
34+
import { useData } from 'vitepress'
35+
36+
const { site, theme, page, frontmatter } = useData()
37+
</script>
38+
39+
## Results
40+
41+
### Theme Data
42+
43+
<pre>{{ theme }}</pre>
44+
45+
### Page Data
46+
47+
<pre>{{ page }}</pre>
48+
49+
### Page Frontmatter
50+
51+
<pre>{{ frontmatter }}</pre>
52+
53+
## More
54+
55+
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).

0 commit comments

Comments
 (0)