Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.

Strrationalism/FSharpHTML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FSharpHTML

The DSL for generating HTML Document.

NuGet Badge

Example

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,&nbsp;world!</title>
    </head>
    <body>
        <div>
            &lt;This&nbsp;is&nbsp;a&nbsp;test&nbsp;page&gt;
            ???
        </div>
        <img
            src="demo.png"
            width="100"
            height="50" />
        <a href="example.com">Click&nbsp;to&nbsp;example.com</a>
    </body>
</html>

About

The DSL for generating HTML Document.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages