Usage Guide
Documentation Post Type
The plugin provides a documentation custom post type for creating and managing documentation.
Features
- Gutenberg editor support
- Markdown processing
- Project taxonomy for organization
- REST API access
- Archive and single views
Creating Documentation
- In WordPress admin, go to Documentation > Add New
- Write your documentation content
- Assign to appropriate project taxonomy terms
- Publish
Project Taxonomy
Organize documentation with the project hierarchical taxonomy.
Structure
- wordpress-plugins
- wordpress-themes
- discord-bots
- php-libraries
Usage
Assign taxonomy terms to documentation posts for categorization and filtering.
REST API
For exact request/response shapes and permissions, see the API Reference.
Endpoints (Summary)
All endpoints use the chubes/v1 namespace.
Documentation
GET /wp-json/chubes/v1/docs– List documentation postsPOST /wp-json/chubes/v1/docs– Create new documentationGET /wp-json/chubes/v1/docs/{id}– Get specific documentationPUT /wp-json/chubes/v1/docs/{id}– Update documentationDELETE /wp-json/chubes/v1/docs/{id}– Delete documentation
Project Taxonomy
GET /wp-json/chubes/v1/project– List project taxonomy termsGET /wp-json/chubes/v1/project/tree– Get hierarchical project treePOST /wp-json/chubes/v1/project/resolve– Resolve or create taxonomy pathGET /wp-json/chubes/v1/project/{id}– Get specific taxonomy termPUT /wp-json/chubes/v1/project/{id}– Update taxonomy term
Sync Operations
POST /wp-json/chubes/v1/sync/setup– Setup project + category termsGET /wp-json/chubes/v1/sync/status– Get sync status for a projectPOST /wp-json/chubes/v1/sync/doc– Sync a single documentPOST /wp-json/chubes/v1/sync/batch– Batch sync documentsPOST /wp-json/chubes/v1/sync/all– Manually sync GitHub docs for all projectsPOST /wp-json/chubes/v1/sync/term/{id}– Manually sync GitHub docs for a termGET /wp-json/chubes/v1/sync/test-token– GitHub token diagnosticsPOST /wp-json/chubes/v1/sync/test-repo– GitHub repo diagnostics (repo_url)
Parameters
See API Reference for complete parameter documentation.
Quick Reference
per_page– Number of results per page (default: 10)page– Page number for paginationproject– Filter by project taxonomy term slugstatus– Filter by post status (publish, draft, etc.)search– Search term for title/content
Markdown Processing
Documentation content supports Markdown syntax via Parsedown.
Supported Features
- Headers (# ## ###)
- Lists (- * numbered)
- Code blocks (“`)
- Links and images
- Bold and italic text
Sync System
Components
- MarkdownProcessor: Converts Markdown to HTML with internal link resolution
- SyncManager: Handles external documentation synchronization and taxonomy management
- RepositoryFields: Manages GitHub/WordPress.org repository metadata and install tracking
Sync Process
- Project Setup: Use
/sync/setupto create project taxonomy terms and categories - Document Sync: Use
/sync/docor/sync/batchto import documentation with proper taxonomy assignment - Content Processing: Markdown content is converted to HTML with internal link resolution
- Taxonomy Management: Automatic creation of hierarchical taxonomy terms as needed
- Metadata Updates: Repository information and install counts are automatically fetched and updated
Sync Parameters
project_term_id: ID of the project taxonomy term (required)subpath: Hierarchical path within the project as array (e.g., ["api", "endpoints"])source_file: Original source file path for reference (required)title: Documentation title (required)content: Markdown content (required)filesize: Size of source file in bytes (required)timestamp: ISO 8601 timestamp of last modification (required)excerpt: Brief descriptionforce: Override existing content (boolean, default: false)
Install Tracking
The plugin tracks install counts for project terms that have a WordPress.org URL configured (returned as meta.installs on GET /project/{id}).
Templates
The plugin provides custom templates for documentation display:
- Archive template for documentation lists
- Single template for individual docs
- Codebase card components
- Related posts functionality
Development
Hooks and Filters
This plugin uses standard WordPress hooks internally. Public hooks/filters are not currently documented here; rely on the codebase when extending.
Components
- Api/Controllers/DocsController.php – REST API handling
- Fields/ – Metadata management
- Sync/ – Synchronization logic
- Templates/ – Display components
Troubleshooting
Common Issues
Sync fails with "Project term not found"
- Ensure you’ve called
/sync/setupfirst to create the project taxonomy terms - Verify the
project_term_idmatches the ID returned from setup - Check that the project term exists in the project taxonomy
Content not updating
- Set
force: truein your sync request to override existing content - Verify the
timestampparameter is newer than the existing document’s timestamp - Check if the document hash has actually changed
Invalid subpath errors
- Ensure
subpathis an array of strings, not a single string - Avoid special characters in subpath segments
- Keep subpath hierarchies shallow (max 3-4 levels)
API authentication errors
- Ensure you’re using proper WordPress authentication (cookies or application passwords)
- Verify user has appropriate permissions (
edit_postsfor/sync/docand/sync/batch;manage_optionsfor manual GitHub sync and diagnostics) - Check that the REST API is enabled on your WordPress installation
Debug Mode
Enable WordPress debug logging to troubleshoot issues:
// Add to wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
Check /wp-content/debug.log for detailed error information and API request logs.
Checking Sync Status
Monitor sync operations:
# Get sync status for a project
curl /wp-json/chubes/v1/sync/status?project=my-plugin
# List recent documentation
curl /wp-json/chubes/v1/docs?project=my-plugin&per_page=10