Skip to content

Commit

Permalink
Merge pull request #14 from Hasnep/add-example
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasnep authored Nov 28, 2024
2 parents f342a08 + 4ca070d commit 328f4fe
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.gitignore
!*.roc
22 changes: 22 additions & 0 deletions examples/example.roc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
app [main] {
cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.17.0/lZFLstMUCUvd5bjnnpYromZJXkQUrdhbva4xdBInicE.tar.br",
html: "../src/main.roc",
}

import cli.Stdout
import html.Html
import html.Attribute

main =
page = Html.html [] [
Html.body [] [
Html.h1 [] [Html.text "Roc"],
Html.p [] [
Html.text "My favourite language is ",
Html.a [Attribute.href "https://roc-lang.org/"] [Html.text "Roc"],
Html.text "!",
],
],
]
renderedHtml = Html.render page
Stdout.line renderedHtml

0 comments on commit 328f4fe

Please sign in to comment.