diplix/html-pretty 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

diplix/html-pretty

最新稳定版本:1.0.4

Composer 安装命令:

composer require diplix/html-pretty

包简介

HTML Pretty-Print und Minifizierung für Kirby CMS

README 文档

README

Cover

Formats Kirby HTML output and minifies JavaScript and CSS. I vibe coded this with cursor, but tested it extensively on https://wirres.net.

Features

  • HTML formatting with indentation
  • JavaScript minification
  • CSS minification
  • Removal of HTML comments
  • Compatible with most Kirby caching mechanisms
  • Disabled in debug mode

Installation

Copy the plugin directory to site/plugins/kirby-html-pretty/

Alternatively, you can install it with composer: composer require diplix/html-pretty

Configuration

You can configure the plugin options in your config.php:

return [
    'diplix.html-pretty.minifyJs' => true,        // Minify JavaScript (default: true)
    'diplix.html-pretty.minifyCss' => true,       // Minify CSS (default: true)
    'diplix.html-pretty.removeComments' => true,  // Remove HTML comments (default: true)
    'diplix.html-pretty.indentCharacters' => '    ', // Indentation characters (default: 4 spaces)
];

Available Options

  • diplix.html-pretty.minifyJs (boolean, default: true)
    Minifies inline JavaScript code.

  • diplix.html-pretty.minifyCss (boolean, default: true)
    Minifies inline CSS code.

  • diplix.html-pretty.removeComments (boolean, default: true)
    Removes HTML comments from the output.

  • diplix.html-pretty.indentCharacters (string, default: ' ')
    Characters used for indentation (default: 4 spaces).

The plugin uses the page.render:after hook.

Additional Info

  • Uses wa72/html-pretty-min for formatting
  • Hook: page.render:after (runs after all other plugins)
  • Only active when option('debug') !== true

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-23