summaryrefslogtreecommitdiff
path: root/example.html.rb
diff options
context:
space:
mode:
authorNathan Lasseter <Nathan Lasseter nathan@bytemark.co.uk>2015-01-21 18:57:31 +0000
committerNathan Lasseter <Nathan Lasseter nathan@bytemark.co.uk>2015-01-21 18:57:31 +0000
commite1d758ddf72d7d8cd29bb0170abcf1397bd67f71 (patch)
treea0192b4dca3ebfdfb343fac5f4e969a5ffec7c2b /example.html.rb
parentfd7ac7c1e6d143d74254c478d6a734da54e83b24 (diff)
Added support for scoped tags
Diffstat (limited to 'example.html.rb')
-rw-r--r--example.html.rb27
1 files changed, 17 insertions, 10 deletions
diff --git a/example.html.rb b/example.html.rb
index ec1cd29..553ef0e 100644
--- a/example.html.rb
+++ b/example.html.rb
@@ -1,26 +1,33 @@
require './lib/virgil'
-include Virgil
+include Virgil::Tags
-puts Tag.doctype {
+puts doctype {
"html"
}
-puts Tag.html {
- Tag.head {
- Tag.title {
+puts comment {
+ "this is neat"
+}
+
+puts html {
+ head {
+ title {
"My Virgil site"
}
} +
- Tag.body {
- Tag.h1 {
+ body {
+ h1 {
"My Virgil site"
} +
- Tag.p({:class => "italic"}) {
+ p({:class => "italic"}) {
"some content"
} +
- Tag.img({:src => "img.jpg"}) +
- Tag.a({"href" => "/"}) {
+ img({:src => "img.jpg"}) +
+ a({"href" => "/"}) {
"A link home"
+ } +
+ map {
+ area {}
}
}
}