Sha256: add6c361f9f8a0d36fd36740239595df2bef5d5d6d11c19d18e923e55d2e10be
Contents?: true
Size: 1.79 KB
Versions: 1
Compression:
Stored size: 1.79 KB
Contents
module Hemingway # This is a moronic little class to generate some HTML Tags around # some content. class Build def self.tag(html_attribute, html_content=nil, options={}) String.new.tap do |t| t << "<" + html_attribute t << " id='" + options[:id] + "'" if options[:id] t << " class='" + options[:class] + "'" if options[:class] t << " href='" + options[:href] + "'" if options[:href] t << ">" t << html_content if html_content t << "</" + html_attribute + ">" unless options[:close_tag] == false end end def self.symbol(symbol) latex_sym_to_html[symbol] end private def self.latex_sym_to_html { "\\Gamma" => "Γ", "\\Delta" => "Δ", "\\Theta" => "Θ", "\\Lambda" => "Λ", "\\Xi" => "Ξ", "\\Pi" => "Π", "\\Sigma" => "Σ", "\\Upsilon" => "Υ", "\\Phi" => "Φ", "\\Psi" => "Ψ", "\\Omega" => "Ω", "\\alpha" => "α", "\\beta" => "β", "\\gamma" => "γ", "\\delta" => "δ", "\\epsilon" => "ε", "\\zeta" => "ζ", "\\eta" => "η", "\\theta" => "θ", "\\iota" => "ι", "\\kappa" => "κ", "\\lambda" => "λ", "\\mu" => "μ", "\\nu" => "ν", "\\xi" => "ξ", "\\pi" => "π", "\\rho" => "ρ", "\\varsigma" => "ς", "\\sigma" => "σ", "\\tau" => "τ", "\\upsilon" => "υ", "\\phi" => "φ", "\\chi" => "χ", "\\psi" => "ψ", "\\omega" => "ω" } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hemingway-0.0.2 | lib/hemingway/build.rb |