Add Odin templating and Z80Disasm
This commit is contained in:
46
odin-templating/main.odin
Normal file
46
odin-templating/main.odin
Normal file
@@ -0,0 +1,46 @@
|
||||
package html_builder
|
||||
|
||||
import "core:fmt"
|
||||
import "core:strings"
|
||||
|
||||
main :: proc() {
|
||||
page := html()
|
||||
{head()
|
||||
{title("HTML Title")}
|
||||
}
|
||||
{body()
|
||||
{div()
|
||||
class("container")
|
||||
{div()
|
||||
class("article")
|
||||
{h1("Hello, world!")}
|
||||
{h6("Goodbye, world!")}
|
||||
{
|
||||
{div()
|
||||
attr("aria-data", "idk!")
|
||||
text("Yo, what's up!")
|
||||
}
|
||||
{div()
|
||||
{a("don't be eeeviiiilll", "http://google.com")}
|
||||
{a("This link has a class called 'button'")
|
||||
class("button")}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{img("background.png", "green texture")
|
||||
class("img")
|
||||
}
|
||||
{div()
|
||||
id("lol")
|
||||
class("hello")
|
||||
}
|
||||
{text("Random text")}
|
||||
}
|
||||
}
|
||||
|
||||
defer free_html(page)
|
||||
sb: strings.Builder
|
||||
fmt.println(element_to_string(&sb, page^))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user