Skip to content
/ hpp Public

HTML Pretty Print for Go (golang)

License

Notifications You must be signed in to change notification settings

Joker/hpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8ce86f8 · Sep 13, 2020

History

10 Commits
Apr 11, 2018
Apr 18, 2018
Mar 27, 2019
Mar 27, 2019
Sep 13, 2020
Sep 13, 2020

Repository files navigation

HTML Pretty Print for Go (golang)

Package hpp (github.com/Joker/hpp) is a HTML formatter for Go.

example:

<!DOCTYPE html><html lang="en"><head><title>Pug</title><script type="text/javascript">if (foo) {
    bar(1 + 5)
}
</script></head><body><h1>Pug - template engine</h1><div id="container" class="col">
<p>You are amazing</p><form><br>First name:<input type="text" name="firstname"><br>Last name:
<input type="text" name="lastname"></form><p>Pug is a terse and simple templating
language with a <b>strong</b> focus on 
performance and powerful features.</p></div></body></html>

becomes

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Pug</title>
        <script type="text/javascript">
            if (foo) {
                bar(1 + 5)
            }
        </script>
    </head>
    <body>
        <h1>Pug - template engine</h1>
        <div id="container" class="col">
            <p>You are amazing</p>
            <form>
                <br>First name:
                <input type="text" name="firstname">
                <br>Last name:
                <input type="text" name="lastname">
            </form>
            <p>
                Pug is a terse and simple templating
                language with a <b>strong</b> focus on 
                performance and powerful features.
            </p>
        </div>
    </body>
</html>

Installation

$ go get github.com/Joker/hpp