dgsiegel/kirby-tidy-html

为 Kirby 提供的整洁 HTML 输出

安装: 35

依赖项: 0

建议者: 0

安全性: 0

星星: 4

关注者: 1

分支: 0

公开问题: 0

类型:kirby-plugin

1.0.0 2023-12-13 15:24 UTC

This package is auto-updated.

Last update: 2024-09-30 01:57:44 UTC


README

为 Kirby 提供的整洁 HTML 输出

安装

要求

您需要安装并加载 PHP tidy 扩展。您可以使用以下命令检查是否已安装:

php -r "var_dump(extension_loaded('tidy'));"

使用 composer 安装

composer require dgsiegel/kirby-tidy-html

添加为 git 子模块

git submodule add https://github.com/dgsiegel/kirby-tidy-html.git site/plugins/kirby-tidy-html

手动下载

下载并将此存储库复制到 site/plugins/kirby-tidy-html

选项

该包的默认值是:

在此处找到所有可用的 Tidy 选项:https://api.html-tidy.org/tidy/quickref_next.html

使用方法

return [
    'dgsiegel.kirby-tidy-html.enabled' => true,
    'dgsiegel.kirby-tidy-html.options' => [
       'drop-empty-paras'    => 0,
       'indent'              => 2,
       'indent'              => 2,
       'indent-spaces'       => 2,
       'indent-spaces'       => 2,
       'output-html'         => 1,
       'preserve-entities'   => 1,
       'priority-attributes' => 'id, class, name, src, alt',
       'quote-ampersand'     => 0,
       'sort-attributes'     => 0,
       'vertical-space'      => 1,
       'wrap'                => 0,
    ],
];