Class: Malt::Format::YAML
Overview
YAML format
TODO: hmm… maybe use data to update yaml?
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
-
#html ⇒ Object
Converting a plan YAML file to HTML makes no sense so we just wrap it in
pre
tags. - #to_html ⇒ Object
- #to_yaml ⇒ Object (also: #to_yml)
- #yaml ⇒ Object (also: #yml)
Methods inherited from Abstract
#default, #engine, engine, extensions, #extensions, #file, file_extension, #file_read, #file_type, #parse_type_from_data, #refile, register, #render, #render_into, #rendering_parameters, #scope_vs_data, #subtype, #text, #to, #to_default, #to_s, #type, #with, #with!
Instance Method Details
#html ⇒ Object
Converting a plan YAML file to HTML makes no sense so we just wrap it in pre
tags.
29 30 31 |
# File 'lib/malt/formats/yaml.rb', line 29 def html(*) "<pre>\n#{h text}\n</pre>" end |
#to_html ⇒ Object
34 35 36 37 38 |
# File 'lib/malt/formats/yaml.rb', line 34 def to_html(*) text = html opts = .merge(:text=>text, :file=>refile(:html), :type=>:html) HTML.new(opts) end |
#to_yaml ⇒ Object Also known as: to_yml
21 22 23 |
# File 'lib/malt/formats/yaml.rb', line 21 def to_yaml(*) self end |
#yaml ⇒ Object Also known as: yml
14 15 16 |
# File 'lib/malt/formats/yaml.rb', line 14 def yaml(*) text end |