Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/matzeeable/wp-hookdoc

:star: An API documentation generator for your WordPress actions and filters.
https://github.com/matzeeable/wp-hookdoc

docs documentation hooks jsdoc-plugin jsdoc-template wordpress

Last synced: about 10 hours ago
JSON representation

:star: An API documentation generator for your WordPress actions and filters.

Awesome Lists containing this project

README

        

# WordPress HookDoc
Automate documentation of [**Actions**](https://codex.wordpress.org/Plugin_API/Action_Reference) and [**Filters**](https://codex.wordpress.org/Plugin_API/Filter_Reference) in WordPress. This npm module needs the [**JSDoc3**](https://github.com/jsdoc3/jsdoc) module as dependency. It uses JSDoc3 as comment parser and generates a documentation with the power of JSDoc.

## Getting started
Simply install via:
```sh
$ npm install jsdoc -g
$ npm install wp-hookdoc --save-dev
```

In your JSDoc configuration file `hookdoc-conf.json` the following options are essential (create a seperate configuration file if you already use JSDoc):
```js
{
"opts": {
"template": "node_modules/wp-hookdoc/template"
},
"source": {
"includePattern": ".+\\.(php|inc)?$"
},
"plugins": [
"node_modules/wp-hookdoc/plugin"
]
}
```

Run your `jsdoc` command with the input files and `-c hookdoc-conf.json`.

### Define Action Docblock
Define `@hook` attribute with the name of the action:
```php