Class: Source2MD::Element
- Inherits:
-
Object
- Object
- Source2MD::Element
- Defined in:
- lib/source2md/element.rb
Constant Summary collapse
- PLUGINS =
[ Formatter::TypeHidden, # #+hidden: true Formatter::TypeEval, # #+eval: Formatter::TypeCodeInclude, # #+code_include: path/to/foo.html xml:SAMPLE.xml Formatter::TypeRawInclude, # #+raw_include: path/to/file.txt Formatter::TypeParseInclude, # #+parse_include: path/to/file.txt Formatter::TypeTitle, # #+title2: foo Formatter::TypeWarn, # #+warn: foo Formatter::TypeAlert, # #+alert: foo Formatter::TypeMethod, # #+name: foo Formatter::TypeTable, # # |- Formatter::TypeSourceBlock, # #+BEGIN_SRC Formatter::TypeText, # # foo Formatter::TypePartialCode, # 1 + 2 # => 3 Formatter::TypeElse, ]
Instance Method Summary collapse
- #body ⇒ Object
- #head ⇒ Object
-
#initialize(content) ⇒ Element
constructor
A new instance of Element.
- #to_md ⇒ Object
Constructor Details
#initialize(content) ⇒ Element
Returns a new instance of Element.
20 21 22 |
# File 'lib/source2md/element.rb', line 20 def initialize(content) @content = content end |
Instance Method Details
#body ⇒ Object
34 35 36 |
# File 'lib/source2md/element.rb', line 34 def body @body ||= @content.remove(key_value_regexp).freeze end |
#head ⇒ Object
30 31 32 |
# File 'lib/source2md/element.rb', line 30 def head @head ||= @content.scan(key_value_regexp).to_h.freeze end |
#to_md ⇒ Object
24 25 26 27 28 |
# File 'lib/source2md/element.rb', line 24 def to_md object = support_klass.new(self) debug_log(object) object.to_md end |