dcramble / phpdoc-md
PHP 文档生成器,支持 Markdown 输出
v0.1.1
2014-10-30 19:02 UTC
Requires
- php: >=5.3.1
- twig/twig: ~1.16.0
Requires (Dev)
- phpdocumentor/phpdocumentor: ~2.7.0
README
本脚本将从 PHPDocumentor XML 输出文件生成 markdown (.md) API 文档文件。
它只记录类和接口。
该项目最初由 Evert Pot 开发。有关更多信息,请参阅他的 仓库。
查看一些 示例 Markdown API 文档。
安装
该项目假定您已安装了 composer。
$ composer require dcramble/phpdoc-md "~0.1"
用法
首先确保您已安装 phpdocumentor 2,之后,您必须生成一个名为 structure.xml
的文件。
最简单的方法是创建一个临时目录,例如命名为 docs/
,因为 phpDocumentor2 会创建大量的 'cache' 目录。
# phpdoc command
mkdir docs
cd docs
phpdoc -d [project path] -t . --template="xml"
rm -r phpdoc-cache-*
# Next, run phpdocmd:
phpdocmd structure.xml [outputdir]
选项
--lt [template]
This specifies the 'template' for links we're generating. By default
this is "%c.md".
--namespaced-names
This specifies the fully qualified classes, with namespaces, should
be printed.
这将生成所有 .md 文件。