heimrichhannot / phpdoc-github-template
生成公共API Markdown文档的phpDocumentor模板
0.1.2
2016-02-07 11:55 UTC
Requires
- phpdocumentor/phpdocumentor: ~2.8.0
This package is not auto-updated.
Last update: 2024-09-14 18:53:00 UTC
README
phpDocumentor模板,用于生成仅包含公共API的Markdown文档。它会跳过所有抽象类和非公共方法。
此模板的主要用例是生成简单且外观美观的文档,然后可以发布到GitHub。
例如,一个小型库可以在DocBlock注释中记录其公共API,使用此模板生成Markdown文档,然后将文档与库一起提交到GitHub,以便为其他开发者创建易于阅读的文档。
使用此模板生成的文档示例:https://github.com/cvuorinen/raspicam-php/tree/master/docs
安装
使用composer安装
composer require cvuorinen/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的更多信息。