-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
52 lines (40 loc) · 872 Bytes
/
main.go
File metadata and controls
52 lines (40 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"fmt"
"io"
"os"
)
func main() {
fmt.Println("Running...")
var div = MakeElementNode("div")
var h1 = MakeElementNode("h1")
h1.Add(MakeTextNode("sample"))
// h1.attributes["style"] = "font-weight: 400;"
var h2 = MakeElementNode("h2")
h2.Add(MakeTextNode("etc"))
h2.attributes["class"] = "subheader"
div.Add(h1)
div.Add(h2)
var d = MakeElementNode("div")
d.Add(h1)
d.Add(h2)
div.Add(d)
// fmt.Println(div)
// fmt.Println(div.ToString())
f, err := os.Open("data/test.html")
// // defer f.Close()
check(err)
// _, err = f.Seek(0, 0)
// check(err)
r := io.Reader(f)
node := Parse(r)
node.ToString()
// fmt.Println("Pretty Print:")
// fmt.Println(node.ToString())
// fmt.Println("Regular Print:")
// fmt.Println(node)
file, error := os.Open("data/test.css")
check(error)
ParseCSS(file)
// fmt.Println(sheet)
}