Module: NotionToMd

Defined in:
lib/notion_to_md.rb,
lib/notion_to_md/page.rb,
lib/notion_to_md/text.rb,
lib/notion_to_md/blocks.rb,
lib/notion_to_md/logger.rb,
lib/notion_to_md/version.rb,
lib/notion_to_md/converter.rb,
lib/notion_to_md/blocks/block.rb,
lib/notion_to_md/blocks/types.rb,
lib/notion_to_md/page_property.rb,
lib/notion_to_md/blocks/builder.rb,
lib/notion_to_md/blocks/factory.rb,
lib/notion_to_md/text_annotation.rb,
lib/notion_to_md/blocks/normalizer.rb,
lib/notion_to_md/blocks/table_block.rb,
lib/notion_to_md/blocks/table_row_block.rb,
lib/notion_to_md/helpers/yaml_sanitizer.rb,
lib/notion_to_md/blocks/to_do_list_block.rb,
lib/notion_to_md/blocks/bulleted_list_block.rb,
lib/notion_to_md/blocks/numbered_list_block.rb,
lib/notion_to_md/blocks/to_do_list_item_block.rb,
lib/notion_to_md/blocks/bulleted_list_item_block.rb,
lib/notion_to_md/blocks/numbered_list_item_block.rb

Defined Under Namespace

Modules: Blocks, Helpers Classes: Converter, Logger, Page, PageProperty, Text, TextAnnotation

Constant Summary collapse

VERSION =
'2.3.1'

Class Method Summary collapse

Class Method Details

.convert(page_id:, token: nil, frontmatter: false) ⇒ Object

Parameters

page_id

A string representing the notion page id.

token

The notion API secret token. The token can replaced by the environment variable NOTION_TOKEN.

frontmatter

A boolean indicating whether to include the page properties as frontmatter.

Returns

The string that represent the markdown document.



29
30
31
# File 'lib/notion_to_md.rb', line 29

def self.convert(page_id:, token: nil, frontmatter: false)
  Converter.new(page_id: page_id, token: token).convert(frontmatter: frontmatter)
end