{"id":20420194,"url":"https://github.com/matzeeable/wp-hookdoc","last_synced_at":"2026-03-15T07:39:52.583Z","repository":{"id":57399516,"uuid":"110847149","full_name":"matzeeable/wp-hookdoc","owner":"matzeeable","description":":star: An API documentation generator for your WordPress actions and filters.","archived":false,"fork":false,"pushed_at":"2018-09-29T21:25:05.000Z","size":383,"stargazers_count":52,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T18:08:44.123Z","etag":null,"topics":["docs","documentation","hooks","jsdoc-plugin","jsdoc-template","wordpress"],"latest_commit_sha":null,"homepage":"https://devowl.io","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matzeeable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-15T14:56:14.000Z","updated_at":"2024-11-17T22:53:44.000Z","dependencies_parsed_at":"2022-09-09T22:21:21.986Z","dependency_job_id":null,"html_url":"https://github.com/matzeeable/wp-hookdoc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matzeeable%2Fwp-hookdoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matzeeable%2Fwp-hookdoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matzeeable%2Fwp-hookdoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matzeeable%2Fwp-hookdoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matzeeable","download_url":"https://codeload.github.com/matzeeable/wp-hookdoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610338,"owners_count":21132921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docs","documentation","hooks","jsdoc-plugin","jsdoc-template","wordpress"],"created_at":"2024-11-15T06:42:00.054Z","updated_at":"2026-03-15T07:39:47.547Z","avatar_url":"https://github.com/matzeeable.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress HookDoc\nAutomate 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.\n\n## Getting started\nSimply install via:\n```sh\n$ npm install jsdoc -g\n$ npm install wp-hookdoc --save-dev\n```\n\nIn your JSDoc configuration file `hookdoc-conf.json` the following options are essential (create a seperate configuration file if you already use JSDoc):\n```js\n{\n    \"opts\": {\n        \"template\": \"node_modules/wp-hookdoc/template\"\n    },\n    \"source\": {\n        \"includePattern\": \".+\\\\.(php|inc)?$\"\n    },\n    \"plugins\": [\n        \"node_modules/wp-hookdoc/plugin\"\n    ]\n}\n```\n\nRun your `jsdoc` command with the input files and `-c hookdoc-conf.json`.\n\n### Define Action Docblock\nDefine `@hook` attribute with the name of the action:\n```php\n\u003c?php\n/**\n * Enqueue scripts for all admin pages.\n *\n * @since 2.8.0\n * @hook admin_enqueue_scripts\n * @param {string} $hook_suffix The current admin page.\n */\ndo_action( 'admin_enqueue_scripts', $hook_suffix );\n```\n\n### Define Filter Docblock\nDefine `@hook` attribute with the name of the filter and a `@returns` attribute:\n```php\n/**\n * Filters the title tag content for an admin page.\n *\n * @since 3.1.0\n * @hook admin_title\n * @param {string} $admin_title The page title, with extra context added.\n * @param {string} $title       The original page title.\n * @returns {string} The title\n */\n$admin_title = apply_filters( 'admin_title', $admin_title, $title );\n```\n\n## Generate example documentation\nTo generate an example documentation change to the `node_modules/wp-hookdoc` folder and run:\n```sh\nnpm run example\n```\n\nYou will find the output in `node_modules/wp-hookdoc/example/out`:\n![example output](https://i.imgur.com/7UmzmLz.png)\n\n## License\nThis module is MIT licensed.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatzeeable%2Fwp-hookdoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatzeeable%2Fwp-hookdoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatzeeable%2Fwp-hookdoc/lists"}