Add html-tidy formatter (#173)

This commit is contained in:
Mohsin Kaleem 2023-04-22 11:44:44 +01:00 committed by GitHub
parent 568862dc84
commit 2686e7b17d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 0 deletions

View file

@ -28,12 +28,14 @@ The format is based on [Keep a Changelog].
for [Bazel Build](https://bazel.build/) ([#171]).
* [`cmake-format`](https://github.com/cheshirekow/cmake_format)
for [CMake](https://cmake.org/) ([#172]).
* [`html-tidy`](https://www.html-tidy.org/) for HTML/XML ([#173]).
[#168]: https://github.com/radian-software/apheleia/pull/168
[#169]: https://github.com/radian-software/apheleia/pull/169
[#170]: https://github.com/radian-software/apheleia/pull/170
[#171]: https://github.com/radian-software/apheleia/pull/171
[#172]: https://github.com/radian-software/apheleia/pull/172
[#173]: https://github.com/radian-software/apheleia/pull/173
[#174]: https://github.com/radian-software/apheleia/pull/174
[#182]: https://github.com/radian-software/apheleia/pull/182
[#187]: https://github.com/radian-software/apheleia/pull/187

View file

@ -62,6 +62,22 @@
(gofumpt . ("gofumpt"))
(goimports . ("goimports"))
(google-java-format . ("google-java-format" "-"))
(html-tidy "tidy"
"--quiet" "yes"
"--tidy-mark" "no"
"--vertical-space" "yes"
"-indent"
(when (derived-mode-p 'nxml-mode)
"-xml")
(apheleia-formatters-indent
"--indent-with-tabs"
"--indent-spaces"
(cond
((derived-mode-p 'nxml-mode)
'nxml-child-indent)
((derived-mode-p 'web-mode)
'web-mode-indent-style)))
(apheleia-formatters-fill-column "-wrap"))
(isort . ("isort" "-"))
(jq "jq" "."
(apheleia-formatters-js-indent "--tab" "--indent"))

View file

@ -0,0 +1 @@
apt-get install -y tidy

View file

@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><title>Hello world</title></head><body><ul><li>1</li><li>2</li><li><ul><li>3</li></ul></li></ul></body></html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello world</title>
</head>
<body>
<ul>
<li>1</li>
<li>2</li>
<li>
<ul>
<li>3</li>
</ul>
</li>
</ul>
</body>
</html>