Class: Livetext::Functions

Inherits:
Object
  • Object
show all
Defined in:
lib/liveblog.rb,
lib/liveblog.rb

Overview

experimental…

Instance Method Summary collapse

Instance Method Details

#_var(name) ⇒ Object



269
270
271
# File 'lib/liveblog.rb', line 269

def _var(name)
  ::Livetext::Vars[name] || "[:#{name} is undefined]"
end

#br(n = "1") ⇒ Object



242
243
244
245
246
247
# File 'lib/liveblog.rb', line 242

def br(n="1")
  # Thought: Maybe make a way for functions to "simply" call the
  #   dot command of the same name?? Is this trivial??
  n = n.empty? ? 1 : n.to_i
  "<br>"*n
end

#h1(param) ⇒ Object



249
# File 'lib/liveblog.rb', line 249

def h1(param); "<h1>#{param}</h1>"; end

#h2(param) ⇒ Object



250
# File 'lib/liveblog.rb', line 250

def h2(param); "<h2>#{param}</h2>"; end

#h3(param) ⇒ Object



251
# File 'lib/liveblog.rb', line 251

def h3(param); "<h3>#{param}</h3>"; end

#h4(param) ⇒ Object



252
# File 'lib/liveblog.rb', line 252

def h4(param); "<h4>#{param}</h4>"; end

#h5(param) ⇒ Object



253
# File 'lib/liveblog.rb', line 253

def h5(param); "<h5>#{param}</h5>"; end

#h6(param) ⇒ Object



254
# File 'lib/liveblog.rb', line 254

def h6(param); "<h6>#{param}</h6>"; end

#hr(param = nil) ⇒ Object



256
257
258
# File 'lib/liveblog.rb', line 256

def hr(param=nil)
  $Dot.hr
end

#image(param) ⇒ Object



260
261
262
# File 'lib/liveblog.rb', line 260

def image(param)
  "<img src='#{param}'></img>"
end


273
274
275
276
# File 'lib/liveblog.rb', line 273

def link
  file, cdata = self.class.param.split("||", 2)
  %[<link type="application/atom+xml" rel="alternate" href="#{_var(:host)}#{file}" title="#{_var(:title)}">]
end