The DSL for generating HTML Document.
open FSharpHTML
open FSharpHTML.Elements
html [
head [
Meta (Charset "UTF-8")
title %"Hello, world!"
]
body [
div [
Text "<This is a test page>"
Text "???"
]
img [
"src" %= "demo.png"
"width" %= 100
"height" %= 50
]
a [
"href" %= "example.com"
Text "Click to example.com"
]
]
]
|> HTMLDocument
|> string
|> printfn "%s"
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello, world!</title>
</head>
<body>
<div>
<This is a test page>
???
</div>
<img
src="demo.png"
width="100"
height="50" />
<a href="example.com">Click to example.com</a>
</body>
</html>