Borges::HtmlBuilder (Class)

In: lib/Borges/HTML/HtmlBuilder.rb
Parent: Object

Borges::HTMLBuilder is a generic class for outputting HTML.

Constants

HTML_CHARACTERS = {}

Attributes

attributes  [R] 
document  [RW] 

Public Class methods

Public Instance methods

Turn an object into a string and encode it with HTML entities.

encode_text("foo > bar")

foo > bar

Create a level 1 heading

heading("My Heading")

<h1>My Heading</h1>

Create a heading with level

heading_level("My Heading", 2)

<h2>My Heading</h2>

Build an unordered list of items from an Enumerable. text will be called on each item.

list(["x", 5, { :x => :y }])

<ul><li>x<li>5<li>xy</ul>

Build an unordered list of items from an Enumerable. The given block will be called on each item.

See also list

Create a table element

Create a table header cell

Create a table heading row

Create an empty table row

Create a table row that spans multiple columns

Create a table row containing a single data cell

Turn an object into a string. It is not recommened to use this method to dump raw HTML.

text("hello world")

hello world

[Validate]