Skip to content

utshodebravestone/h2tml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

H2tml

HTML Embedded in Haskell.

Examples

Here's what it looks like:

import H2tml.Prelude

main :: IO()
main = writeFile "h2tml.html" (
    render( boilerplate_
            "H2TML"
            [
                h1_ "H2tml",
                children_
                    (p_ "Embedded HTML Language in Haskell inspired from book: ")
                    [
                        (a_
                            "Learn Haskell by building a blog generator"
                            [attribute_ href_ "https://lhbg-book.link/"]
                        )
                    ]
            ]
        )
    )

More examples can be found here.

Why

To write type safe and declarative HTML.

Inspiration

Learn Haskell by building a blog generator.

Run

Setup Haskell if you don't already have it and then run: runghc [ANY_EXAMPLE_FILE] or ghc [ANY_EXAMPLE_FILE] to compile to native executable.