silly-stuff/odin-templating
2024-09-11 21:05:27 -04:00
..
html_builder.odin Add Odin templating and Z80Disasm 2024-09-11 21:05:27 -04:00
main.odin Add Odin templating and Z80Disasm 2024-09-11 21:05:27 -04:00
README.md Add Odin templating and Z80Disasm 2024-09-11 21:05:27 -04:00

HTML Templates in Odin

	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")}
			{text("")}
		}
	}
<html> <head> </head>

Hello, world!

Goodbye, world!
Yo, what's up!
don't be eeeviiiilll This link has a class called 'button'
green texture
Random text
</html>