Skip to content

Commit

Permalink
updated examples to current syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nirokay committed Sep 26, 2024
1 parent a7ac674 commit c9e6394
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/basic/basic.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import websitegenerator

var html: HtmlDocument = newDocument("basic.html")
var html: HtmlDocument = newHtmlDocument("basic.html")

html.addToBody(
h1("Basic webpage"),
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_with_css/basic_with_css.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import websitegenerator

var
html: HtmlDocument = newDocument("basic_with_css.html")
html: HtmlDocument = newHtmlDocument("basic_with_css.html")
css: CssStyleSheet = newCssStyleSheet("basic_styles.css")

# Css elements:
Expand Down
6 changes: 3 additions & 3 deletions examples/pain/index.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import std/[strutils]
import websitegenerator

var
html: HtmlDocument = newDocument("index.html")
html: HtmlDocument = newHtmlDocument("index.html")
css: CssStyleSheet = newCssStyleSheet("styles.css")

let
body: CssElement = newCssElement("body",
["color", rgb(0, 255, 0)],
).setBackgroundColour(Magenta)
).setBackgroundColour($Magenta)

painful: CssElement = newCssClass("painful",
["color", "lime"]
Expand All @@ -25,7 +25,7 @@ html.addToBody(
h1("PAIN AND SUFFERING"),
p("I hope you did not open this page in a dark room..."),

dialog(@[
dialog(open = true, @[
h1($b("Dialog box")),
p("very cool! You can only see half of the page now :)")
]).setClass(painful),
Expand Down

0 comments on commit c9e6394

Please sign in to comment.