notion_to_html 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/notion_to_html/base_page.rb +1 -1
- data/lib/notion_to_html/service.rb +7 -1
- data/lib/notion_to_html/version.rb +1 -1
- data/lib/notion_to_html.rb +24 -0
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0a725c2b4c8edf857d22bd6d5a36dac0070315fcc06d904eaf912872b4f0190
|
4
|
+
data.tar.gz: 75c02f3ce2e0ee02c3eba90d1a5700f5c94f4ebec3c767c5b6cea7b83c835d95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49f654328d48672b453f175608bef664193c96e76e246c20c68b4c4cacabe09a50e5ecbca8702556793b32de7ed6cc5a67bf228ebb8c90fdd7d1dac995861e37
|
7
|
+
data.tar.gz: 9ed524bf834093884e7bba25a4d7b4e8ef3fd76701595e1b26246f685c6862f61beb9cdba21b33995dc8ab88fffdbf0b5a57487f2e2a39a356ffd0b26fe4e1f8
|
@@ -87,7 +87,7 @@ module NotionToHtml
|
|
87
87
|
def process_properties
|
88
88
|
@tags = @properties['tags']
|
89
89
|
@title = @properties.dig('name', 'title')
|
90
|
-
@slug = @properties
|
90
|
+
@slug = @properties.dig('slug', 'rich_text').first['plain_text']
|
91
91
|
@published_at = @properties.dig('published', 'date', 'start')
|
92
92
|
@description = @properties.dig('description', 'rich_text')
|
93
93
|
end
|
@@ -149,7 +149,13 @@ module NotionToHtml
|
|
149
149
|
# Accessor for the client
|
150
150
|
# @return [Notion::Client] The client instance used to interact with the Notion API
|
151
151
|
def client
|
152
|
-
@client ||= Notion::Client.new(
|
152
|
+
@client ||= Notion::Client.new(
|
153
|
+
token: NotionToHtml.config.notion_api_token,
|
154
|
+
timeout: NotionToHtml.config.notion_timeout,
|
155
|
+
default_page_size: NotionToHtml.config.notion_default_page_size,
|
156
|
+
default_max_retries: NotionToHtml.config.notion_default_max_retries,
|
157
|
+
default_retry_after: NotionToHtml.config.notion_default_retry_after
|
158
|
+
)
|
153
159
|
end
|
154
160
|
|
155
161
|
# Retrieves pages from Notion using the client
|
data/lib/notion_to_html.rb
CHANGED
@@ -19,6 +19,30 @@ module NotionToHtml
|
|
19
19
|
# @return [String] The database ID in Notion that the module will interact with.
|
20
20
|
setting :notion_database_id
|
21
21
|
|
22
|
+
# @!attribute [rw] notion_timeout
|
23
|
+
# @return [Integer] The number of seconds to wait for a response from the Notion API before timing out.
|
24
|
+
# @example
|
25
|
+
# config.notion_timeout = 60 # Wait up to 60 seconds for API responses
|
26
|
+
setting :notion_timeout, default: 30
|
27
|
+
|
28
|
+
# @!attribute [rw] notion_default_page_size
|
29
|
+
# @return [Integer] The default number of records to return per page when making paginated requests.
|
30
|
+
# @example
|
31
|
+
# config.notion_default_page_size = 50 # Return 50 records per page
|
32
|
+
setting :notion_default_page_size, default: 100
|
33
|
+
|
34
|
+
# @!attribute [rw] notion_default_max_retries
|
35
|
+
# @return [Integer] The maximum number of times to retry failed API requests.
|
36
|
+
# @example
|
37
|
+
# config.notion_default_max_retries = 3 # Retry failed requests up to 3 times
|
38
|
+
setting :notion_default_max_retries, default: 5
|
39
|
+
|
40
|
+
# @!attribute [rw] notion_default_retry_after
|
41
|
+
# @return [Integer] The number of seconds to wait between retry attempts for failed API requests.
|
42
|
+
# @example
|
43
|
+
# config.notion_default_retry_after = 5 # Wait 5 seconds between retries
|
44
|
+
setting :notion_default_retry_after, default: 10
|
45
|
+
|
22
46
|
# @!attribute [rw] cache_store
|
23
47
|
# @return [ActiveSupport::Cache::Store] The cache store used to cache responses from the Notion API.
|
24
48
|
# @default ActiveSupport::Cache::MemoryStore.new
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notion_to_html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillermo Aguirre
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2024-
|
10
|
+
date: 2024-12-30 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: actionview
|
@@ -100,7 +99,6 @@ licenses:
|
|
100
99
|
metadata:
|
101
100
|
homepage_uri: https://github.com/guillermoap/notion_to_html
|
102
101
|
source_code_uri: https://github.com/guillermoap/notion_to_html
|
103
|
-
post_install_message:
|
104
102
|
rdoc_options: []
|
105
103
|
require_paths:
|
106
104
|
- lib
|
@@ -115,8 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
113
|
- !ruby/object:Gem::Version
|
116
114
|
version: '0'
|
117
115
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
119
|
-
signing_key:
|
116
|
+
rubygems_version: 3.6.2
|
120
117
|
specification_version: 4
|
121
118
|
summary: Notion HTML renderer for Ruby
|
122
119
|
test_files: []
|