gianiaz/phpdoc-md

PHP 文档生成器,支持 Markdown 输出

0.3.0 2018-02-05 10:17 UTC

This package is not auto-updated.

Last update: 2024-09-21 16:36:00 UTC


README

这是一个用于生成 API 文档 Markdown 文件 (.md) 的脚本。

它专为使用 PSR-0, PSR-1, PSR-2, PSR-4 和命名空间的的项目定制。该项目最初是为 sabre/dav 开发的,但也应该适用于其他代码库。

它只记录类和接口。

代码很丑,它只打算是一次性的,我当时很匆忙,所以代码库可能不符合你的标准(当然,它也不符合我的标准)。

安装

该项目假设你已经安装了 composer。只需将以下内容添加到你的 composer.json 中:

"require-dev" : {

    "gianiaz/phpdoc-md" : "~0.3.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 gianiaz