Class: Source2MD::CodeBlock
- Inherits:
-
Object
- Object
- Source2MD::CodeBlock
- Defined in:
- lib/source2md/code_block.rb
Constant Summary collapse
- PADDING_KEEP =
2
- ARROW_MARK =
%r{(?:#{RE.comment_re}) =>}
Instance Method Summary collapse
-
#initialize(text, options = {}) ⇒ CodeBlock
constructor
A new instance of CodeBlock.
- #to_md ⇒ Object
Constructor Details
#initialize(text, options = {}) ⇒ CodeBlock
Returns a new instance of CodeBlock.
6 7 8 9 10 11 12 13 14 |
# File 'lib/source2md/code_block.rb', line 6 def initialize(text, = {}) @text = text @options = { :desc => nil, :lang => nil, :name => nil, # :single_sharp_replace_to_blank_line => false, }.merge() end |
Instance Method Details
#to_md ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/source2md/code_block.rb', line 16 def to_md [ "```#{code_block_head}\n", normalized_code, "```\n", ].join end |