csoellinger/dog-html-printer

Dog 的 HTML 打印机,一个简单的代码文档生成器。

安装: 279

依赖: 1

建议: 0

安全: 0

星级: 0

观察者: 2

分支: 0

开放问题: 0

语言:Twig

v0.3.1 2021-02-24 10:52 UTC

This package is auto-updated.

Last update: 2024-09-25 18:39:40 UTC


README

Dog 的 HTML 打印机,一个简单的代码文档生成器。[Dog](https://github.com/klitsche/dog)。

Source Code Download Package PHP Programming Language Read License Package downloads on Packagist

关于

这是一个 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

使用

在安装了 DogDog 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