mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 08:08:34 +08:00
docs: update README to reflect new features and improved database support
This commit is contained in:
313
README-zh.md
313
README-zh.md
@@ -1,307 +1,20 @@
|
|||||||
# Obsidian share to NotionNext
|
# Obsidian to NotionNext
|
||||||
|
|
||||||
感谢[原作者](https://github.com/EasyChris/obsidian-to-notion)开发出了这么好用的插件,能够将obsidian同步到notion。 但是原仓库只能同步Name和Tags信息,如果像我一样通过[NotionNext](https://github.com/tangly1024/NotionNext)来搭建自己的网页,就有一些局限性。每次导入之后都需要进行大量的修改。
|
[](https://github.com/jxpeng98/obsidian-to-NotionNext/actions/workflows/test.yml)
|
||||||
|
[](https://github.com/jxpeng98/obsidian-to-NotionNext/actions/workflows/release.yml)
|
||||||
|
[](https://GitHub.com/jxpeng98/obsidian-to-NotionNext/releases/)
|
||||||
|
[](https://github.com/jxpeng98/obsidian-to-NotionNext/releases/)
|
||||||
|
|
||||||
所以我在[原作者](https://github.com/EasyChris/obsidian-to-notion)的基础之上,增加了匹配[NotionNext](https://github.com/tangly1024/NotionNext)模板的功能。这样可以直接在Obsidian编辑,整理好之后一键发布。
|
使用 Notion API 将文件从 Obsidian 分享到任何 Notion 数据库。此插件支持通用 Notion 数据库、NotionNext 博客模板和完全自定义的数据库模式。
|
||||||
|
|
||||||
## 更新说明
|
**详细说明请访问[文档网站](https://jxpeng98.github.io/obsidian-to-NotionNext/)。**
|
||||||
### 1.1.2
|
|
||||||
- 修复了一个拼写错误,导致无法同步`status`到NotionNext。现在你可以使用`stats`或者`status`来同步文章的状态到NotionNext。这个更新不会影响到同步到General数据库的功能。
|
|
||||||
- **`stats`和`status`都可以使用,但是你只能使用其中一个。**
|
|
||||||
|
|
||||||
```yaml
|
## 功能特性
|
||||||
stats: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft
|
|
||||||
# or
|
|
||||||
status: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft
|
|
||||||
# both of them will work, but you can only use one of them.
|
|
||||||
```
|
|
||||||
|
|
||||||
### 1.1.1
|
- **多种数据库类型**:支持通用、NotionNext 和自定义数据库。
|
||||||
- 修复了在日语系统下,无法显示设置按钮的错误。
|
- **自定义属性**:在自定义数据库中,可将任何 frontmatter 键映射到任何 Notion 属性。
|
||||||
- 增加日语翻译。
|
- **灵活同步**:即时选择要同步到哪个数据库。
|
||||||
### 1.1.0
|
|
||||||
- 修复设置中自定义标题的显示问题。
|
|
||||||
- 增加了标签同步的控制按钮。以减少空标签集造成的上传失败。
|
|
||||||
|
|
||||||
如果你不想使用同步标签功能,你可以在设置中关闭。不论你在md文件表头添加了tags与否,都不会将标签同步到Notion数据库中。
|
## 致谢
|
||||||
|
|
||||||
如果你需要同步标签到Notion数据库中,**你需要通过如下格式添加表填到md表头中。**
|
此插件是 EasyChris 的原创作品 [obsidian-to-notion](https://github.com/EasyChris/obsidian-to-notion) 的一个分支,增加了新功能并支持更灵活的数据库配置。
|
||||||
|
|
||||||
```yaml
|
|
||||||
tags: #空标签,选项1
|
|
||||||
tags: [test,test1,test2] # 用中括号将所有的标签括起来,选项2
|
|
||||||
tags:
|
|
||||||
- test
|
|
||||||
- test1
|
|
||||||
- test2 # 每个标签单独一行,选项3
|
|
||||||
```
|
|
||||||
|
|
||||||
### 1.0.1
|
|
||||||
|
|
||||||
- 修复了自定义标题在设置菜单中显示错误的问题。
|
|
||||||
|
|
||||||
### 1.0.0 (大更新)
|
|
||||||
|
|
||||||
- 这个版本开始,你可以**任意修改第一列表头的名字 (标题列,默认:'title')**。 (**注意:你必须保证你的Notion数据库中有'tags‘这一列的存在,并且在markdown文件中把`tags:`添加到你的YAML表头中。否则会返回`400 错误`。但是你可以`tags:`设置为空。**)
|
|
||||||
|
|
||||||

|
|
||||||
例如这样:
|
|
||||||

|
|
||||||
- 增加了一个控制按钮来控制是否开启当前数据库同步命令的功能。如果你关闭了这个按钮,你在上传命令列表中就不会出现当前数据库的选项。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 0.2.6
|
|
||||||
|
|
||||||
- 增加一个按钮用来控制是否在名列列表中显示如下数据库。
|
|
||||||
|
|
||||||

|
|
||||||
如果你关闭普通数据库的按钮,你在上传命令列表中就不会出现普通数据库的选项。如果你关闭NotionNext数据库的按钮,你在上传命令列表中就不会出现NotionNext数据库的选项。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 0.2.3
|
|
||||||
|
|
||||||
- 修复了一个bug,现在可以正常更新了。
|
|
||||||
|
|
||||||
### 0.2.2
|
|
||||||
|
|
||||||
- 支持NotionNext 和 普通Notion 数据库的同步。
|
|
||||||
- 你可以有一个NotionNext和一个普通Notion数据库。
|
|
||||||
- 普通Notion数据库的同步方式和原作者的一样,只同步`title`和`tags`。**如果使用普通数据库功能,你需要保证你的数据库中有`title`和`tags`这两个表头。必须使用小写。**
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 0.2.1
|
|
||||||
|
|
||||||
- 重构代码。
|
|
||||||
|
|
||||||
### 0.2.0
|
|
||||||
|
|
||||||
- 从这个版本开始,重构了交互逻辑。现在当你点击左侧的按钮,会弹出可同步的数据库选项。你可以选择你想要同步的数据库,然后点击同步按钮。**但是,现在仅支持同步单个数据库,如果你的数据库不是NotionNext,你可以不用更新。**
|
|
||||||
|
|
||||||
### 0.1.10
|
|
||||||
|
|
||||||
- 修正了设置中的中文显示。
|
|
||||||
|
|
||||||
### 0.1.8
|
|
||||||
|
|
||||||
- 重新整理了代码,增加了一个仓库转换按钮为之后的多数据库支持作准备。**但是现在还不支持多数据库,如果你的数据库不是NotionNext,你可以不用更新。**
|
|
||||||
|
|
||||||
### 0.1.7
|
|
||||||
|
|
||||||
- [x] 删除了设置中`convert tags`的选项。 你现在可以直接添加tags,而不需要考虑是否开启tags选项。如果你不需要tags,可以直接删除tags选项或者留白。
|
|
||||||
|
|
||||||
## 使用方式
|
|
||||||
|
|
||||||
### 注意事项
|
|
||||||
|
|
||||||
本插件现在暂时只能用于匹配[NotionNext](https://github.com/tangly1024/NotionNext)。如果你不是使用这个模板,你只会无限返回`error 400`.
|
|
||||||
|
|
||||||
所以没有NotionNext需求的,请使用原作者的[Obsidian-to-notion](https://github.com/EasyChris/obsidian-to-notion)
|
|
||||||
|
|
||||||
### 准备安装
|
|
||||||
|
|
||||||
在安装插件之前,你必须配置好了以下内容:
|
|
||||||
|
|
||||||
1. 你的NotionNext数据库。
|
|
||||||
2. 根据原作者的readme.md,配置好了Notion API,并且已经和你的NotionNext仓库关联。
|
|
||||||
3. NotionNext Database ID
|
|
||||||
4. 你的NotionNext数据库有如下内容:
|
|
||||||
- type
|
|
||||||
- title
|
|
||||||
- slug
|
|
||||||
- category
|
|
||||||
- tags
|
|
||||||
- date
|
|
||||||
- status
|
|
||||||
- summary
|
|
||||||
- password
|
|
||||||
- icon
|
|
||||||
|
|
||||||
在最新的0.0.6版本,我还增加了以下内容:
|
|
||||||
|
|
||||||
- titleicon: 标题的emoji图标,暂时只能支持emoji
|
|
||||||
- coverurl: 封面图片的url, url可以是任何一种图片的url, 例如jpg,png,svg等等。
|
|
||||||
|
|
||||||
**如果你是直接复制的NotionNext的模板,这些内容应该已经有了。我在原作者的基础之上对本插件的内容进行了更改,所以你只需要保证你的数据库有如上内容,并且所有的字母都是小写!!!**
|
|
||||||
|
|
||||||
**⚠️⚠️⚠️:表头全部小写!!!顺序无所谓!**
|
|
||||||
|
|
||||||
### 安装插件
|
|
||||||
|
|
||||||
#### 社区插件市场下载
|
|
||||||
|
|
||||||
打开`Obsidian -> 设置 -> 社区插件 -> 浏览 -> 搜索Share to NotionNext`, 然后点击安装。
|
|
||||||
|
|
||||||
#### 手动安装
|
|
||||||
|
|
||||||
1. 关闭Obsidian
|
|
||||||
2. 从Release下载插件文件,解压到你的obsidian插件目录下。
|
|
||||||
3. 重新打开Obsidian,进入设置,启用插件。
|
|
||||||
4. 在设置中,找到Obsidian to NotionNext,填入你的NotionNext Database ID 和 API token。
|
|
||||||
|
|
||||||
### 使用插件
|
|
||||||
|
|
||||||
在仓库中我上传了一个模板,你可以直接复制到你的模板文件夹中。然后使用Obsidian的模板功能一键生成新笔记。
|
|
||||||
|
|
||||||
如果你不想使用模板,你也可以直接在Obsidian中创建一个新的文件,然后复制下边的内容。然后保存。
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
# default value has been set.
|
|
||||||
# for any unwanted value, you can delete it or set it to empty.
|
|
||||||
# for example, if you donot want to set password, you can delete password: "1234" or set it to password: ""
|
|
||||||
# 我已经在插件中设置了默认值,如果有不需要的选项,可以直接删除。
|
|
||||||
# 例如你不需要密码选项,你可以将password: "1234"删除,或者将它设置为空。
|
|
||||||
# !!!!!!!!!!!!
|
|
||||||
# 现在阶段一定不要修改表头的名字, please do not change the name of the header in YAML front matter
|
|
||||||
# !!!!!!!!!!!!
|
|
||||||
titleicon: 📎 # emoji icon, default is 📜, 默认是📜
|
|
||||||
date: 2023-07-23 # default is today, 默认是今天。 Format is YYYY-MM-DD, 格式是YYYY-MM-DD
|
|
||||||
coverurl: https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg # default is empty, 默认是空
|
|
||||||
type: Post # Post or Page, default is Post, 默认是Post
|
|
||||||
slug: test # slug for url, default is empty, 默认是空
|
|
||||||
stats: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft
|
|
||||||
category: test # default is 'Obsidian', 默认是'Obsidian'
|
|
||||||
summary: this is a summary for test post # default is empty, 默认是空
|
|
||||||
icon: fa-solid fa-camera # you can ignore this, default is empty, 默认是空,可直接删除
|
|
||||||
password: "1234" # if you donot want to set password, you can delete this line, default is empty, 默认是空,可直接删除
|
|
||||||
# 现在必须开启tags选项,否则会报错
|
|
||||||
tags:
|
|
||||||
- test # tags for post
|
|
||||||
- web # add more tags if you want
|
|
||||||
---
|
|
||||||
|
|
||||||
Contents Below
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
模板使用如下:
|
|
||||||

|
|
||||||
|
|
||||||
**插件预览如下**
|
|
||||||

|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**以下为原README.md**
|
|
||||||
|
|
||||||
非常感谢原作者的开发,我只是在原作者的基础之上进行了修改,增加了一些功能。如果你觉得这个插件对你有帮助,可以给[原作者](https://github.com/EasyChris/obsidian-to-notion)一个star。
|
|
||||||
|
|
||||||
# Obsidian to Notion
|
|
||||||
|
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/CI.yml)
|
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/release.yml)
|
|
||||||
[](https://raw.githubusercontent.com/EasyChris/obsidian-to-notion/master/LICENSE)
|
|
||||||
[](https://GitHub.com/Easychris/obsidian-to-notion/releases/)
|
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/releases)
|
|
||||||
|
|
||||||
Obsidian share to Notion [English](README.md)
|
|
||||||
|
|
||||||
将obsidian文件一键分享到Notion,并在obsidian中添加Notion分享链接
|
|
||||||
|
|
||||||
如果能对你有所帮助,欢迎给一个star支持。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
# 使用方式
|
|
||||||
|
|
||||||
## 安装插件
|
|
||||||
|
|
||||||
### 市场下载
|
|
||||||
|
|
||||||
插件市场搜索 noiton 即可下载
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### BRAT
|
|
||||||
|
|
||||||
插件中中心搜索 BRAT
|
|
||||||
添加 `EasyChris/obsidian-to-notion` 到 BRAT 插件安装列表中
|
|
||||||
返回插件中心启用即可
|
|
||||||
|
|
||||||
### 手动安装
|
|
||||||
|
|
||||||
```
|
|
||||||
cd YOUR_OBSIDIAN_FOLDER/.obsidian/plugins/
|
|
||||||
git clone https://github.com/EasyChris/obsidian-to-notion.git
|
|
||||||
```
|
|
||||||
|
|
||||||
## 申请 Notion API
|
|
||||||
|
|
||||||
官方参考文档:[https://developers.notion.com/docs](https://developers.notion.com/docs)
|
|
||||||
|
|
||||||
### 第 1 步:创建integration
|
|
||||||
|
|
||||||
转到 [https://www.notion.com/my-integrations](https://www.notion.com/my-integrations)
|
|
||||||
创建完成之后,复制`secrets toekn`
|
|
||||||

|
|
||||||
|
|
||||||
### 第2步:与你的集成共享一个数据库
|
|
||||||
|
|
||||||
新建一个的page(权限为公开)
|
|
||||||
在page中新建一个数据库 -> 需要`full page database`
|
|
||||||

|
|
||||||
|
|
||||||
将`integration`添加到你的新建的数据库中
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### 注意
|
|
||||||
|
|
||||||
数据库的第一个自定义名称必须是 "Name",否则同步会失败。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 第三步:复制database ID
|
|
||||||
|
|
||||||
```
|
|
||||||
https://www.notion.so/myworkspace/a8aec43384f447ed84390e8e42c2e089?v=...
|
|
||||||
|--------- Database ID --------|
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
## 打开插件配置
|
|
||||||
|
|
||||||
将得到的 `NOTION_API_KEY` 和 `DATABASE_ID`填入配置当中
|
|
||||||

|
|
||||||
|
|
||||||
## 上传文件内容到notion
|
|
||||||
|
|
||||||
点击上传notion的按钮
|
|
||||||

|
|
||||||
上传成功之后会自动生成一个分享链接
|
|
||||||

|
|
||||||
|
|
||||||
## 页面 Banner 链接[可选]
|
|
||||||
|
|
||||||
默认可以不填写
|
|
||||||
横幅URL必须是图像URL,例如:https://i.imgur.com/xxx.jpg
|
|
||||||
|
|
||||||
## Notion ID [可选]
|
|
||||||
|
|
||||||
Notion ID是你想分享文件的页面ID。
|
|
||||||
如果你不写它,notion将分享到默认的链接,如:<https://www.notion.so/myworkspace/a8aec43384f447ed84390,访问这个页面将重定向到你的网站页面。>
|
|
||||||
如果你写了Notion ID,它将分享到页面链接如:<https://your_user_name.notion.site/myworkspace/a8aec43384f447ed84390。不需要重定向网址。>
|
|
||||||
|
|
||||||
## 同步图片
|
|
||||||
|
|
||||||
使用 [Obsidian Image Auto Upload Plugin](https://github.com/renmu123/obsidian-image-auto-upload-plugin) 插件,配置你自己的 cos 或者 oss,将图片存储到你自己的云存储,然后在 obsidian 中使用图片链接即可。该插件会自动帮你上传图片,并替换成链接。
|
|
||||||
|
|
||||||
# 请我喝杯咖啡
|
|
||||||
|
|
||||||
[顿顿饭](https://dun.mianbaoduo.com/@easy)
|
|
||||||
|
|
||||||
# 感谢
|
|
||||||
|
|
||||||
[开发流程 | Obsidian 插件开发文档](https://luhaifeng666.github.io/obsidian-plugin-docs-zh/zh/getting-started/development-workflow.html)
|
|
||||||
|
|
||||||
[GitHub - devbean/obsidian-wordpress: An obsidian plugin for publishing docs to WordPress.](https://github.com/devbean/obsidian-wordpress)
|
|
||||||
|
|
||||||
[GitHub - obsidianmd/obsidian-api](https://github.com/obsidianmd/obsidian-api)
|
|
||||||
|
|
||||||
[GitHub - zhaohongxuan/obsidian-weread-plugin: Obsidian Weread Plugin is an plugin to sync Weread(微信读书) hightlights and annotations into your Obsidian Vault.](https://github.com/zhaohongxuan/obsidian-weread-plugin)
|
|
||||||
|
|||||||
460
README.md
460
README.md
@@ -5,461 +5,17 @@
|
|||||||
[](https://GitHub.com/jxpeng98/obsidian-to-NotionNext/releases/)
|
[](https://GitHub.com/jxpeng98/obsidian-to-NotionNext/releases/)
|
||||||
[](https://github.com/jxpeng98/obsidian-to-NotionNext/releases/)
|
[](https://github.com/jxpeng98/obsidian-to-NotionNext/releases/)
|
||||||
|
|
||||||
[//]: # ([](https://GitHub.com/jxpeng98/obsidian-to-NotionNext/releases/))
|
[中文版](README-zh.md)
|
||||||
|
Share files from Obsidian to any Notion database using the Notion API. This plugin supports general Notion databases, NotionNext blog templates, and fully custom database schemas.
|
||||||
|
|
||||||
[//]: # ([中文文档](README-zh.md))
|
**For detailed instructions, please visit the [documentation website](https://jxpeng98.github.io/obsidian-to-NotionNext/).**
|
||||||
|
|
||||||
**Now, support All Notion databases, including NotionNext and General Notion databases, and customise the database list.**
|
## Features
|
||||||
|
|
||||||
**现在支持所有Notion数据库,包括NotionNext和一般Notion数据库,以及自定义数据库列表。**
|
- **Multiple Database Types**: Supports General, NotionNext, and Custom databases.
|
||||||
|
- **Custom Properties**: Map any frontmatter key to any Notion property in custom databases.
|
||||||
## Precautions
|
- **Flexible Syncing**: Choose which database to sync to on-the-fly.
|
||||||
|
|
||||||
### For customised database users before version 2.3.0
|
|
||||||
|
|
||||||
**⚠️⚠️⚠️: The existing customised database should be recreated if you want to update to version 2.3.0. The new version has a new database structure, and the old database structure is not compatible with the new version to build the index properly.**
|
|
||||||
|
|
||||||
### 在2.3.0版本之前的自定义数据库用户
|
|
||||||
|
|
||||||
**⚠️⚠️⚠️: 如果你想要更新到2.3.0版本,你需要重新创建自定义数据库。新版本有一个新的数据库结构,旧的数据库结构无法构建索引。**
|
|
||||||
|
|
||||||
## TODO List
|
|
||||||
|
|
||||||
- [x] Modify the Edit function for the custom properties. 改进自定义属性的编辑功能
|
|
||||||
- [x] Support sync with long notes (From `v2.4.0`). 从`v2.4.0`开始支持长笔记同步
|
|
||||||
- [x] Support custom properties for Notion General database. 支持自定义属性
|
|
||||||
- [x] Support preview for database details in plugin settings. 支持预览数据库详情
|
|
||||||
- [x] Support edit for database details in plugin settings. 支持编辑数据库详情
|
|
||||||
- [x] Convert Obsidian callouts into Notion callout blocks so your `[!info]` style notes stay consistent after syncing.
|
|
||||||
- [ ] Support group upload with one click 支持一键多数据库上传
|
|
||||||
|
|
||||||
## Callout support
|
|
||||||
|
|
||||||
Obsidian callouts written with the standard syntax (for example `> [!warning]` or `> [!quote]`) are automatically rendered as Notion callout blocks during upload. The plugin keeps the chosen callout type, title, and body content so your callout styling survives the trip from Obsidian to Notion without extra configuration.
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
> [!info] Tips
|
|
||||||
> Remember to update your front matter before syncing.
|
|
||||||
```
|
|
||||||
|
|
||||||
After syncing, the note will contain an equivalent Notion callout block with the same icon and text.
|
|
||||||
|
|
||||||
## How to use
|
|
||||||
|
|
||||||
If you want to use this plugin, you need to follow the following steps to set up the plugin. The steps can be divided into two parts: setting up the Notion API and setting up the plugin in Obsidian.
|
|
||||||
|
|
||||||
### 1. Setting up the Notion API
|
|
||||||
|
|
||||||
1). Go to [Notion API](https://www.notion.com/my-integrations) to create a new integration, and **copy the token**.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
2). Create a database in your Notion workspace.
|
|
||||||
|
|
||||||
Open Notion, click top-left `Create` a new page` -> You can give a title for the page and press "/" Select 'Database - Full page'.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Rename the database properties to `title` and `tags`.
|
|
||||||
**⚠️⚠️`title` is the title column! `tags` is lower case⚠️⚠️**
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
3). Add the Notion API integration.
|
|
||||||
|
|
||||||
Click the right-top '...' -> connections -> connect to -> find the integration you created and connect it.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
4). Publish the database to the public.
|
|
||||||
Click the 'Share' -> 'Publish' -> 'Publish' -> **copy the database id from the URL**.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 2. Setting up the plugin in Obsidian
|
|
||||||
|
|
||||||
1). Go to Obsidian settings -> community plugins -> search 'NotionNext' -> install it.
|
|
||||||

|
|
||||||
|
|
||||||
2). Open the plugin settings and create a new database.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 3. Create a database
|
|
||||||
|
|
||||||
**You can create three types of databases:**
|
|
||||||
|
|
||||||
#### 1️⃣ General database
|
|
||||||
|
|
||||||
General database is the default database, which only has the `title` and `tags` columns. **⚠️⚠️`title` and `tags` are lowercase⚠️⚠️**
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
The general is as follows:
|
|
||||||
|
|
||||||
- Full Name: the full name that you would like to give to the database.
|
|
||||||
- Abbreviate Name: the abbreviation that you would like to give to the database.
|
|
||||||
- Notion tags sync: whether you want to sync the tags column to Notion.
|
|
||||||
- Customise title property: whether you want to change the `title` to another name (e.g., `name`).
|
|
||||||
- Notion API token: the token you copied from the Notion API page.
|
|
||||||
- Notion Database ID: the database ID you copied from the Notion database URL. (e.g., only copy `7158cd3f70ce4f60afd9da5bdf74fd0c` between `site/` and `?`. `https://jxpeng.notion.site/7158cd3f70ce4f60afd9da5bdf74fd0c?v=380317ac5373sadasdas3c13e618f&pvs=4**`)
|
|
||||||
|
|
||||||
After setting, it should look like this:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Once you click `save`, the new database will be created in the plugin settings and display in the detabase list.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### 2️⃣ NotionNext database
|
|
||||||
|
|
||||||
If you use [NotionNext](https://github.com/tangly1024/NotionNext) to set up your website, you can use the NotionNext database. (**All the properties are in lowercase, and you do not need to change the properties**)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Like the general database, you need to fill in the following information:
|
|
||||||
|
|
||||||
- Full Name: the full name that you would like to give to the database.
|
|
||||||
- Abbreviate Name: the abbreviation that you would like to give to the database.
|
|
||||||
- Notion API token: the token you copied from the Notion API page.
|
|
||||||
- Notion Database ID: the database ID you copied from the Notion database URL.
|
|
||||||
|
|
||||||
#### 3️⃣ Custom database
|
|
||||||
|
|
||||||
The custom database is purely customised, and you can customise the properties you want to sync. (**All the properties are in lowercase, and you do not need to change the properties**)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
The basic information is identical to the general database and NotionNext database. You need to fill in the following information:
|
|
||||||
|
|
||||||
- Full Name: the full name that you would like to give to the database.
|
|
||||||
- Abbreviate Name: the abbreviation that you would like to give to the database.
|
|
||||||
- Notion API token: the token you copied from the Notion API page.
|
|
||||||
- Notion Database ID: the database ID you copied from the Notion database URL.
|
|
||||||
|
|
||||||
After adding the information, You can click `Add New Property` to add the properties you want to sync. There is no limit to the number of properties you can add.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
**⚠️⚠️⚠️**: **`Title column` is the main property in the Notion database, which has the open button to open the underlying page.** You can select the type of all other properties. **⚠️⚠️⚠️**
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
According to the previously shown database, you can use `title` as the `Title column`, and `Tags` as the property 1.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
**Until now, you have set up the plugin in Obsidian. You can start syncing your notes to Notion.**
|
|
||||||
|
|
||||||
### 4. Start syncing
|
|
||||||
|
|
||||||
Create a new note in Obsidian, and fill in the front matter with the properties you want to sync.
|
|
||||||
|
|
||||||
#### 1️⃣ note for general database
|
|
||||||
|
|
||||||
For example, we can create a test note with the following front matter:
|
|
||||||
|
|
||||||
``` markdown
|
|
||||||
---
|
|
||||||
title: test
|
|
||||||
tags: [test, web]
|
|
||||||
---
|
|
||||||
|
|
||||||
This is a test file.
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
After creating the note, you can click the `Share to NotionNext` button on the left sidebar to sync the note to Notion.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### 2️⃣ note for NotionNext database
|
|
||||||
|
|
||||||
We use the following front matter for the NotionNext database:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
title: test-notionnext
|
|
||||||
titleicon: 📎
|
|
||||||
date: 2023-07-23
|
|
||||||
coverurl: https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg
|
|
||||||
type: Post
|
|
||||||
slug: test
|
|
||||||
status: Draft
|
|
||||||
category: test
|
|
||||||
summary: this is a summary for test post
|
|
||||||
icon: fa-solid fa-camera
|
|
||||||
password: "1234"
|
|
||||||
tags:
|
|
||||||
- test
|
|
||||||
- web
|
|
||||||
NotionID-pengjiaxin: 8ba573de-8fdf-4681-b063-c39d26e7860e
|
|
||||||
---
|
|
||||||
|
|
||||||
this is a test file
|
|
||||||
```
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### 3️⃣ note for custom database
|
|
||||||
|
|
||||||
##### sync title and tags
|
|
||||||
|
|
||||||
Use the previously created general database and rename `title` to `Name` and `tags` to `Tags` in Notion.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
The front matter for the custom database is as follows:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
Name: test-custom
|
|
||||||
Tags:
|
|
||||||
- test
|
|
||||||
- web
|
|
||||||
---
|
|
||||||
|
|
||||||
This is a test file.
|
|
||||||
```
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
##### sync more properties
|
|
||||||
|
|
||||||
Add more property to the custom database. For example, we can add a `summary` and `date` property to the custom database.
|
|
||||||
|
|
||||||
1). Click `Edit` in the plugin settings.
|
|
||||||

|
|
||||||
2). Click `Add` and add the `summary` and `date` property.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
3). After adding the properties, you can see the properties in the plugin settings.
|
|
||||||

|
|
||||||
4). Add the `summary` and `date` in Notion
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
5). Create a new note with the `summary` and `date` property.
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
Name: test-custom-more
|
|
||||||
Tags:
|
|
||||||
- test
|
|
||||||
- web
|
|
||||||
summary: this is a summary for test custom
|
|
||||||
date: 2022-05-03
|
|
||||||
---
|
|
||||||
|
|
||||||
This is a test file.
|
|
||||||
```
|
|
||||||
|
|
||||||
6). Sync the note to Notion.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Acknowledgment
|
## Acknowledgment
|
||||||
|
|
||||||
Thanks to the [original author](https://github.com/EasyChris/obsidian-to-notion) for developing such a useful plugin that can synchronize Obsidian to Notion. However, the original repository can only sync Name and Tag information. For those like me who use [NotionNext](https://github.com/tangly1024/NotionNext) to set up their website, this presents some limitations. Every time I import, I need to make a lot of modifications.
|
This plugin is a fork of the original [obsidian-to-notion](https://github.com/EasyChris/obsidian-to-notion) by EasyChris, with added features and support for more flexible database configurations.
|
||||||
|
|
||||||
Thus, based on the [original author's work](https://github.com/EasyChris/obsidian-to-notion), I've added a feature to match the [NotionNext](https://github.com/tangly1024/NotionNext) template. This way, you can edit directly in Obsidian and publish with a single click after organizing.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<details> <summary> Original README.md </summary>
|
|
||||||
|
|
||||||
Many Thanks for the original author's work. I've only made some changes to the original author's work. If you find this plugin useful, please give the [original author](https://github.com/EasyChris/obsidian-to-notion) a star.
|
|
||||||
|
|
||||||
# Obsidian to Notion
|
|
||||||
|
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/CI.yml)
|
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/release.yml)
|
|
||||||
[](https://raw.githubusercontent.com/EasyChris/obsidian-to-notion/master/LICENSE)
|
|
||||||
[](https://GitHub.com/Easychris/obsidian-to-notion/releases/)
|
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/releases)
|
|
||||||
|
|
||||||
Share of obsidian to Notion [中文文档](README-zh.md)
|
|
||||||
|
|
||||||
Sharing files from Obsidian to Notion with a single click, and Obsidian will automatically add the Notion share link
|
|
||||||
|
|
||||||
You are welcome to offer it a star if it can benefit you.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
# TODO
|
|
||||||
|
|
||||||
### [TODO Board](https://github.com/users/EasyChris/projects/3/views/1)
|
|
||||||
|
|
||||||
- [x] support for custom page banner
|
|
||||||
- [x] update the exsit page
|
|
||||||
- [x] support for mult language
|
|
||||||
- [x] support for auto copy the share link to clipboard
|
|
||||||
- [x] support for mobile
|
|
||||||
- [x] support tags thank for [@jannikbuscha](https://github.com/jannikbuscha)
|
|
||||||
- [ ] transfer the bi-link format like [[]] into the format that Notion supports.
|
|
||||||
|
|
||||||
# How to use
|
|
||||||
|
|
||||||
## Install the plugin
|
|
||||||
|
|
||||||
### Marketplace download
|
|
||||||
|
|
||||||
Open obsidian setting -> Add plugin -> Search -> notion
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### BRAT
|
|
||||||
|
|
||||||
Enter `BRAT` into the plugin market center to find it.
|
|
||||||
Add `EasyChris/obsidian-to-notion` to the list of BRAT plugins that have been installed.
|
|
||||||
Return to the plugin center and turn it on.
|
|
||||||
|
|
||||||
### Manual installation
|
|
||||||
|
|
||||||
```
|
|
||||||
cd YOUR_OBSIDIAN_FOLDER/.obsidian/plugins/
|
|
||||||
git clone https://github.com/EasyChris/obsidian-to-notion.git
|
|
||||||
```
|
|
||||||
|
|
||||||
## Apply Notion API
|
|
||||||
|
|
||||||
Official reference documentation: [https://developers.notion.com/docs](https://developers.notion.com/docs)
|
|
||||||
|
|
||||||
### Step 1: Create integration
|
|
||||||
|
|
||||||
Go to [https://www.notion.com/my-integrations](https://www.notion.com/my-integrations)
|
|
||||||
Once created, copy `secrets toekn`
|
|
||||||

|
|
||||||
|
|
||||||
#### Note
|
|
||||||
|
|
||||||
database first custom name must be "Name", otherwise sync to notion will be failed
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Step 2: Share a database with your integration
|
|
||||||
|
|
||||||
Create a new page (with public permissions)
|
|
||||||
Create a new database in the page -> you need `full page database`
|
|
||||||

|
|
||||||
|
|
||||||
Add `integration` to your new database
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Step 3: Copy the database ID
|
|
||||||
|
|
||||||
```
|
|
||||||
https://www.notion.so/myworkspace/a8aec43384f447ed84390e8e42c2e089?v=...
|
|
||||||
| --------- Database ID --------|
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
## Open the plugin configuration
|
|
||||||
|
|
||||||
Fill the configuration with the `NOTION_API_KEY` and `DATABASE_ID` you got
|
|
||||||

|
|
||||||
|
|
||||||
## Upload file content to notion
|
|
||||||
|
|
||||||
Click the uploadCommand notion button
|
|
||||||

|
|
||||||
A share link will be automatically generated after successful uploadCommand
|
|
||||||

|
|
||||||
|
|
||||||
## Banner URL [option]
|
|
||||||
|
|
||||||
Banner url must be a image url like: <https://i.imgur.com/xxx.jpg>
|
|
||||||
If you don't want to use banner, leave it blank
|
|
||||||
|
|
||||||
## Convert Tags [option]
|
|
||||||
|
|
||||||
Transfer the Obsidian tags to the Notion table.
|
|
||||||
It requires the column with the name 'Tags'.
|
|
||||||

|
|
||||||
|
|
||||||
Add tags to your notion page
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
- open plugin convert tags
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
- add tags in the head
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
tags: [tag1,tag2]
|
|
||||||
---
|
|
||||||
|
|
||||||
this is test tags
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
tags:
|
|
||||||
- tag4
|
|
||||||
---
|
|
||||||
|
|
||||||
this is test tags
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Thanks for [@jannikbuscha](https://github.com/jannikbuscha) contribution
|
|
||||||
|
|
||||||
## Notion ID [option]
|
|
||||||
|
|
||||||
Notion ID is the your notion site ID that you want to share the file to.
|
|
||||||
if you don't write it, notion will share to the default link like:
|
|
||||||
<https://www.notion.so/myworkspace/a8aec43384f447ed84390>
|
|
||||||
that visit this page need to redirect to your site url
|
|
||||||
if you write the Notion ID, it will share to the page link like:
|
|
||||||
<https://your_user_name.notion.site/myworkspace/a8aec43384f447ed84390>.
|
|
||||||
The visiter don't need to redirect url.
|
|
||||||
|
|
||||||
## Sync image to Notion
|
|
||||||
|
|
||||||
To sync images to your oss or cos bucket, use the [Obsidian Image Auto Upload Plugin](https://github.com/renmu123/obsidian-image-auto-upload-plugin).
|
|
||||||
|
|
||||||
# Development
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://github.com/EasyChris/obsidian-to-notion.git
|
|
||||||
yarn install
|
|
||||||
yarn dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## Release
|
|
||||||
|
|
||||||
```
|
|
||||||
node update-version.js
|
|
||||||
./release.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
# Thanks
|
|
||||||
[Development Process | Obsidian Plugin Development Documentation](https://luhaifeng666.github.io/obsidian-plugin-docs-zh/zh/getting-started/development-workflow.html)
|
|
||||||
|
|
||||||
[GitHub - devbean/obsidian-wordpress: An obsidian plugin for publishing docs to WordPress.](https://github.com/devbean/obsidian-wordpress)
|
|
||||||
|
|
||||||
[GitHub - obsidianmd/obsidian-api](https://github.com/obsidianmd/obsidian-api)
|
|
||||||
|
|
||||||
[GitHub - Easychris/obsidian-to-notion: Obsidian Weread Plugin is an plugin to sync Weread(微信读书) hightlights and annotations into your Obsidian Vault.](https://github.dev/zhaohongxuan/obsidian-weread-plugin)
|
|
||||||
|
|
||||||
[GitHub - Quorafind/Obsidian-Memos: A quick capture plugin for Obsidian, all data from your notes.](https://github.com/Quorafind/Obsidian-Memos)
|
|
||||||
|
|
||||||
[https://github.com/jannikbuscha/obsidian-to-notion](https://github.com/jannikbuscha)
|
|
||||||
|
|
||||||
# License
|
|
||||||
GNU GPLv3
|
|
||||||
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user