A powerful tool to generate beautiful documentation for WordPress plugin hooks.
- 📦 Automatically collects action and filter hooks from your WordPress plugin
- 📝 Generates well-structured markdown documentation
- 🌐 Creates a beautiful documentation site using Docusaurus
- 🎨 Fully customizable theme
- 🔍 Built-in search functionality
- Node.js >= 20.0
- PHP >= 8.3
npm install -g @10up/wp-hooks-documentor
- Initialize a new configuration file:
wp-hooks-documentor init
-
Edit the generated
wp-hooks-doc.json
file to match your project settings. -
Generate documentation:
wp-hooks-documentor generate
The tool uses a single configuration file (wp-hooks-doc.json
) to control all aspects of the documentation generation process. Here's a complete example with all available options:
{
"title": "Plugin Hooks Documentation",
"tagline": "Hooks Documentation for the plugin",
"url": "https://example.com",
"baseUrl": "/",
"repoUrl": "https://github.com/username/repo",
"organizationName": "username",
"projectName": "repo",
"input": ".",
"ignoreFiles": [],
"ignoreHooks": [],
"outputDir": "./wp-hooks-docs",
"templatesDir": "./.wp-hooks-docs/template",
"footerStyle": "dark",
"footerCopyright": "Copyright © 2025. Built with WP Hooks Documentor."
}
title
: Site titletagline
: Site taglineurl
: Production URLbaseUrl
: Base URL pathrepoUrl
: GitHub repository URLorganizationName
: GitHub organization/usernameprojectName
: GitHub repository nameinput
: Path to your WordPress pluginignoreFiles
: Files to ignoreignoreHooks
: Hooks to ignoreoutputDir
: Where to export documentation sitetemplatesDir
: Custom templates directory to customize overall documentation site.footerStyle
: Footer style, eg: dark or lightfooterCopyright
: Footer copyright text
wp-hooks-documentor init
: Create a new configuration filewp-hooks-documentor generate
: Generate complete documentation
The documentation site uses Docusaurus, which means you can fully customize the theme. See the Docusaurus documentation for more details.
Beta: This project is quite new and we're not sure what our ongoing support level for this will be. Bug reports, feature requests, questions, and pull requests are welcome. If you like this project please let us know, but be cautious using this in a Production environment!
A complete listing of all notable changes to Repo Automator - GitHub Action are documented in CHANGELOG.md.
Please read CODE_OF_CONDUCT.md for details on our code of conduct, CONTRIBUTING.md for details on the process for submitting pull requests to us, and CREDITS.md for a list of maintainers, contributors, and libraries used in this repository.