19 lines
304 B
Go
19 lines
304 B
Go
|
package compiler
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
// THE HYLIA COMPILER
|
||
|
|
||
|
func Compile(elements []string) (string, error) {
|
||
|
html := "<!DOCTYPE html>\n<html>\n<body>\n"
|
||
|
|
||
|
// Take the elements into HTML
|
||
|
for _, element := range elements {
|
||
|
html += element + "\n"
|
||
|
}
|
||
|
|
||
|
html += "</body>\n</html>"
|
||
|
return html, nil
|
||
|
}
|