A WordPress plugin that syncs documentation from GitHub repositories into WordPress. Markdown files in your repo become structured, searchable documentation posts — with hierarchical project organization, a REST API, WP-CLI commands, and optional frontend templates.
GitHub repo (docs/*.md)
│
▼
DocSync sync engine
├── Fetches via GitHub API
├── Compares commit SHAs (incremental)
├── Converts GFM markdown → HTML
├── Resolves internal .md links → WP permalinks
└── Creates/updates documentation posts
│
▼
WordPress (documentation CPT)
├── REST API (docsync/v1)
├── WP-CLI (wp docsync)
├── WP Abilities API
└── Optional frontend templates
- GitHub sync — full and incremental sync via commit SHA comparison
- Markdown processing — GitHub Flavored Markdown with internal link resolution
- Hierarchical organization —
projectandproject_typetaxonomies with deep URL routing - REST API — full CRUD under
docsync/v1with markdown output for AI agents - WP-CLI —
wp docsync docs {list, get, search, sync}andwp docsync project {ensure, tree} - WP Abilities API — AI agent capabilities for sync, search, and project inspection
- Orphan cleanup — docs removed from the repo are automatically deleted
- Scheduled sync — configurable WP-Cron intervals (hourly / twice daily / daily)
- Admin UI — settings page with GitHub PAT configuration, connection diagnostics, per-project sync controls
- Theme-agnostic — works on any WordPress theme. Frontend templates are opt-in.
- WordPress 6.9+
- PHP 8.0+
- Upload the
docsyncdirectory towp-content/plugins/ - Activate the plugin
- Go to Documentation → Settings and enter your GitHub Personal Access Token
- Create a project term under Documentation → Projects, set its GitHub URL
- Sync: click "Sync" in the admin, use
wp docsync docs sync --all, or wait for cron
Generate a Personal Access Token with repo scope (for private repos) or no scope (for public repos only). Enter it at Documentation → Settings.
- Go to Documentation → Projects
- Create or edit a term
- Set GitHub URL (e.g.,
https://github.com/your-org/your-repo) - Set Docs Path (default:
docs) — the directory in the repo containing.mdfiles - Click Sync to pull docs
Configure at Documentation → Settings:
- Hourly — best for actively developed projects
- Twice Daily — good default
- Daily — for stable projects
DocSync works on any theme with zero configuration. The sync engine, REST API, CLI, and admin always work.
For themes that want the full documentation frontend (archives, search, breadcrumbs, related posts, TOC sidebar), opt in:
// In your theme's functions.php
add_theme_support( 'docsync-templates' );DocSync ships standalone CSS with --docsync-* custom properties and sensible light/dark mode defaults. Override in your theme:
:root {
--docsync-accent-strong: #your-brand-color;
--docsync-background-card: #your-card-bg;
}See assets/css/tokens.css for all available properties.
All endpoints use the docsync/v1 namespace.
| Method | Endpoint | Description |
|---|---|---|
GET |
/docs |
List docs (filters: project, status, search, per_page, page) |
POST |
/docs |
Create a doc |
GET |
/docs/{id} |
Get a doc (includes markdown field for AI agents) |
PUT |
/docs/{id} |
Update a doc |
DELETE |
/docs/{id} |
Delete a doc |
| Method | Endpoint | Description |
|---|---|---|
GET |
/project |
List project terms |
GET |
/project/tree |
Hierarchical project tree |
POST |
/project/resolve |
Find or create a taxonomy path |
GET |
/project/{id} |
Get a project term |
PUT |
/project/{id} |
Update a project term |
| Method | Endpoint | Description |
|---|---|---|
POST |
/sync/all |
Sync all projects |
POST |
/sync/term/{id} |
Sync a single project |
POST |
/sync/doc |
Sync an individual document |
POST |
/sync/batch |
Batch sync documents |
GET |
/sync/status |
Sync status for a project |
GET |
/sync/test-token |
GitHub PAT diagnostics |
POST |
/sync/test-repo |
Test repo access |
curl https://example.com/wp-json/docsync/v1/docs/123The response includes a markdown field with the raw source — useful for AI agents and static site generators.
# List all docs
wp docsync docs list
# List docs for a project
wp docsync docs list --project=data-machine
# Get a doc as markdown
wp docsync docs get installation-guide
# Search docs
wp docsync docs search "webhook"
# Sync a single project
wp docsync docs sync 42
# Sync all projects
wp docsync docs sync --all
# Show project hierarchy
wp docsync project tree
# Ensure a project term exists
wp docsync project ensure --type=wordpress-plugins --project=my-plugin --name="My Plugin"For AI agent integration via WP Abilities:
| Ability | Description |
|---|---|
docsync/sync-docs |
Sync a single project from GitHub |
docsync/sync-docs-batch |
Sync multiple projects |
docsync/get-doc |
Fetch a doc (returns markdown) |
docsync/search-docs |
Full-text search |
docsync/get-projects |
Get project hierarchy with metadata |
docsync/get-project-types |
Get project type classifications |
docsync/reset-documentation |
Delete all docs and reset sync state |
/docs/ → Documentation archive
/docs/{project-type}/ → Project type archive
/docs/{project-type}/{project}/ → Project docs
/docs/{project-type}/{project}/{sub}/ → Sub-section
/docs/{project-type}/{project}/{sub}/{doc}/ → Single doc
# Install dependencies
composer install
# Regenerate autoloader
composer dump-autoload --optimize
# Build production ZIP
./build.shdocsync/
├── docsync.php # Main plugin file
├── inc/
│ ├── PluginConfig.php # Central config (all identifiers derive from here)
│ ├── Api/ # REST API (docsync/v1)
│ ├── Abilities/ # WP Abilities API (docsync/*)
│ ├── Core/ # CPT, taxonomy, routing, assets
│ ├── Sync/ # GitHub sync engine
│ ├── Fields/ # Term meta fields
│ ├── Templates/ # Frontend (opt-in via theme support)
│ ├── Admin/ # Settings, admin columns
│ └── WPCLI/ # CLI commands
└── assets/
├── css/ # tokens.css, archives.css, toc.css, related-posts.css
└── js/ # admin-sync.js, docs-search.js, docsync-toc.js
GPL v2 or later
Chris Huber — https://chubes.net