Class: Format::Markdown
- Inherits:
-
Object
- Object
- Format::Markdown
- Defined in:
- lib/diml/format/markdown.rb
Constant Summary collapse
- FORMAT_PREFIXES =
Maintains a map to conserve the translation values of DIML lexicon to markdown prefixes.
{ Point => "*", Heading => "##", Section => "#", Content => "", Root => "" }.freeze
Instance Method Summary collapse
-
#render(elem) ⇒ Object
Returns the element with appropriate.
Instance Method Details
#render(elem) ⇒ Object
Returns the element with appropriate
22 23 24 25 26 27 28 |
# File 'lib/diml/format/markdown.rb', line 22 def render(elem) prefix = FORMAT_PREFIXES[elem.class] raise ArgumentError, "Invalid element: #{elem.class}" if prefix.nil? "#{prefix} #{elem.content}" end |