notion_to_md 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -2
- data/lib/notion_to_md/block.rb +1 -2
- data/lib/notion_to_md/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b11e8415fbf22af0f2a346cdb5e5ed5fd79cf3736f37d2d047d8d11bf1b4e362
|
4
|
+
data.tar.gz: 57b5b92fb1a01faa5334c85926742e50682553d44c5ef3d96c5b7278ca27a70f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 501c58bec83d950a0f7a1c69da2ff542d00745704c3557aea0b159fd87a587702def108b174915ec6beabb5b67509fbc790491493644e4be9859079fcd5ffb99
|
7
|
+
data.tar.gz: fc5cf12e22528194b2a877333b73c0d28ed1d76f19a49e204a002bff0ceee60654935009d09155b57b391e463e792522cf29e027d5e565326ae46c3f8bb7f966
|
data/README.md
CHANGED
@@ -40,8 +40,24 @@ md = notion_converter.convert
|
|
40
40
|
|
41
41
|
And that's all. The `md` is a string variable containing the notion page formatted in markdown.
|
42
42
|
|
43
|
+
## Blocks
|
43
44
|
|
44
|
-
|
45
|
+
Everything in a notion page body is a [block object](https://developers.notion.com/reference/block#block-object-keys). Therefore, not every type can be mapped to Markdown. Below there's a list of current supported blocks types.
|
46
|
+
|
47
|
+
* `paragraph`
|
48
|
+
* `heading_1`
|
49
|
+
* `heading_2`
|
50
|
+
* `heading_3`
|
51
|
+
* `bulleted_list_item`
|
52
|
+
* `numbered_list_item` as `bulleted_list_item`
|
53
|
+
* `to_do`
|
54
|
+
* `image`
|
55
|
+
* `bookmark`
|
56
|
+
* `callout`
|
57
|
+
* `quote`
|
58
|
+
* `divider`
|
59
|
+
|
60
|
+
## Front matter
|
45
61
|
|
46
62
|
From version 0.2.0, notion_to_md supports front matter in markdown files.
|
47
63
|
|
@@ -51,7 +67,7 @@ By default, the front matter section is not included to the document. To do so,
|
|
51
67
|
NotionToMd::Converter.new(page_id: 'b91d5...').convert(frontmatter: tue)
|
52
68
|
```
|
53
69
|
|
54
|
-
Default notion properties are page `id`, `title`, `created_time`, `last_edited_time`, `icon`, `archived` and `cover`.
|
70
|
+
Default notion [properties](https://developers.notion.com/reference/property-object) are page `id`, `title`, `created_time`, `last_edited_time`, `icon`, `archived` and `cover`.
|
55
71
|
|
56
72
|
```yml
|
57
73
|
---
|
data/lib/notion_to_md/block.rb
CHANGED
@@ -33,7 +33,6 @@ module NotionToMd
|
|
33
33
|
"- #{convert_text(block)}"
|
34
34
|
end
|
35
35
|
|
36
|
-
# TODO: numbered_list_item
|
37
36
|
def numbered_list_item(block)
|
38
37
|
Logger.info('numbered_list_item type not supported. Shown as bulleted_list_item.')
|
39
38
|
bulleted_list_item(block)
|
@@ -50,7 +49,7 @@ module NotionToMd
|
|
50
49
|
language = block[:language]
|
51
50
|
text = convert_text(block)
|
52
51
|
|
53
|
-
"```#{language}\n
|
52
|
+
"```#{language}\n#{text}\n```"
|
54
53
|
end
|
55
54
|
|
56
55
|
def embed(block)
|
data/lib/notion_to_md/version.rb
CHANGED
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.
|
4
|
+
version: 1.1.1
|
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-
|
11
|
+
date: 2022-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|