Skip to content
This repository was archived by the owner on Nov 14, 2021. It is now read-only.

Commit ba3c9cb

Browse files
authored
feat: Get metadata from notion properties & Order collection properties (#27)
* feat: Append metadata * feat: Order collection properties * docs: Add metadata * chore: Change default of append created time * docs: Update README.md * docs: Update README.md * feat: Append icon & cover
1 parent ae72128 commit ba3c9cb

File tree

53 files changed

+530
-389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+530
-389
lines changed

README.md

Lines changed: 41 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -86,45 +86,37 @@ Create `narkdown.config.json` and run `python3 -m narkdown` in that directory.
8686
"exportConfig": {
8787
"recursiveExport": true,
8888
"createPageDirectory": true,
89-
"addMetadata": false,
90-
"lowerPathname": false,
91-
"lowerFilename": false,
92-
"lineBreak": false
89+
"addMetadata": true,
90+
"appendCreatedTime": true
9391
},
9492
"databaseConfig": {
9593
"categoryColumnName": "Category",
96-
"tagsColumnName": "Tags",
97-
"createdTimeColumnName": "Created Time",
9894
"statusColumnName": "Status",
9995
"currentStatus": "✅ Completed",
10096
"nextStatus": "🖨 Published"
10197
}
10298
}
10399
```
104100

105-
### Export Config
101+
<br />
106102

107-
| Name | Description | Default |
108-
| --------------------- | -------------------------------------------------------------------------------- | ------- |
109-
| `recursiveExport` | Whether or not to recursively export child page. | `true` |
110-
| `createPageDirectory` | Whether or not to create subdirectories with page titles for each page. | `true` |
111-
| `addMetadata` | Whether or not to add metadata to content. | `false` |
112-
| `lowerPathname` | Whether or not to make pathname to lowercase. | `false` |
113-
| `lowerFilename` | Whether or not to make filename to lowercase. | `false` |
114-
| `lineBreak` | Whether or not to convert empty blocks of notion to line break tag. ( `<br />` ) | `false` |
103+
| Name | Description | Default |
104+
| --------------------- | ------------------------------------------------------------------------------------------------- | --------- |
105+
| `recursiveExport` | Whether or not to recursively export child page. | [`true`] |
106+
| `createPageDirectory` | Whether or not to create subdirectories with page titles for each page. | [`true`] |
107+
| `addMetadata` | Whether or not to add metadata to content. | [`false`] |
108+
| `a`ppendCreatedTime | Whether or not to append created time to filename. ( The page must have a created time property.) | [`false`] |
115109

116-
### Database Config
110+
<br />
117111

118-
| Name | Description | Default |
119-
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
120-
| `categoryColumnName` | In Notion database, content can be classified by category by `select` property. When you create the `select` property in the Notion database and pass the name of the column, folders are created by category. | `""` |
121-
| `tagsColumnName` | In the Notion database, you can tag content with `Multi Select` property. If you create a `Multi Select` property in the Notion database and pass the name of the column, then meta data will be insterted to contents. (should set `addMetadata` to True.) | `""` |
122-
| `createdTimeColumnName` | In the Notion database, you can manage created time of content with `Created Time` property. If you create a `Created Time` property in the Notion database and pass the name of the column, you can add created time to filename. (e.g. `2020-12-02-some-title.md` ) | `""` |
123-
| `statusColumnName` | In the Notion database, you can manage the status of content with `Select` property. If you create a `Select` property in the Notion database and pass the name of the column, you can import contents in a specific state or change the status of the content. (should be used with the `currentStatus` or `nextStatus` option.) | `""` |
124-
| `currentStatus` | Import only the content that corresponds to `currentStatus` value. ( `statusColumnName` must be set.) | `""` |
125-
| `nextStatus` | Changes content status to `nextStatus` value after import. ( `statusColumnName` must be set.) | `""` |
112+
| Name | Description | Default |
113+
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
114+
| `categoryColumnName` | In Notion database, content can be classified by category by `select` property. When you create the `select` property in the Notion database and pass the name of the column, folders are created by category. | [`""`] |
115+
| `statusColumnName` | In the Notion database, you can manage the status of content with `Select` property. If you create a `Select` property in the Notion database and pass the name of the column, you can import contents in a specific state or change the status of the content. (should be used with the `currentStatus` or `nextStatus` option.) | [`""`] |
116+
| `currentStatus` | Import only the content that corresponds to `currentStatus` value. ( `statusColumnName` must be set.) | [`""`] |
117+
| `nextStatus` | Changes content status to `nextStatus` value after import. ( `statusColumnName` must be set.) | [`""`] |
126118

127-
### Set env variable for `token_v2`
119+
#### Set env variable for `token_v2`
128120

129121
The `token_v2` of notion is a variable that should not be shared. You can use os environment variable for notion token.
130122

@@ -138,30 +130,30 @@ Github action to synchronize the content of the notion database with github.
138130

139131
## Supported Blocks
140132

141-
| Block Type | Supported | Notes |
142-
| -------------------- | ---------- | ----------------------------------------------------------------------------------------------- |
143-
| Heading 1 | ✅ Yes | [Converted to heading 2 in markdown.](https://www.notion.so/11acfd542ee84640b3fb1782ce9b8caa) |
144-
| Heading 2 | ✅ Yes | [Converted to heading 3 in markdown.](https://www.notion.so/11acfd542ee84640b3fb1782ce9b8caa) |
145-
| Heading 3 | ✅ Yes | [Converted to heading 4 in markdown.](https://www.notion.so/11acfd542ee84640b3fb1782ce9b8caa) |
146-
| Text | ✅ Yes | |
147-
| Divider | ✅ Yes | Divider after the Heading 1 is not added. |
148-
| Callout | ✅ Yes | Callout block will be exported as quote block with emoji. |
149-
| Quote | ✅ Yes | |
150-
| Bulleted list | ✅ Yes | Support nested block. |
151-
| Numbered list | ✅ Yes | Support nested block. |
152-
| To-do list | ✅ Yes | Support nested block. |
153-
| Toggle list | ✅ Yes | Support nested block. |
154-
| Code | ✅ Yes | Support syntax highlighting. |
155-
| Image | ✅ Yes | Uploaded image will be downloaded to local. Linked image will be linked not be downloaded. |
156-
| Web bookmark | ✅ Yes | Same as link text. |
157-
| Page | ✅ Yes | Import "Child page" in Notion page recursively. And import "Linked page" as a Notion page link. |
158-
| Table (aka database) | ⚠️ Partial | ⚠️ The sequence of columns is not guaranteed. |
159-
| Video | ❌ No | |
160-
| Audio | ❌ No | |
161-
| File | ❌ No | |
162-
| Embed other services | ❌ No | |
163-
| Advanced | ❌ No | |
164-
| Layout in page | ❌ No | |
133+
| Block Type | Supported | Notes |
134+
| -------------------- | --------- | ----------------------------------------------------------------------------------------------- |
135+
| Heading 1 | ✅ Yes | [Converted to heading 2 in markdown.](https://www.notion.so//11acfd542ee84640b3fb1782ce9b8caa) |
136+
| Heading 2 | ✅ Yes | [Converted to heading 3 in markdown.](https://www.notion.so//11acfd542ee84640b3fb1782ce9b8caa) |
137+
| Heading 3 | ✅ Yes | [Converted to heading 4 in markdown.](https://www.notion.so//11acfd542ee84640b3fb1782ce9b8caa) |
138+
| Text | ✅ Yes | |
139+
| Divider | ✅ Yes | Divider after the Heading 1 is not added. |
140+
| Callout | ✅ Yes | Callout block will be exported as quote block with emoji. |
141+
| Quote | ✅ Yes | |
142+
| Bulleted list | ✅ Yes | Support nested block. |
143+
| Numbered list | ✅ Yes | Support nested block. |
144+
| To-do list | ✅ Yes | Support nested block. |
145+
| Toggle list | ✅ Yes | Support nested block. |
146+
| Code | ✅ Yes | Support syntax highlighting. |
147+
| Image | ✅ Yes | Uploaded image will be downloaded to local. Linked image will be linked not be downloaded. |
148+
| Web bookmark | ✅ Yes | Same as link text. |
149+
| Page | ✅ Yes | Import "Child page" in Notion page recursively. And import "Linked page" as a Notion page link. |
150+
| Table (aka database) | ✅ Yes | |
151+
| Video | ❌ No | |
152+
| Audio | ❌ No | |
153+
| File | ❌ No | |
154+
| Embed other services | ❌ No | |
155+
| Advanced | ❌ No | |
156+
| Layout in page | ❌ No | |
165157

166158
### License
167159

0 commit comments

Comments
 (0)