notion_to_md 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b11e8415fbf22af0f2a346cdb5e5ed5fd79cf3736f37d2d047d8d11bf1b4e362
4
- data.tar.gz: 57b5b92fb1a01faa5334c85926742e50682553d44c5ef3d96c5b7278ca27a70f
3
+ metadata.gz: 4e623e752d6bbe53643139220d1f47f17ca411298a985bb2889a69d6dc9070d3
4
+ data.tar.gz: 03631f5fb4b9d8a5e3faa4cce66d14bd89e65bc42bf62b22b90f267456b40f14
5
5
  SHA512:
6
- metadata.gz: 501c58bec83d950a0f7a1c69da2ff542d00745704c3557aea0b159fd87a587702def108b174915ec6beabb5b67509fbc790491493644e4be9859079fcd5ffb99
7
- data.tar.gz: fc5cf12e22528194b2a877333b73c0d28ed1d76f19a49e204a002bff0ceee60654935009d09155b57b391e463e792522cf29e027d5e565326ae46c3f8bb7f966
6
+ metadata.gz: cd44a229e6e53a802008bde4e7791087c9fe92172d7ce30f575e1cc31d3a268c1f2b17ffb2502a2436ec815eea5e55bfecebb8dcf25dc9d03d783818a899e411
7
+ data.tar.gz: a7e89786e1e35a23d946c5ae877051259f9496997fd6ea8fe8b1bf32b6cefe0ce10e197c38d5dabc21951d6b3a54b249eeac63c9223c484939290dcde950736c
data/README.md CHANGED
@@ -67,7 +67,7 @@ By default, the front matter section is not included to the document. To do so,
67
67
  NotionToMd::Converter.new(page_id: 'b91d5...').convert(frontmatter: tue)
68
68
  ```
69
69
 
70
- Default notion [properties](https://developers.notion.com/reference/property-object) are page `id`, `title`, `created_time`, `last_edited_time`, `icon`, `archived` and `cover`.
70
+ Default notion [properties](https://developers.notion.com/reference/page#all-pages) are page `id`, `title`, `created_time`, `last_edited_time`, `icon`, `archived` and `cover`.
71
71
 
72
72
  ```yml
73
73
  ---
@@ -80,14 +80,14 @@ module NotionToMd
80
80
  end
81
81
 
82
82
  def convert_text(block)
83
- block[:text].map do |text|
83
+ block[:rich_text].map do |text|
84
84
  content = Text.send(text[:type], text)
85
85
  enrich_text_content(text, content)
86
86
  end.join
87
87
  end
88
88
 
89
89
  def convert_caption(block)
90
- convert_text(text: block[:caption])
90
+ convert_text(rich_text: block[:caption])
91
91
  end
92
92
 
93
93
  def get_icon(block)
@@ -20,11 +20,11 @@ module NotionToMd
20
20
  private
21
21
 
22
22
  def page
23
- @page ||= @notion.page(id: page_id)
23
+ @page ||= @notion.page(page_id: page_id)
24
24
  end
25
25
 
26
26
  def page_blocks
27
- @page_blocks ||= @notion.block_children(id: page_id)
27
+ @page_blocks ||= @notion.block_children(block_id: page_id)
28
28
  end
29
29
  end
30
30
  end
@@ -45,7 +45,7 @@ module NotionToMd
45
45
 
46
46
  def body
47
47
  @body ||= blocks[:results].map do |block|
48
- next Block.blank if block[:type] == 'paragraph' && block.dig(:paragraph, :text).empty?
48
+ next Block.blank if block[:type] == 'paragraph' && block.dig(:paragraph, :rich_text).empty?
49
49
 
50
50
  block_type = block[:type].to_sym
51
51
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NotionToMd
4
- VERSION = '1.1.1'
4
+ VERSION = '1.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notion_to_md
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Enrique Arias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-17 00:00:00.000000000 Z
11
+ date: 2022-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '6'
19
+ version: '7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '6'
26
+ version: '7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: notion-ruby-client
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.8
33
+ version: '1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.8
40
+ version: '1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hashie
43
43
  requirement: !ruby/object:Gem::Requirement