tamdaz/doc2html

一个能够将 PHP 文档转换为 HTML 文件的工具。

0.2.0 2024-08-02 16:23 UTC

This package is auto-updated.

Last update: 2024-10-02 17:01:56 UTC


README

警告

目前,该项目处于开发阶段。它尚未完全完成。

doc2html

Packagist License Packagist Version

doc2html 是一个能够将 PHP 文档转换为 HTML 文件的工具。此工具可用于任何 PHP 项目(例如:Symfony、Laravel、Slim、CakePHP...)

cover image

安装

composer require --dev tamdaz/doc2html

配置

要生成配置,请执行

./vendor/bin/doc2html gen-config
return [
    // Path where the documentation will be saved.
    'output_dir' => __DIR__ . '/output',

    // For each action, indicate it to standard output (STDOUT).
    'verbose' => true,

    // When these namespaces are excluded, they will not be taken into account by the
    // tool (except when exceptions apply to the "include_classes" parameter).
    'exclude_namespaces' => [
        // ...
    ],

    // When these namespaces are included, they will be taken into account by the
    // tool (except when exceptions apply to the "exclude_classes" parameter).
    'include_namespaces' => [
        // ...
    ],

    // Exclude classes to avoid generate documentation, even though in the included namespace.
    'exclude_classes' => [
        // ...
    ],

    // Classes to include to generate documentation.
    // INFO: If the specified class is in the excluded namespace, it will still be taken
    // into account in the classmap.
    'include_classes' => [
        // ...
    ],
];

在生成文档之前,需要指定不同的目录,因为这样可以注册您的类在类映射中。

"autoload": {
    "classmap": [
        "examples/", "src/"
    ]
},
composer dump-autoload

信息:此库使用 Composer 的类映射,允许您选择不生成文档的类。

之后,您可以执行以下命令来生成:

./vendor/bin/doc2html generate-doc

提示

您可以为这个命令创建一个别名,并将其保存到 ~/.bashrc 文件中。

export doc2html="./vendor/bin/doc2html"

贡献者

欢迎任何贡献。