mirko-pagliai / php-doc-maker
此软件包已被废弃,不再维护。作者建议使用 php-doc-maker 软件包代替。
一个用于生成 PHP 项目和库文档的工具
1.0.2-beta3
2020-09-30 09:58 UTC
Requires
- php: >=7.2
- cakephp/collection: ^3.1|^4
- league/commonmark: ^1.4
- mirko-pagliai/php-tools: ^1.4.1
- phpdocumentor/reflection-docblock: ^5.1
- roave/better-reflection: ^4.2
- symfony/console: ^5.1
- symfony/event-dispatcher: ^5.1
- symfony/options-resolver: ^5.1
- twig/twig: ^3.0
Requires (Dev)
- cakephp/cakephp-codesniffer: ^4.0
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2022-10-08 14:30:24 UTC
README
php-doc-maker 是一个命令行工具,可自动生成您的 PHP 项目的文档。
它至少需要 PHP 7.2。
是的,php-doc-maker 的文档也是用同样的方式生成的,您可以在 这里 找到。
您喜欢这个库吗?它的开发需要我投入大量时间。请考虑进行 捐赠:一杯咖啡就足够了!谢谢。
它如何工作
您可以通过 Composer 安装此软件包(如果您想全局安装软件包,请参阅下面内容)
$ composer require --dev --prefer-dist mirko-pagliai/php-doc-maker
然后您可以运行以下命令(软件包已安装到 vendor/mirko-pagliai/php-doc-maker
)
vendor/mirko-pagliai/php-doc-maker/bin/php-doc-maker make
这是一个输出示例
$ vendor/mirko-pagliai/php-doc-maker/bin/php-doc-maker make --title "My project" -t docs Sources directory: /home/mirko/Libs/php-doc-maker/tests/test_app Target directory: docs ==================================================================================================================================================== Founded 13 classes Founded 6 functions Rendered menu element Rendered index page Rendered functions page Rendered class page for App\Animals\Animal Rendered class page for App\Animals\Cat Rendered class page for App\Animals\Dog Rendered class page for App\Animals\Horse Rendered class page for App\Animals\Traits\ColorsTrait Rendered class page for App\Animals\Traits\PositionTrait Rendered class page for App\ArrayExample Rendered class page for App\DeprecatedClassExample Rendered class page for App\FileArrayExample Rendered class page for App\Vehicles\Car Rendered class page for App\Vehicles\MotorVehicle Rendered class page for App\Vehicles\Vehicle Elapsed time: 4.85 seconds
例如,查看由其自己构建的 php-doc-maker
文档
您可以使用 --help
选项(或 -h
)查看所有可用选项
$ vendor/mirko-pagliai/php-doc-maker/bin/php-doc-maker make -h Usage: make [options] [--] [<source>] Arguments: source Path from which to read the sources. If not specified, the current directory will be used Options: --debug Enables debug --no-cache Disables cache -t, --target=TARGET Target directory where to generate the documentation. If not specified, the `output` directory will be created --title=TITLE Title of the project. If not specified, the title will be self-determined using the name of the source directory -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
全局安装
假设您想为多个项目和库使用 php-doc-maker,因此不希望为每个项目都安装它。
在这种情况下,您可以克隆 Git 仓库(例如在您的用户主目录或其他位置)
$ git clone git@github.com:mirko-pagliai/php-doc-maker.git php-doc-maker Cloning into 'php-doc-maker'... remote: Enumerating objects: 1373, done. remote: Counting objects: 100% (1373/1373), done. remote: Compressing objects: 100% (637/637), done. remote: Total 1373 (delta 817), reused 1177 (delta 621), pack-reused 0 Ricezione degli oggetti: 100% (1373/1373), 598.74 KiB | 1.58 MiB/s, done. Risoluzione dei delta: 100% (817/817), done.
然后使用 Composer 安装依赖项
$ cd php-doc-maker
$ composer install
最后,编辑 .bash_aliases
文件(在您的用户主目录中),添加一个别名
alias php-doc-maker='/home/mirko/php-doc-maker/bin/php-doc-maker make'
现在您可以在任何位置运行 php-doc-maker
命令。
版本控制
为了透明度和对发布周期的深入了解,以及维护向后兼容性,php-doc-maker 将遵循 语义化版本控制指南 进行维护。