# The Bitmap class represents a 24-bit bitmap image. An instance can be constructed
# by calling load or with_size:
#
-# new Bitmap.load(path_to_a_bmp_file)
-# new Bitmap.with_size(400, 300)
+# ~~~nitish
+# var bm1 = new Bitmap.load(path_to_a_bmp_file)
+# var bm2 = new Bitmap.with_size(400, 300)
+# ~~~
#
# The width and height attributes contain the image's width and height,
# respectively.
#
# Individual pixels can be manipulated by calling the set_pixel function:
#
+# ~~~nitish
# set_pixel(x, y, color)
+# ~~~
#
# The no-argument grayscale function converts the bitmap to grayscale and is an
# implementation of this Rossetacode task:
#
# Finally, the bitmap can be saved to a file by calling save:
#
+# ~~~nitish
# save(path_to_a_file)
+# ~~~
#
# For information on the bitmap format, see
# http://en.wikipedia.org/wiki/BMP_file_format
#
# Say we have "fuckingbehemoth".railfence(4)
#
- # This happens in-memory :
- # f.....g.....o..
- # .u...n.b...m.t.
- # ..c.i...e.e...h
- # ...k.....h.....
+ # This happens in-memory:
+ #
+ # ~~~raw
+ # f.....g.....o..
+ # .u...n.b...m.t.
+ # ..c.i...e.e...h
+ # ...k.....h.....
+ # ~~~
#
# Therefore, yielding the ciphertext : "fgounbmtcieehkh"
#
#
# You can define subclass and override methods head and body
#
+# ~~~nitish
# class MyPage
# super HTMLPage
# redef body do add("p").text("Hello World!")
# end
+# ~~~
#
# HTMLPage use fluent interface so you can chain calls as:
-# add("div").attr("id", "mydiv").text("My Div")
+#
+# ~~~nitish
+# add("div").attr("id", "mydiv").text("My Div")
+# ~~~
class HTMLPage
super Writable
end
# Add a html tag to the current element
+ #
+ # ~~~nitish
# add("div").attr("id", "mydiv").text("My Div")
+ # ~~~
fun add(tag: String): HTMLTag do
var node = new HTMLTag(tag)
current.add(node)
end
# Add a raw html string
+ #
+ # ~~~nitish
# add_html("<a href='#top'>top</a>")
+ # ~~~
fun add_html(html: String) do current.add(new HTMLRaw("", html))
# Open a html tag
+ #
+ # ~~~nitish
# open("ul")
# add("li").text("item1")
# add("li").text("item2")
# close("ul")
+ # ~~~
fun open(tag: String): HTMLTag do
stack.push(current)
current = add(tag)