Skip to content

Hasnep/roc-html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Roc HTML

A library to create HTML in Roc.

Example

This Roc code:

Html.html [] [
    Html.body [] [
        Html.h1 [] [Html.text "Roc"],
        Html.p [] [
            Html.text "You should really check out ",
            Html.a [Attributes.href "https://roc-lang.org/"] [Html.text "Roc"],
            Html.text "!",
        ]
    ]
] |> Html.render

Returns this HTML (give or take a little formatting):

<!doctype html>
<html>
  <body>
    <h1>Roc</h1>
    <p>You should really check out <a href="https://roc-lang.org/">Roc</a>!</p>
  </body>
</html>

Licence

This repository is released under the UPL licence and was mostly written by Brian Carroll. Thanks, Brian!