phwoolcon / phpdoc-markdown-public
生成公共API的Markdown文档的phpDocumentor模板
0.1.2
2016-02-07 11:55 UTC
Requires
- phpdocumentor/phpdocumentor: ~2.8.0
This package is auto-updated.
Last update: 2024-08-29 04:37:01 UTC
README
仅生成公共API的Markdown文档的phpDocumentor模板。它将跳过所有抽象类和非公共方法。
此模板的主要用例是生成简单且外观良好的使用文档,然后可以将其发布在GitHub上。
例如,一个小型库可以在DocBlock注释中记录其公共API,使用此模板生成Markdown文档,然后将其与库一起提交到GitHub,以便为其他开发者创建美观的文档。
此模板生成的文档示例:https://github.com/cvuorinen/raspicam-php/tree/master/docs
安装
使用composer安装
composer require phwoolcon/phpdoc-markdown-public
用法
运行phpDocumentor并设置模板为vendor/cvuorinen/phpdoc-markdown-public/data/templates/markdown-public
。
使用命令行参数的示例
./vendor/bin/phpdoc --directory=src/ --target=docs/ --template="vendor/cvuorinen/phpdoc-markdown-public/data/templates/markdown-public" --title="My Project Documentation"
有关可用参数的更多信息,请参阅运行phpDocumentor。
使用配置文件的示例
将名为phpdoc.xml
的文件添加到项目根目录,并使用不带参数的phpdoc
命令调用它。修改配置以适应您的项目。
<?xml version="1.0" encoding="UTF-8" ?> <phpdoc> <title>My Project Documentation</title> <parser> <target>build</target> </parser> <transformer> <target>docs</target> </transformer> <transformations> <template name="vendor/cvuorinen/phpdoc-markdown-public/data/templates/markdown-public" /> </transformations> <files> <directory>src</directory> <ignore>test/*</ignore> </files> </phpdoc>
有关配置phpDocumentor的更多信息。