PHPackages                             hk-r/px2-pretty-html - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hk-r/px2-pretty-html

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hk-r/px2-pretty-html
====================

HTMLを整形するpickles2プラグインです。

1.0.0(8y ago)018MITPHPPHP &gt;=5.4.0

Since Mar 8Pushed 8y agoCompare

[ Source](https://github.com/hk-r/px2-pretty-html)[ Packagist](https://packagist.org/packages/hk-r/px2-pretty-html)[ RSS](/packages/hk-r-px2-pretty-html/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (11)Versions (4)Used By (0)

px2-pretty-html
===============

[](#px2-pretty-html)

[Pickles 2](http://pickles2.pxt.jp/) 用のプラグインです。 HTMLのインデントを整形します。

導入手順 - Setup
------------

[](#導入手順---setup)

### 1. `composer.json` に `hk-r/px2-pretty-html` を設定する

[](#1-composerjson-に-hk-rpx2-pretty-html-を設定する)

`require` の項目に、`hk-r/px2-pretty-html` を追加します。

```
{
	〜 中略 〜
    "require": {
        "php": ">=5.3.0" ,
        "pickles2/px-fw-2.x": "^2.0",
        "hk-r/px2-pretty-html": "^1.0"
    },
	〜 中略 〜
}

```

### 2. composer update を実行する

[](#2-composer-update-を実行する)

追加したら、`composer update` を実行して変更を反映することを忘れずに。

```
$ composer update

```

### 3. `config.php` に、設定を追加する

[](#3-configphp-に設定を追加する)

設定ファイル `config.php` (通常は `./px-files/config.php`) を編集します。

- htmlインデント整形の処理追加
    `$conf->funcs->processor->html` に、処理 `'hk\pickles2\prettyHtml\prettyHtml::exec'` を追加します。

```
	$conf->funcs->processor->html = array(
		// htmlのインデントを整える
		'hk\pickles2\prettyHtml\prettyHtml::exec('.json_encode(array(
			// インデントに使用する文字を指定
			'indentation_character'=>"\t"
		)).')' ,
	);
```

- オプション

**indentation\_character** - インデントに使用する文字を指定します。
オプションを指定しない場合はデフォルト(半角スペース2つ)がインデントとして挿入されます。
例) タブ

```
	// タブがインデントとして挿入されます。
	'indentation_character'=>"\t"
```

例) 半角スペース4つ

```
	// 半角スペース4つがインデントとして挿入されます。
	'indentation_character'=>"    "
```

**exclusion\_elements** - インデント対象外のエレメントを指定します。
例) textarea, pre

```
	// インデント対象外のエレメントを指定します。
	'exclusion_elements'=>array(
		'textarea', 'pre'
	),
```

**inline\_elements** - インラインとして扱うエレメントを指定します。
例) b, big, i, small, tt, abbr, acronym, cite, code, dfn, em, kbd, strong, samp, var, a, bdo, br, img, span, sub, sup

```
	// インラインとして扱うエレメントを指定します。
	'inline_elements'=>array(
		'b', 'big', 'i', 'small', 'tt', 'abbr', 'acronym', 'cite', 'code', 'dfn', 'em', 'kbd', 'strong', 'samp', 'var', 'a', 'bdo', 'br', 'img', 'span', 'sub', 'sup'
	),
```

更新履歴 - Change log
-----------------

[](#更新履歴---change-log)

### hk-r/px2-pretty-html 1.0.0 (2018年3月22日)

[](#hk-rpx2-pretty-html-100-2018年3月22日)

- Initial Release.

ライセンス - License
---------------

[](#ライセンス---license)

MIT License

作者 - Author
-----------

[](#作者---author)

- (C)Kyota Hiyoshi

for Developer
-------------

[](#for-developer)

### Test

[](#test)

```
$ ./vendor/phpunit/phpunit/phpunit

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2973d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/46e98f4f0660f28a5c9f588ebca6097783a58db2da927fc78e139151d357f677?d=identicon)[hk-r](/maintainers/hk-r)

---

Top Contributors

[![hk-r](https://avatars.githubusercontent.com/u/30585379?v=4)](https://github.com/hk-r "hk-r (22 commits)")

---

Tags

pickles2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hk-r-px2-pretty-html/health.svg)

```
[![Health](https://phpackages.com/badges/hk-r-px2-pretty-html/health.svg)](https://phpackages.com/packages/hk-r-px2-pretty-html)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
