Module: NotionToHtml

Extended by:
Dry::Configurable
Defined in:
lib/notion_to_html/page.rb,
lib/notion_to_html.rb,
lib/notion_to_html/service.rb,
lib/notion_to_html/version.rb,
lib/notion_to_html/base_page.rb,
lib/notion_to_html/renderers.rb,
lib/notion_to_html/base_block.rb

Overview

The NotionToHtml::BaseBlock class represents a block in a Notion page, handling its attributes and rendering. This class processes the raw data of a block fetched from the Notion API and makes it accessible through various attributes. It also provides methods to render formatted output for different block types like paragraphs, headings, lists, quotes, and media.

Defined Under Namespace

Modules: Renderers Classes: BaseBlock, BasePage, Page, Service

Constant Summary collapse

VERSION =

The current version of the NotionToHtml gem.

'1.3.1'

Instance Attribute Summary collapse

Instance Attribute Details

#cache_storeActiveSupport::Cache::Store

Returns The cache store used to cache responses from the Notion API.

Returns:

  • (ActiveSupport::Cache::Store)

    The cache store used to cache responses from the Notion API.



49
# File 'lib/notion_to_html.rb', line 49

setting :cache_store, default: ActiveSupport::Cache::MemoryStore.new

#notion_api_tokenString

Returns The API token used to authenticate requests to the Notion API.

Returns:

  • (String)

    The API token used to authenticate requests to the Notion API.



16
# File 'lib/notion_to_html.rb', line 16

setting :notion_api_token

#notion_database_idString

Returns The database ID in Notion that the module will interact with.

Returns:

  • (String)

    The database ID in Notion that the module will interact with.



20
# File 'lib/notion_to_html.rb', line 20

setting :notion_database_id

#notion_default_max_retriesInteger

Returns The maximum number of times to retry failed API requests.

Examples:

config.notion_default_max_retries = 3 # Retry failed requests up to 3 times

Returns:

  • (Integer)

    The maximum number of times to retry failed API requests.



38
# File 'lib/notion_to_html.rb', line 38

setting :notion_default_max_retries, default: 5

#notion_default_page_sizeInteger

Returns The default number of records to return per page when making paginated requests.

Examples:

config.notion_default_page_size = 50 # Return 50 records per page

Returns:

  • (Integer)

    The default number of records to return per page when making paginated requests.



32
# File 'lib/notion_to_html.rb', line 32

setting :notion_default_page_size, default: 100

#notion_default_retry_afterInteger

Returns The number of seconds to wait between retry attempts for failed API requests.

Examples:

config.notion_default_retry_after = 5 # Wait 5 seconds between retries

Returns:

  • (Integer)

    The number of seconds to wait between retry attempts for failed API requests.



44
# File 'lib/notion_to_html.rb', line 44

setting :notion_default_retry_after, default: 10

#notion_timeoutInteger

Returns The number of seconds to wait for a response from the Notion API before timing out.

Examples:

config.notion_timeout = 60 # Wait up to 60 seconds for API responses

Returns:

  • (Integer)

    The number of seconds to wait for a response from the Notion API before timing out.



26
# File 'lib/notion_to_html.rb', line 26

setting :notion_timeout, default: 30