-
Notifications
You must be signed in to change notification settings - Fork 13
feat: migrate docs to vitepress #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
LucHeart
merged 4 commits into
develop
from
codex/change-documentation-to-use-vitepress
Aug 24, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
site | ||
/.vscode | ||
.cache | ||
.cache | ||
node_modules | ||
docs/.vitepress/dist | ||
docs/.vitepress/cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
FROM squidfunk/mkdocs-material:latest AS build | ||
FROM node:20 AS build | ||
|
||
WORKDIR /docs | ||
|
||
COPY requirements.txt requirements.txt | ||
|
||
RUN pip install -r requirements.txt | ||
COPY package.json package-lock.json ./ | ||
RUN npm ci | ||
|
||
COPY . . | ||
|
||
RUN mkdocs build | ||
RUN npm run docs:build | ||
|
||
FROM nginx:1-alpine AS runtime | ||
|
||
EXPOSE 80 | ||
|
||
# Copy release artifacts (static HTML, JS, CSS) | ||
COPY --from=build /docs/site /usr/share/nginx/html | ||
COPY --from=build /docs/docs/.vitepress/dist /usr/share/nginx/html | ||
|
||
# Leave startup as-is. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,321 @@ | ||
import { defineConfig } from 'vitepress' | ||
import { execSync } from 'node:child_process' | ||
import { existsSync } from 'node:fs' | ||
import path from 'node:path' | ||
|
||
export default defineConfig({ | ||
title: 'OpenShock Wiki', | ||
description: 'Documentation for OpenShock', | ||
lastUpdated: true, | ||
themeConfig: { | ||
search: { provider: 'local' }, | ||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/OpenShock/Wiki' }, | ||
], | ||
editLink: { | ||
pattern: 'https://github.com/OpenShock/Wiki/edit/main/docs/:path', | ||
text: 'Edit this page on GitHub', | ||
}, | ||
nav: [ | ||
{ | ||
text: 'Home', | ||
items: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: 'FAQ', link: '/home/faq' }, | ||
{ text: 'Safety', link: '/home/safety-rules' }, | ||
], | ||
}, | ||
{ | ||
text: 'Guides', | ||
items: [ | ||
{ text: 'Quickstart', link: '/quickstart/what-you-need' }, | ||
{ | ||
text: 'OpenShock', | ||
items: [ | ||
{ text: 'How to flash your board', link: '/guides/openshock-how-to-flash-your-board' }, | ||
{ text: 'First setup', link: '/guides/openshock-first-setup' }, | ||
{ text: 'How to update', link: '/guides/openshock-how-to-update' }, | ||
{ text: 'Sharelinks', link: '/guides/openshock-sharelinks' }, | ||
{ text: 'Sharecodes', link: '/guides/openshock-sharecodes' }, | ||
{ text: 'Offline remote setup', link: '/guides/openshock-offline-remote-setup' }, | ||
], | ||
}, | ||
{ | ||
text: 'ShockOsc', | ||
items: [ | ||
{ text: 'Basic', link: '/guides/shockosc-basic' }, | ||
{ text: 'Avatar setup VRC', link: '/guides/shockosc-avatar-setup-vrc' }, | ||
{ text: 'Avatar setup CVR', link: '/guides/shockosc-avatar-setup-cvr' }, | ||
{ text: 'Parameters', link: '/guides/shockosc-parameters' }, | ||
], | ||
}, | ||
{ text: 'Self Hosting', link: '/guides/selfhosting/' }, | ||
], | ||
}, | ||
{ | ||
text: 'Do It Yourself', | ||
items: [ | ||
{ text: 'Overview', link: '/diy/' }, | ||
{ text: 'Hardware', link: '/diy/hardware-buying' }, | ||
{ text: 'Assembling', link: '/diy/assembling' }, | ||
], | ||
}, | ||
{ | ||
text: 'Developer', | ||
items: [ | ||
{ text: 'Overview', link: '/dev/' }, | ||
{ | ||
text: 'Contributing', | ||
items: [ | ||
{ text: 'Overview', link: '/dev/contributing/' }, | ||
{ text: 'Compile firmware', link: '/dev/contributing/compile-firmware' }, | ||
{ text: 'Backend', link: '/dev/contributing/backend' }, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
text: 'Hardware', | ||
items: [ | ||
{ | ||
text: 'Shockers', | ||
items: [ | ||
{ text: 'Overview', link: '/hardware/shockers/' }, | ||
{ text: 'Caixianlin', link: '/hardware/shockers/caixianlin' }, | ||
{ text: 'Petrainer', link: '/hardware/shockers/petrainer' }, | ||
], | ||
}, | ||
{ | ||
text: 'Remotes', | ||
items: [ | ||
{ text: 'Identifying', link: '/hardware/remotes/identifying' }, | ||
], | ||
}, | ||
{ | ||
text: 'Boards', | ||
items: [ | ||
{ text: 'Overview', link: '/hardware/boards/' }, | ||
{ text: 'OpenShock Core v1', link: '/hardware/boards/openshock/core-v1' }, | ||
{ text: 'OpenShock Core v2', link: '/hardware/boards/openshock/core-v2' }, | ||
{ text: 'PiShock 2023', link: '/hardware/boards/pishock/2023-pishock' }, | ||
{ text: 'PiShock Lite 2021Q3', link: '/hardware/boards/pishock/2021q3-lite' }, | ||
{ text: 'PiShock Plus 2021Q1', link: '/hardware/boards/pishock/2021q1-plus' }, | ||
{ text: 'Seeed XIAO ESP32S3', link: '/hardware/boards/seeed/xiao-esp32s3' }, | ||
{ text: 'Wemos D1 mini ESP32', link: '/hardware/boards/wemos/d1-mini-esp32' }, | ||
{ text: 'Wemos Lolin S2 mini', link: '/hardware/boards/wemos/lolin-s2-mini' }, | ||
{ text: 'Wemos Lolin S3', link: '/hardware/boards/wemos/lolin-s3' }, | ||
{ text: 'DFRobot Firebeetle', link: '/hardware/boards/dfr-firebeetle/dfr-firebeetle' }, | ||
{ text: 'ESP32-S3 DORx', link: '/hardware/boards/china/esp32s3-dorx' }, | ||
], | ||
}, | ||
{ | ||
text: 'Transmitter', | ||
items: [ | ||
{ text: 'Overview', link: '/hardware/transmitter/' }, | ||
{ text: 'Open Smart', link: '/hardware/transmitter/china/open-smart' }, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
text: 'Vendors', | ||
items: [ | ||
{ | ||
text: 'Hardware', | ||
items: [ | ||
{ text: 'Overview', link: '/vendors/hardware/' }, | ||
{ text: '0x6f78', link: '/vendors/hardware/0x6f78' }, | ||
{ text: 'Bosjesman', link: '/vendors/hardware/bosjesman' }, | ||
{ text: 'Luc', link: '/vendors/hardware/luc' }, | ||
{ text: 'NamelessNanashi', link: '/vendors/hardware/namelessnanashi' }, | ||
{ text: 'Nerex', link: '/vendors/hardware/nerex' }, | ||
{ text: 'Nullstalgia', link: '/vendors/hardware/nullstalgia' }, | ||
{ text: 'SillyPupKit', link: '/vendors/hardware/sillypupkit' }, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
text: 'Troubleshooting', | ||
items: [ | ||
{ text: 'Hub', link: '/troubleshooting/hub' }, | ||
{ text: 'ShockOsc', link: '/troubleshooting/shockosc' }, | ||
{ text: 'Shocker pairing', link: '/troubleshooting/shocker-pairing' }, | ||
], | ||
}, | ||
{ | ||
text: 'Legal and Privacy', | ||
items: [ | ||
{ text: 'Terms and Conditions', link: '/legal/terms-and-conditions' }, | ||
{ text: 'Code of Conduct', link: '/legal/code-of-conduct' }, | ||
{ text: 'License', link: '/legal/license' }, | ||
], | ||
}, | ||
], | ||
sidebar: { | ||
'/': [ | ||
{ | ||
text: 'Home', | ||
items: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: 'FAQ', link: '/home/faq' }, | ||
{ text: 'Safety', link: '/home/safety-rules' }, | ||
], | ||
}, | ||
], | ||
'/quickstart/': [ | ||
{ | ||
text: 'Quickstart', | ||
items: [ | ||
{ text: 'What you need', link: '/quickstart/what-you-need' }, | ||
], | ||
}, | ||
], | ||
'/guides/': [ | ||
{ | ||
text: 'OpenShock', | ||
items: [ | ||
{ text: 'How to flash your board', link: '/guides/openshock-how-to-flash-your-board' }, | ||
{ text: 'First setup', link: '/guides/openshock-first-setup' }, | ||
{ text: 'How to update', link: '/guides/openshock-how-to-update' }, | ||
{ text: 'Sharelinks', link: '/guides/openshock-sharelinks' }, | ||
{ text: 'Sharecodes', link: '/guides/openshock-sharecodes' }, | ||
{ text: 'Offline remote setup', link: '/guides/openshock-offline-remote-setup' }, | ||
], | ||
}, | ||
{ | ||
text: 'ShockOsc', | ||
items: [ | ||
{ text: 'Basic', link: '/guides/shockosc-basic' }, | ||
{ text: 'Avatar setup VRC', link: '/guides/shockosc-avatar-setup-vrc' }, | ||
{ text: 'Avatar setup CVR', link: '/guides/shockosc-avatar-setup-cvr' }, | ||
{ text: 'Parameters', link: '/guides/shockosc-parameters' }, | ||
], | ||
}, | ||
{ | ||
text: 'Self Hosting', | ||
items: [ | ||
{ text: 'Overview', link: '/guides/selfhosting/' }, | ||
], | ||
}, | ||
], | ||
'/diy/': [ | ||
{ | ||
text: 'Do It Yourself', | ||
items: [ | ||
{ text: 'Overview', link: '/diy/' }, | ||
{ text: 'Hardware', link: '/diy/hardware-buying' }, | ||
{ text: 'Assembling', link: '/diy/assembling' }, | ||
], | ||
}, | ||
], | ||
'/dev/': [ | ||
{ | ||
text: 'Developer', | ||
items: [ | ||
{ text: 'Overview', link: '/dev/' }, | ||
{ text: 'Contributing', link: '/dev/contributing/' }, | ||
{ text: 'Compile firmware', link: '/dev/contributing/compile-firmware' }, | ||
{ text: 'Backend', link: '/dev/contributing/backend' }, | ||
], | ||
}, | ||
], | ||
'/hardware/': [ | ||
{ | ||
text: 'Shockers', | ||
items: [ | ||
{ text: 'Overview', link: '/hardware/shockers/' }, | ||
{ text: 'Caixianlin', link: '/hardware/shockers/caixianlin' }, | ||
{ text: 'Petrainer', link: '/hardware/shockers/petrainer' }, | ||
], | ||
}, | ||
{ | ||
text: 'Remotes', | ||
items: [ | ||
{ text: 'Identifying', link: '/hardware/remotes/identifying' }, | ||
], | ||
}, | ||
{ | ||
text: 'Boards', | ||
items: [ | ||
{ text: 'Overview', link: '/hardware/boards/' }, | ||
{ text: 'OpenShock Core v1', link: '/hardware/boards/openshock/core-v1' }, | ||
{ text: 'OpenShock Core v2', link: '/hardware/boards/openshock/core-v2' }, | ||
{ text: 'PiShock 2023', link: '/hardware/boards/pishock/2023-pishock' }, | ||
{ text: 'PiShock Lite 2021Q3', link: '/hardware/boards/pishock/2021q3-lite' }, | ||
{ text: 'PiShock Plus 2021Q1', link: '/hardware/boards/pishock/2021q1-plus' }, | ||
{ text: 'Seeed XIAO ESP32S3', link: '/hardware/boards/seeed/xiao-esp32s3' }, | ||
{ text: 'Wemos D1 mini ESP32', link: '/hardware/boards/wemos/d1-mini-esp32' }, | ||
{ text: 'Wemos Lolin S2 mini', link: '/hardware/boards/wemos/lolin-s2-mini' }, | ||
{ text: 'Wemos Lolin S3', link: '/hardware/boards/wemos/lolin-s3' }, | ||
{ text: 'DFRobot Firebeetle', link: '/hardware/boards/dfr-firebeetle/dfr-firebeetle' }, | ||
{ text: 'ESP32-S3 DORx', link: '/hardware/boards/china/esp32s3-dorx' }, | ||
], | ||
}, | ||
{ | ||
text: 'Transmitter', | ||
items: [ | ||
{ text: 'Overview', link: '/hardware/transmitter/' }, | ||
{ text: 'Open Smart', link: '/hardware/transmitter/china/open-smart' }, | ||
], | ||
}, | ||
], | ||
'/vendors/': [ | ||
{ | ||
text: 'Hardware', | ||
items: [ | ||
{ text: 'Overview', link: '/vendors/hardware/' }, | ||
{ text: '0x6f78', link: '/vendors/hardware/0x6f78' }, | ||
{ text: 'Bosjesman', link: '/vendors/hardware/bosjesman' }, | ||
{ text: 'Luc', link: '/vendors/hardware/luc' }, | ||
{ text: 'NamelessNanashi', link: '/vendors/hardware/namelessnanashi' }, | ||
{ text: 'Nerex', link: '/vendors/hardware/nerex' }, | ||
{ text: 'Nullstalgia', link: '/vendors/hardware/nullstalgia' }, | ||
{ text: 'SillyPupKit', link: '/vendors/hardware/sillypupkit' }, | ||
], | ||
}, | ||
], | ||
'/troubleshooting/': [ | ||
{ | ||
text: 'Troubleshooting', | ||
items: [ | ||
{ text: 'Hub', link: '/troubleshooting/hub' }, | ||
{ text: 'ShockOsc', link: '/troubleshooting/shockosc' }, | ||
{ text: 'Shocker pairing', link: '/troubleshooting/shocker-pairing' }, | ||
], | ||
}, | ||
], | ||
'/legal/': [ | ||
{ | ||
text: 'Legal and Privacy', | ||
items: [ | ||
{ text: 'Terms and Conditions', link: '/legal/terms-and-conditions' }, | ||
{ text: 'Code of Conduct', link: '/legal/code-of-conduct' }, | ||
{ text: 'License', link: '/legal/license' }, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
async transformHtml(code, _id, ctx) { | ||
const file = path.join(process.cwd(), 'docs', ctx.pageData.relativePath) | ||
if (existsSync(file)) { | ||
try { | ||
const out = execSync(`git --no-pager shortlog -sne HEAD -- "${file}"`, { encoding: 'utf-8' }) | ||
const contributors = out | ||
.split('\n') | ||
.filter(Boolean) | ||
.map((line) => line.replace(/^\s*\d+\s+/, '').replace(/\s+<.*>/, '')) | ||
if (contributors.length) { | ||
const escape = (s: string) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') | ||
const items = contributors.map((name) => `<li>${escape(name)}</li>`).join('') | ||
return code.replace('</div></div></main>', `<div class="contributors"><h2>Contributors</h2><ul>${items}</ul></div></div></div></main>`) | ||
} | ||
} catch { | ||
// ignore git errors | ||
} | ||
} | ||
return code | ||
}, | ||
}) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VitePress configuration is extremely minimal and lacks essential settings that were present in the MkDocs setup. Consider adding base URL, navigation structure, theme configuration, and other settings to maintain feature parity with the previous setup.
Copilot uses AI. Check for mistakes.