# hexo-html-prettify

> HTML beautifier for Hexo static site generator.

Latest version **1.1.4** (published 2022-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install hexo-html-prettify
pnpm add hexo-html-prettify
yarn add hexo-html-prettify
bun add hexo-html-prettify
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2022-10-08 |
| First published | 2020-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sergey Zwezdin |
| Maintainers | sergeyzwezdin |
| Keywords | hexo, html, beautify |

## Links

- npm: https://www.npmjs.com/package/hexo-html-prettify
- Repository: https://github.com/sergeyzwezdin/hexo-html-prettify
- Homepage: https://github.com/sergeyzwezdin/hexo-html-prettify#readme
- Issues: https://github.com/sergeyzwezdin/hexo-html-prettify/issues
- npm.io page: https://npm.io/package/hexo-html-prettify

## Dependencies (2)

- [micromatch](https://npm.io/package/micromatch.md) ^4.0.2
- [js-beautify](https://npm.io/package/js-beautify.md) ^1.13.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2022-10-08
- 1.1.3 — 2020-12-17
- 1.1.2 — 2020-12-17
- 1.1.1 — 2020-08-25
- 1.1.0 — 2020-05-08
- 1.0.0 — 2020-04-23
- 0.0.2 — 2020-04-22
- 0.0.1 — 2020-04-22

## README

# hexo-html-prettify ![Publish on NPM](https://github.com/sergeyzwezdin/hexo-html-prettify/workflows/Publish%20on%20NPM/badge.svg) ![](https://img.shields.io/npm/v/hexo-html-prettify)

`hexo-html-prettify` is a plugin for Hexo static site generator that tidies up output HTML markup.

* **Tidies up** the output HTML markup on the fly.
* Uses [`js-beautify`](https://beautifier.io) underneath. It's possible to use all power of this library to beautify HTML markup.
* **Easy to use**. Just install it and it will start working.
* **Customizable**. You will be able to change every setting of `js-beauty` minifier.

## How it works

Once Hexo build HTML page, the plugin runs `js-beautify` to cleanup output HTML. Easy! 🤓

## Requirements
- Hexo: 4.x
- Node 12+

## Usage

1. Install the plugin using npm:
```bash
$ npm install hexo-html-prettify --save-dev
```
2. After installation the plugin will start working with default settings, but if you need you can add `html_prettify` parameter to Hexo configuration file (see configuration description below).
3. Build your website and enjoy! 🔥

## Configuration

To configure the plugin add `html_prettify` key to the Hexo config file. For example:

```yaml
html_prettify:
    enable: true
    exclude:
        - "*/**/test"
    options:
        indent_size: 2
        indent_char: " "
        max_preserve_newlines: "-1"
        preserve_newlines: false
        keep_array_indentation: true
        break_chained_methods: false
        indent_scripts: normal
        brace_style: expand
        space_before_conditional: true
        unescape_strings: false
        jslint_happy: true
        end_with_newline: true
        wrap_line_length: "0"
        indent_inner_html: false
        comma_first: false
        e4x: false
        indent_empty_lines: false
```

| Key | Required | Default value | Description |
| --- | --- | --- | --- |
| `enable` | `false` | `true` | Enable/disable output HTML prettifying. |
| `exclude` | `false` | empty | Array of paths that should be excluded from processing. |
| `options` | `false` | | Options object that will be passed to `js-beautify` during processing. You can generate your settings using [this online tool](https://beautifier.io/). |

---
_Source: https://npm.io/package/hexo-html-prettify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
