Skip to content

Commit

Permalink
docs: add vitepress for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
anbraten committed Nov 29, 2024
1 parent ff2e7ab commit 1f70a17
Show file tree
Hide file tree
Showing 10 changed files with 1,910 additions and 214 deletions.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vitepress/cache/
41 changes: 41 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "TSky",
description: "A BlueSky API client for nimble apps and tools",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Examples', link: '/examples' }
],

sidebar: [
{ text: 'Getting Started', link: '/getting-started' },
{ text: 'API Reference', link: '/api',
items: [
{ text: 'new Tsky', link: '/api#tsky' },
{ text: 'tsky.profile', link: '/api#profile' },
{ text: 'tsky.typeahead', link: '/api#typeahead' }
],
},
{
text: 'Examples',
link: '/examples',
}
],

search: {
provider: 'local'
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
],

editLink: {
pattern: 'https://github.com/tsky-dev/tsky/edit/main/docs/:path',
}
}
})
28 changes: 28 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
outline: deep
---

# API Reference

## Tsky

### `new Tsky(app: AppBskyNS): Tsky`

Create a new Tsky instance.

```ts
import { Tsky } from 'tsky'

const app = new AppBskyNS(); // TODO
const tsky = new Tsky(app);
```

### `tsky.profile(did: string): Promise<Profile>`

Get a profile by DID.

```ts
const profile = await tsky.profile('did:plc:giohuovwawlijq7jkuysq5dd');

console.log(profile.handle);
```
7 changes: 7 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
outline: deep
---

# Examples

TODO: Add examples here
25 changes: 25 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
outline: deep
---

# Getting Started

## Installation

```bash
$ npm add tsky
```

## Usage

```ts
import { Tsky } from 'tsky'


const app = new AppBskyNS(); // TODO
const tsky = new Tsky(app);

const profile = await tsky.profile('did:plc:giohuovwawlijq7jkuysq5dd');

console.log(profile.handle);
```
31 changes: 31 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: "TSky"
text: "A BlueSky API client for nimble apps and tools"
tagline: A BlueSky API client for nimble apps and tools
actions:
- theme: brand
text: Get Started
link: /getting-started
- theme: alt
text: API reference
link: /api
- theme: alt
text: Examples
link: /examples

features:
- title: Lightweight
icon: 🌬️
details: Heavy objects will fall through the sky
- title: Endless possibilities
icon: 🌌
details: The sky has no limit
- title: Easy to use
icon: ☁️
details: Like a walk on the clouds
---

11 changes: 11 additions & 0 deletions docs/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build]
publish = "dist"
command = "pnpm build"
base = "/docs/"

# Allow previewing docs
[[redirects]]
from = "/docs/*"
to = "/:splat"
status = 200
force = true
15 changes: 15 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "tsky-docs",
"version": "1.0.0",
"private": true,
"main": "index.js",
"scripts": {
"dev": "vitepress dev",
"build": "vitepress build",
"preview": "vitepress preview",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"vitepress": "^1.5.0"
}
}
Loading

0 comments on commit 1f70a17

Please sign in to comment.