csoellinger / dog-html-printer
Dog 的 HTML 打印机,一个简单的代码文档生成器。
v0.3.1
2021-02-24 10:52 UTC
Requires
- php: ^7.4 || ^8
- doctrine/inflector: ^2.0
- klitsche/dog: ^0.4
- league/commonmark: ^1.5
- odan/twig-assets: ^3.2
- scrivo/highlight.php: dev-master
- twig/markdown-extra: ^3.2
- wyrihaximus/html-compress: ^4.1
Requires (Dev)
- phpstan/phpstan: ^0.12.78
- ramsey/devtools: ^1.5
- vimeo/psalm: ^4.4
README
Dog 的 HTML 打印机,一个简单的代码文档生成器。[Dog](https://github.com/klitsche/dog)。
关于
这是一个 HTML 打印机,用于 Dog PHP 文档生成器。它深受 Doctum、phpDox 等其他优秀项目的影响。打印机目前处于开发中,但已经非常可配置,具有许多功能,如:树状导航、源代码实现、PhpLoc 概览、readme 渲染器等。请查看待办事项部分。
安装
首先:您需要安装 Dog PHP 文档生成器。
其次:目前您需要在 composer 文件中允许最小稳定性 dev,因为最新版本的 highlight.php 工作得很好,但尚未发布,所以我们使用 dev-master 分支。
将以下内容添加到您的 composer.json 文件中
{ "minimum-stability": "dev", "prefer-stable" : true, }
至少安装 HTML 打印机
composer require --dev csoellinger/dog-html-printer
使用
在安装了 Dog 和 Dog HTML 打印机 后,您可以自定义 .dog.yml 来使用新的打印机类。
# Most configurations are by the dog package itself. # Title title: 'Dog HTML printer' # Relative or absolute paths to source files - plus patterns to include or exclude path pr files srcPaths: 'src': '/.*\.php$/': true # Configure enrichers to add extra data to project or element items # phploc is supported by DogHtmlPrinter enrichers: phploc: class: Klitsche\Dog\Enrichers\PHPLOC\PHPLOCEnricher file: phploc.json # Set the printer class to DogHtmlPrinter printerClass: 'CSoellinger\DogHtmlPrinter\HtmlPrinter' # Printer configuration printerConfig: # Set a custom template path. If you want do this, best way would be to copy the resources/templates dir # from this package to you project dir and then customize the templates. # templatesPath: 'resources/templates' # If you want add a readme file readme: 'README.md' # Include source code includeSource: true # Ignore code marked as @internal ignoreInternal: true # Ignore private things (methods, properties,...) ignorePrivate: true # Minify CSS and JS at output minifyCssAndJs: true # Minify HTML at output. Slows down the build!! minifyHtml: false # Relative or absolute path to output directory outputDir: 'docs/html' # Optional cache dir cacheDir: 'build/cache' # Enable or disable debug mode - helps when tweaking templates debug: false
配置完设置后,您就可以开始构建文档了。
vendor/bin/dog
文档/演示
https://csoellinger.github.io/dog-html-printer
贡献
欢迎贡献!要贡献,请熟悉 CONTRIBUTING.md。
如果您发现了错误或有想法,请随时在此处的 GitHub 上发布。
已知问题
- 在 README 中链接到其他 markdown 文件会导致问题
- 折叠树状导航也会选择项目
待办事项
- 生成本地静态搜索
- 将覆盖率数据包含到打印机输出中
- 将测试数据包含到打印机输出中
- 项目测试
- 移动优化
- 用仅需要的组件替换或自定义 Bootstrap
- 使用子目录布局配置而不是平面目录输出。
- 优化
- 将 Bootstrap 降至仅需要的组件
- 一些代码部分有点“狡猾”
- 主题化
- 通过打印机配置添加自定义 CSS
- 使用新主题的主题系统,而无需编写新的打印机类(如“自定义模板路径”)
版权和许可证
csoellinger/dog-html-printer 库版权所有 © Christopher Söllinger,并许可在 MIT 许可证(MIT)的条款下使用。有关更多信息,请参阅 LICENSE。