pronamic / wp-documentor
WordPress文档生成器。
Requires
- php: >=8.0
- phpdocumentor/reflection: ^4.0
- phpdocumentor/reflection-docblock: ^5.2
- symfony/console: ^5.0 || ^6.0 || ^6.1 || ^6.2
- symfony/filesystem: ^5.0 || ^6.0 || ^6.1 || ^6.2
- symfony/finder: ^5.0 || ^6.0 || ^6.1 || ^6.2
- symfony/polyfill-php80: ^1.24
Requires (Dev)
README
Pronamic WordPress Documentor
Pronamic WordPress Documentor 是一个工具,可以自动提取关于您的WordPress主题或插件中的 动作 和 过滤器 的数据。
目录
入门
安装
要开始记录您的WordPress过滤器和动作,请使用Composer要求Pronamic WordPress Documentor
composer require pronamic/wp-documentor --dev
首次运行
要让Pronamic WordPress Documentor分析您的代码库,您必须使用parse
命令并将其指向正确的目录
vendor/bin/wp-documentor parse src
命令行使用
--format=FORMAT
您想要导出钩子的格式。
示例: --format=markdown
--template=FILE
自定义PHP模板,请参阅示例文件夹 templates
。
示例: --template=templates/markdown.php
--type=TYPE
指定您是否想要导出 actions
或 filters
。
示例: --type=actions
或 --type=filters
--output=FILE
将输出写入文件。
示例: --output=docs/hooks.md
--memory-limit=VALUE
指定与php.ini
接受的相同格式的内存限制。
示例: --memory-limit=-1
--exclude=GLOB
排除指定的文件夹/文件。
示例: --exclude=vendor --exclude=wordpress
--ignore-vcs-ignored
如果搜索目录包含.gitignore
文件,您可以使用此选项重用这些规则来排除文件和目录。
示例: --ignore-vcs-ignored
--prefix=PREFIX
仅解析以指定前缀开始的钩子。
示例: --prefix=my_theme --prefix=my_plugin
示例
vendor/bin/wp-documentor parse ./tests/source
vendor/bin/wp-documentor parse ./tests/source --format=hookster --type=actions --output=tests/docs/hookster-actions.json
vendor/bin/wp-documentor parse ./tests/source --format=hookster --type=filters --output=tests/docs/hookster-filters.json
vendor/bin/wp-documentor parse ./tests/source --format=markdown --output=tests/docs/hooks.md
vendor/bin/wp-documentor parse ./tests/source --format=phpdocumentor-rst --type=actions --output=tests/docs/phpdocumentor-actions.rst
vendor/bin/wp-documentor parse ./tests/source --format=phpdocumentor-rst --type=filters --output=tests/docs/phpdocumentor-filters.rst
输出示例
- tests/docs/hooks.md
- tests/docs/hookster-actions.json
- tests/docs/hookster-filters.json
- https://github.com/wp-pay-gateways/omnikassa-2/blob/2.3.2/docs/hooks.md
- https://github.com/wp-pay-gateways/adyen/blob/1.3.1/docs/hooks.md
- https://github.com/wp-pay-gateways/mollie/blob/2.2.3/docs/hooks.md
- https://github.com/wp-pay-extensions/gravityforms/blob/2.6.0/docs/hooks.md
- https://github.com/wp-pay/core/blob/2.7.0/docs/hooks.md
替代方案
以下是我们找到的替代方案列表。然而,这些方案都没有满足我们的需求。
如果您知道其他类似的项目,请随时编辑此部分!
- WP Parser by WordPress
- Hookster by Theme Blvd
- WordPress HookDoc by Matthias Günter
- GitHub Actions for WordPress by 10up
- Yoast Parser by Yoast
- WooCommerce Code Reference Generator by WooCommerce
- WordPress Hooks 参考 by John Blackbourn / Human Made
- wp-hooks-generator by John Blackbourn / Human Made
灵感来自 https://github.com/TypistTech/imposter-plugin#alternatives
链接
- https://developer.wordpress.org/plugins/hooks/
- https://developer.wordpress.org/plugins/hooks/actions/
- https://developer.wordpress.org/reference/functions/do_action/
- https://developer.wordpress.org/reference/functions/add_action/
- https://developer.wordpress.org/plugins/hooks/filters/
- https://developer.wordpress.org/reference/functions/apply_filters/
- https://developer.wordpress.org/reference/functions/add_filter/
- https://developer.wordpress.org/reference/hooks/
- https://www.phpdoc.org/
- https://github.com/phpdocumentor/phpdocumentor
- https://symfony.ac.cn/doc/current/console.html
- https://symfony.ac.cn/doc/current/components/finder.html
- https://developer.wordpress.org/cli/commands/i18n/make-pot/
- https://developer.wordpress.org/cli/commands/i18n/make-json/
- https://github.com/pronamic/deployer/blob/master/bin/pronamic-deployer
- https://gitlab.com/pronamic/wp-updates/-/blob/master/index.php
- pronamic/wp-pay-core#45
- phpDocumentor/phpDocumentor#2865
- https://github.com/themeblvd/hookster