Class: NotionToMd::Blocks::NumberedListItemBlock
- Inherits:
-
BulletedListItemBlock
- Object
- Block
- BulletedListItemBlock
- NotionToMd::Blocks::NumberedListItemBlock
- Defined in:
- lib/notion_to_md/blocks/numbered_list_item_block.rb
Instance Attribute Summary
Attributes inherited from Block
Instance Method Summary collapse
-
#to_md(tab_width: 0, index: nil) ⇒ Object
Parameters: tab_width:: The number of tabs used to indent the block.
Methods inherited from BulletedListItemBlock
Methods inherited from Block
Constructor Details
This class inherits a constructor from NotionToMd::Blocks::Block
Instance Method Details
#to_md(tab_width: 0, index: nil) ⇒ Object
Parameters:
- tab_width
-
The number of tabs used to indent the block.
- index
-
The index of the block in its parent’s children array used to number the item.
Returns
The current block (and its children) converted to a markdown string.
17 18 19 20 21 22 23 |
# File 'lib/notion_to_md/blocks/numbered_list_item_block.rb', line 17 def to_md(tab_width: 0, index: nil) md = Types.numbered_list_item(block[block.type.to_sym], index) + newline md + build_nested_blocks(tab_width + 1) rescue NoMethodError Logger.info("Unsupported block type: #{block.type}") nil end |