hpp

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2019 License: BSD-3-Clause Imports: 8 Imported by: 48

README

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewStr = []byte("\n")

NewStr should be "\n" or "\r\n" for windows

View Source
var TabStr = []byte("    ")

TabStr - tab size

Functions

func Format

func Format(r io.Reader, w io.Writer)

func PrPrint

func PrPrint(in string) string

func Print

func Print(r io.Reader) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL