hylia/compiler/compiler.go

19 lines
No EOL
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
}