sant0ro/phpdoc-md

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

0.5.1 2017-09-26 17:38 UTC

This package is not auto-updated.

Last update: 2024-09-18 20:54:25 UTC


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"
}

然后你可以简单地使用以下命令安装:

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