Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/mkdocs-dev.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/mkdocs-latest.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/vitepress-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: vitepress-dev
on:
push:
paths:
- 'docs/**'
- 'package.json'
- 'package-lock.json'
branches:
- main

jobs:
deploy:
name: Deploy dev docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build VitePress
run: npm run docs:build
env:
VITEPRESS_BASE: /dev/

- name: Deploy to gh-pages
run: |
git config user.name "GitHub Actions Bot"
git config user.email "actions-bot@github.com"

# Clone gh-pages branch
git clone --branch gh-pages --single-branch \
https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git gh-pages-deploy

# Remove old dev, preserve everything else
rm -rf gh-pages-deploy/dev

# Copy new build
cp -r docs/.vitepress/dist gh-pages-deploy/dev

# Update versions.json
cd gh-pages-deploy
node ../scripts/update-versions.js dev vitepress

# Commit and push
git add -A
git diff --staged --quiet || git commit -m "Deploy dev docs"
git push
72 changes: 72 additions & 0 deletions .github/workflows/vitepress-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: vitepress-release
on:
workflow_dispatch:
inputs:
version:
description: Version to deploy (e.g., v1.7.0)
required: true
push:
tags:
- 'v*'

jobs:
deploy:
name: Deploy release docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Determine version
id: version
run: |
if [ -n "${{ github.event.inputs.version }}" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi

- name: Install dependencies
run: npm ci

- name: Build VitePress
run: npm run docs:build
env:
VITEPRESS_BASE: /${{ steps.version.outputs.version }}/

- name: Deploy to gh-pages
run: |
VERSION=${{ steps.version.outputs.version }}
git config user.name "GitHub Actions Bot"
git config user.email "actions-bot@github.com"

# Clone gh-pages branch
git clone --branch gh-pages --single-branch \
https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git gh-pages-deploy

# Remove old version if exists, copy new version
rm -rf "gh-pages-deploy/$VERSION"
cp -r docs/.vitepress/dist "gh-pages-deploy/$VERSION"

# Update latest symlink (copy instead of symlink for GitHub Pages)
rm -rf gh-pages-deploy/latest
cp -r "gh-pages-deploy/$VERSION" gh-pages-deploy/latest

# Update versions.json
cd gh-pages-deploy
node ../scripts/update-versions.js "$VERSION" vitepress latest

# Commit and push
git add -A
git commit -m "Deploy $VERSION docs"
git push
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ dist/
.env
.envrc
.dev_config

# Node.js
node_modules/
package-lock.json

# VitePress build output
docs/.vitepress/dist/
docs/.vitepress/cache/
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tasks:
- name: Setup
init: |
pip install pre-commit mkdocs mkdocs-material && pre-commit install
pip install pre-commit && pre-commit install && npm install
command: |
make install generate
ports:
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Setting up a test environment involves the following steps:
* Install [pre-commit](https://pre-commit.com/)
* Run `pre-commit install`
* For working on the documentation:
* Install [mkdocs](https://www.mkdocs.org/)
* Install [mkdocs-material](https://github.com/squidfunk/mkdocs-material)
* Install [Node.js](https://nodejs.org/) (v18+)
* Run `npm install` in the project root

After this, you'll be able to test any change. Alternatively, you can open the project via Gitpod:

Expand All @@ -45,6 +45,8 @@ make test # Run all tests
make lint # Run the linter to detect any issues
make mocks # (Re-)generate the mock files
pre-commit run --all-files # Run all pre-commit hooks manually
npm run docs:dev # Start local documentation server
npm run docs:build # Build documentation for production
```

## Features and bugs
Expand Down
92 changes: 92 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import { defineConfig } from "vitepress";

export default defineConfig({
title: "SnipKit Documentation",
description:
"SnipKit helps you to execute scripts saved in your favorite snippets manager without even leaving the terminal.",

base: process.env.VITEPRESS_BASE || "/",

head: [["link", { rel: "icon", href: "/images/logo.png" }]],

themeConfig: {
logo: "/images/logo.png",

nav: [
{ text: "Home", link: "/" },
{ text: "Getting Started", link: "/getting-started/overview" },
{ text: "Configuration", link: "/configuration/overview" },
{ text: "Managers", link: "/managers/overview" },
{ text: "Assistant", link: "/assistant/" },
],

sidebar: {
"/getting-started/": [
{
text: "Getting Started",
items: [
{ text: "Overview", link: "/getting-started/overview" },
{ text: "Parameters", link: "/getting-started/parameters" },
{ text: "Power Setup", link: "/getting-started/power-setup" },
{ text: "Fzf", link: "/getting-started/fzf" },
],
},
],
"/configuration/": [
{
text: "Configuration",
items: [
{ text: "Overview", link: "/configuration/overview" },
{ text: "Themes", link: "/configuration/themes" },
],
},
],
"/managers/": [
{
text: "Managers",
items: [
{ text: "Overview", link: "/managers/overview" },
{ text: "File System Library", link: "/managers/fslibrary" },
{ text: "GitHub Gist", link: "/managers/githubgist" },
{ text: "SnippetsLab", link: "/managers/snippetslab" },
{ text: "Snip", link: "/managers/pictarinesnip" },
{ text: "Pet", link: "/managers/pet" },
],
},
],
"/assistant/": [
{
text: "Assistant",
items: [
{ text: "Overview", link: "/assistant/" },
{ text: "OpenAI", link: "/assistant/openai" },
{ text: "Anthropic", link: "/assistant/anthropic" },
{ text: "Gemini", link: "/assistant/gemini" },
{ text: "Ollama", link: "/assistant/ollama" },
{ text: "OpenAI-Compatible", link: "/assistant/openai-compatible" },
],
},
],
},

socialLinks: [
{ icon: "github", link: "https://github.com/lemoony/snipkit" },
],

footer: {
message: "Released under the Apache License 2.0.",
copyright: "Copyright © 2026 lemoony",
},

search: {
provider: "local",
},
},

markdown: {
theme: {
light: "catppuccin-latte",
dark: "catppuccin-mocha",
},
},
});
14 changes: 14 additions & 0 deletions docs/.vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script setup lang="ts">
import DefaultTheme from 'vitepress/theme'
import VersionSwitcher from './components/VersionSwitcher.vue'

const { Layout } = DefaultTheme
</script>

<template>
<Layout>
<template #nav-bar-content-after>
<VersionSwitcher />
</template>
</Layout>
</template>
Loading
Loading