module IRails::Utils
Public Instance Methods
convert(object, options)
click to toggle source
# File lib/irails/utils.rb, line 3 def convert(object, options) Display.convert(object, options) end
display(obj, options = {})
click to toggle source
# File lib/irails/utils.rb, line 7 def display(obj, options = {}) Kernel.instance.session.send(:publish, :display_data, data: Display.display(obj, options), metadata: {}, source: 'ruby') unless obj.nil? end
html(s)
click to toggle source
# File lib/irails/utils.rb, line 27 def html(s) convert(s, mime: 'text/html') end
javascript(s)
click to toggle source
# File lib/irails/utils.rb, line 31 def javascript(s) convert(s, mime: 'application/javascript') end
latex(s)
click to toggle source
# File lib/irails/utils.rb, line 18 def latex(s) convert(s, mime: 'text/latex') end
Also aliased as: tex
math(s)
click to toggle source
# File lib/irails/utils.rb, line 23 def math(s) convert("$$#{s}$$", mime: 'text/latex') end
svg(s)
click to toggle source
# File lib/irails/utils.rb, line 35 def svg(s) convert(s, mime: 'image/svg+xml') end
table(s, **options)
click to toggle source
# File lib/irails/utils.rb, line 14 def table(s, **options) html(HTML.table(s, options)) end