summaryrefslogtreecommitdiff
path: root/lib/tag.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tag.rb')
-rw-r--r--lib/tag.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/tag.rb b/lib/tag.rb
new file mode 100644
index 0000000..bad0d01
--- /dev/null
+++ b/lib/tag.rb
@@ -0,0 +1,27 @@
+module Virgil
+ class Tag
+ class << self
+ def doctype
+ "<!DOCTYPE " + yield + ">"
+ end
+ def common(attrs = {})
+ "<#{__callee__}" + Utils.unfold(attrs) + ">" +
+ yield +
+ "</#{__callee__}>"
+ end
+ def common_single(attrs = {})
+ "<#{__callee__}" + Utils.unfold(attrs) + " />"
+ end
+
+ alias :html :common
+ alias :head :common
+ alias :title :common
+ alias :body :common
+ alias :h1 :common
+ alias :p :common
+ alias :img :common_single
+ alias :a :common
+
+ end
+ end
+end