module MetaRuby::GUI::HTML

Basic functionality to generate HTML pages

The core functionality is in {Page}

Constants

RESSOURCES_DIR

The directory relative to which ressources (such as css or javascript files) are resolved by default

Public Class Methods

escape_html(string) click to toggle source

Escape the string to include in HTML

@param [String] string @return [String]

# File lib/metaruby/gui/html.rb, line 16
def self.escape_html(string)
    string.
        gsub('<', '&lt;').
        gsub('>', '&gt;')
end
render_button_bar(buttons) click to toggle source

Render a button bar into HTML

@param [Array<Button>] buttons @return [String]

# File lib/metaruby/gui/html/button.rb, line 99
def self.render_button_bar(buttons)
    if !buttons.empty?
        "<div class=\"button_bar\"><span>#{buttons.map(&:render).join(" / ")}</span></div>"
    end
end