-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
199 lines (188 loc) · 3.82 KB
/
main.go
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
package main
import (
"fmt"
"gitlab.com/snowmerak/simple-html-generator/e"
)
func main() {
titleString := "Serve it Yourself!"
metas := e.Elements{
e.Text{
Value: "<meta charset=\"UTF-8\">",
},
e.Text{
Value: "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
},
e.Text{
Value: "<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
},
e.Text{
Value: "<title>" + titleString + "</title>",
},
}
title := e.Elements{
e.Header{
Level: 1,
Value: e.Text{
Value: titleString,
},
},
e.Bold{
Value: e.Italic{
Value: e.Text{
Value: "\"Serve it Yourself!\"는 백엔드 인프라를 직접 구현해보는 프로젝트입니다.",
},
},
},
}
summery := e.Elements{
e.Header{
Level: 2,
Value: e.Text{
Value: "개요",
},
},
e.Paragraph{
Value: e.Text{
Value: "",
},
},
}
roadmap := e.Elements{
e.Header{
Level: 2,
Value: e.Text{
Value: "구상도",
},
},
e.Text{
Value: "<figure><img src=\"out/uml/roadmap/roadmap.svg\" alt=\"roadmap\"></figure>",
},
}
contributer := e.Elements{
e.Header{
Level: 2,
Value: e.Text{
Value: "기여자",
},
},
e.Paragraph{
Value: e.Text{
Value: "snowmerak: <a href=\"https://github.com/snowmerak\">Github</a>",
},
},
}
communityDatas := [][]string{
{"코딩맛집", "<a href=\"https://discord.gg/U7HhCCzV\">discord</a>"},
{"위클리 아카데미", "<a href=\"https://weekly.ac\">homepage</a>"},
}
communityRows := []e.TableRow{}
for _, communityData := range communityDatas {
row := e.TableRow{}
for _, value := range communityData {
row.Values = append(row.Values, e.TableData{
Values: []e.Element{
e.Text{
Value: value,
},
},
})
}
communityRows = append(communityRows, row)
}
community := e.Elements{
e.Header{
Level: 2,
Value: e.Text{
Value: "커뮤니티",
},
},
e.Table{
Headers: e.TableHeader{
Values: []e.Element{
e.Text{
Value: "이름",
},
e.Text{
Value: "링크",
},
},
},
Rows: communityRows,
},
}
projectDatas := [][]string{
{"Lux", "snowmerak", "simple webframework for golang", "<a href=\"https://github.com/diy-cloud/lux\">Github</a>"},
{"logstream", "snowmerak", "log library for golang", "<a href=\"https://github.com/diy-cloud/logstream\">Github</a>"},
{"log-silo", "snowmerak", "simple log store based parquet", "<a href=\"https://github.com/diy-cloud/log-silo\">Github</a>"},
{"compositor", "snowmerak", "reverse proxy server based docker", "<a href=\"https://github.com/diy-cloud/compositor\">Github</a>"},
{"virtual-gate", "snowmerak", "a load balancer and rate limitter", "<a href=\"https://github.com/diy-cloud/virtual-gate\">Github</a>"},
}
projectsRows := []e.TableRow{}
for _, projectData := range projectDatas {
row := e.TableRow{}
for _, value := range projectData {
row.Values = append(row.Values, e.TableData{
Values: []e.Element{
e.Text{
Value: value,
},
},
})
}
projectsRows = append(projectsRows, row)
}
projects := e.Elements{
e.Header{
Level: 2,
Value: e.Text{
Value: "프로젝트",
},
},
e.Table{
Headers: e.TableHeader{
Values: e.Elements{
e.Text{
Value: "프로젝트명",
},
e.Text{
Value: "메인테이너",
},
e.Text{
Value: "개요",
},
e.Text{
Value: "링크",
},
},
},
Rows: projectsRows,
},
}
doc := e.Document{
Head: e.Head{
Values: []e.Element{
metas,
e.Link{
Href: "./mvp.css",
},
},
},
Body: e.Body{
Values: []e.Element{
title,
e.Hr{},
summery,
e.Hr{},
roadmap,
e.Hr{},
contributer,
e.Hr{},
community,
e.Hr{},
projects,
e.Hr{},
},
},
}
fmt.Println(doc.Parse())
}