pronamic/wp-documentor

WordPress文档生成器。

v1.4.0 2024-05-06 08:16 UTC

This package is auto-updated.

Last update: 2024-09-06 09:12:36 UTC


README

Pronamic WordPress Documentor

Pronamic WordPress Documentor

Pronamic WordPress Documentor 是一个工具,可以自动提取关于您的WordPress主题或插件中的 动作过滤器 的数据。

Latest Stable Version Total Downloads Latest Unstable Version License

目录

入门

安装

要开始记录您的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

指定您是否想要导出 actionsfilters

示例: --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

输出示例

替代方案

以下是我们找到的替代方案列表。然而,这些方案都没有满足我们的需求。

如果您知道其他类似的项目,请随时编辑此部分!

灵感来自 https://github.com/TypistTech/imposter-plugin#alternatives

链接

Pronamic - Work with us