Method: NotionToHtml::Service.get_pages

Defined in:
lib/notion_to_html/service.rb

.get_pages(name: nil, description: nil, tag: nil, slug: nil, page_size: 10) ⇒ Array<NotionToHtml::BasePage>

Fetches a list of pages from Notion based on provided filters

Parameters:

  • name (String, nil) (defaults to: nil)

    The name to filter pages by, or nil to not filter

  • description (String, nil) (defaults to: nil)

    The description to filter pages by, or nil not filter

  • tag (String, nil) (defaults to: nil)

    The tag to filter pages by, or nil to include all tags

  • slug (String, nil) (defaults to: nil)

    The slug to filter pages by, or nil to include all slugs

  • page_size (Integer) (defaults to: 10)

    The number of pages to fetch per page

Returns:



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/notion_to_html/service.rb', line 85

def get_pages(name: nil, description: nil, tag: nil, slug: nil, page_size: 10)
  __get_pages(
    name: name,
    description: description,
    tag: tag,
    slug: slug,
    page_size: page_size
  )['results'].map do |page|
    NotionToHtml::BasePage.new(page)
  end
end