voku / php-readme-helper
从代码自动生成README
0.6.4
2022-09-01 07:45 UTC
Requires
- php: >=7.1.0
- voku/simple-php-code-parser: ~0.19
Requires (Dev)
- phpunit/phpunit: ~6.0 || ~7.0 || ~9.0
This package is auto-updated.
Last update: 2024-09-03 02:38:00 UTC
README
📖 PHP README Helper
自动生成README文件中的API文档的辅助工具。
示例
(build/generate_docs.php)
$readmeGenerator = new \voku\PhpReadmeHelper\GenerateApi(); $readmeText = ($readmeGenerator)->generate( __DIR__ . '/../src/voku/PhpReadmeHelper/GenerateApi.php', __DIR__ . '/docs/base.md' ); file_put_contents(__DIR__ . '/../README.md', $readmeText);
GenerateApi
generate(string $codePath, string $baseDocFilePath, string[]|null $useClasses): string
↑ 此方法可以从PHP代码中生成带有类型的API文档并放入您的README文件中。
参数
string $codePath <p>文件或目录的路径.</p>
string $baseDocFilePath <p>README的基础文件路径.</p>
array<array-key, string>|null $useClasses <p>如果使用,您可以指定要使用的类.</p>
返回值
string <p>返回生成的README字符串.</p>
支持
有关支持和捐赠,请访问 Github | 问题 | PayPal | Patreon。
有关状态更新和发布公告,请访问 发布 | Twitter | Patreon。
有关专业支持,请联系 我。