VitePress PR Helper
A VS Code extension that helps you edit VitePress documentation with live preview and seamless GitHub PR workflow.
Features
- Live VitePress Preview: Real-time preview with bidirectional scroll sync
- One-Click Sync: Sync with upstream repository with a single command
- Easy PR Creation: Create pull requests directly from VS Code using GitHub CLI
- Document Tree View: Browse and manage Markdown files in the sidebar
- Smart Navigation: Click links in preview to open corresponding source files
Requirements
- VitePress: Must be installed in your documentation repository
- GitHub CLI (
gh): Required for creating pull requests
Extension Settings
wikiPreviewPR.docsRoot: Documentation root directory (default: "docs")
wikiPreviewPR.upstreamRepo: Upstream GitHub repository (format: owner/repo)
wikiPreviewPR.upstreamBranch: Upstream branch to sync from (default: "main")
wikiPreviewPR.autoSaveBeforePreview: Auto-save files before refreshing preview (default: true)
wikiPreviewPR.followActiveMarkdown: Update preview when switching between Markdown files (default: true)
Usage
Opening Preview
- Open a Markdown file in your docs folder
- Click the preview icon in the editor toolbar
- Or use command:
VitePress: Open Preview
Syncing with Upstream
- Run command:
VitePress: Sync Upstream
- The extension will fetch and merge changes from the upstream repository
Creating a Pull Request
- Make your changes and save
- Run command:
VitePress: Create Pull Request
- Follow the prompts to commit (if needed) and create the PR
- The PR will open in your browser
Development
# Install dependencies
npm install
# Compile extension
npm run compile
# Watch for changes
npm run watch
# Package extension
npm run package
License
MIT
| |