Class: Source2MD::Formatter::TypeSourceBlock
- Inherits:
-
Base
- Object
- Base
- Source2MD::Formatter::TypeSourceBlock
show all
- Defined in:
- lib/source2md/formatter/type_source_block.rb
Constant Summary
collapse
- OPTION_KEYS =
[
"hidden!",
"data_block_exclude!",
]
Instance Attribute Summary
Attributes inherited from Base
#element
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Class Method Details
.accept?(element) ⇒ Boolean
9
10
11
|
# File 'lib/source2md/formatter/type_source_block.rb', line 9
def self.accept?(element)
element.body.match?(%r{#{RE.meta_re}\+BEGIN_SRC})
end
|
Instance Method Details
#to_md ⇒ Object
13
14
15
16
17
18
|
# File 'lib/source2md/formatter/type_source_block.rb', line 13
def to_md
if option_list.include?("hidden!")
return ""
end
CodeBlock.new(body, desc: clean_descs.join(" ").presence).to_md
end
|