evert/phpdoc-md
PHP 文档生成器,支持 Markdown 输出
0.2.0
2016-02-11 22:08 UTC
Requires
- php: >=5.3.1
- twig/twig: ~1.2|2.0
Requires (Dev)
- phpdocumentor/phpdocumentor: ~2.8.0
- sabre/cs: ~0.0.5
README
这是一个用于生成 API 文档的 markdown (.md) 文件的脚本。
它专为使用 PSR-0、PSR-1、PSR-2、PSR-4 和命名空间的项目定制。该项目最初是为 sabre/dav 开发的,但应该也可以用于其他代码库。
它只记录类和接口。
代码很丑,它被设计成一次性使用,我赶时间,所以代码库可能不符合你的标准。(当然,它也不符合我的标准)。
安装
此项目假设你已经安装了 composer。只需将以下内容添加到你的 composer.json 中:
"require-dev" : {
"evert/phpdoc-md" : "~0.2.0"
}
To your composer.json, and then you can simply install with
composer install
用法
首先确保你在某个地方安装了 phpdocumentor 2,然后你必须生成一个名为 structure.xml
的文件。
最简单的方法是创建一个临时目录,例如命名为 docs/
。
# phpdoc command
phpdoc -d [project path] -t docs/ --template="xml"
# Next, run phpdocmd:
phpdocmd docs/structure.xml [outputdir]
选项
--lt [template]
This specifies the 'template' for links we're generating. By default
this is "%c.md".
--index [filename]
This specifies the 'filename' for API Index markdown file we're generating.
By default this is "ApiIndex.md".
这将生成所有 .md 文件。我很期待听到你的反馈。
祝好, Evert