mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-30 00:48:36 +08:00
Compare commits
49 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
913fa4dd03 | ||
|
|
f638310f31 | ||
|
|
c2421f7a84 | ||
|
|
630e3a20c2 | ||
|
|
040b72b760 | ||
|
|
7df4b5e9c8 | ||
|
|
3f35a56b6e | ||
|
|
3c7e266a35 | ||
|
|
8201c706ea | ||
|
|
4433ea449d | ||
|
|
96126d1334 | ||
|
|
b3702a9cc1 | ||
|
|
ba9b477db7 | ||
|
|
fb6951cfdf | ||
|
|
6454c0417d | ||
|
|
35f19a9f43 | ||
|
|
8e32e8f0f5 | ||
|
|
880f256ae1 | ||
|
|
bf9c3f2933 | ||
|
|
2ac354299a | ||
|
|
8317abb667 | ||
|
|
d74634aca6 | ||
|
|
d400b92263 | ||
|
|
e7fa597e5a | ||
|
|
6ce689ba96 | ||
|
|
b978cf7e01 | ||
|
|
4e3c88f129 | ||
|
|
6550bca70f | ||
|
|
662edbb84c | ||
|
|
671936ee41 | ||
|
|
2b16ea76c6 | ||
|
|
399a02187f | ||
|
|
eee349509a | ||
|
|
57c0941fed | ||
|
|
8734af6dbf | ||
|
|
041a78fb52 | ||
|
|
afec5d8364 | ||
|
|
75926a38d4 | ||
|
|
793dd67e0a | ||
|
|
f235c80d18 | ||
|
|
f33315a4b6 | ||
|
|
b62bd4ba2e | ||
|
|
402d15a38b | ||
|
|
87f1ce0146 | ||
|
|
398b785e03 | ||
|
|
8617878582 | ||
|
|
ae9e0c14fb | ||
|
|
9be9b18efb | ||
|
|
588f57205b |
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Release Obsidian plugin
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -10,14 +10,15 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
name: release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Use Node.js
|
- name: Use Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16.x"
|
node-version: "18"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
id: build
|
id: build
|
||||||
|
|||||||
32
.github/workflows/test.yml
vendored
Normal file
32
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: Test and Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
env:
|
||||||
|
PLUGIN_NAME: share-to-notionnext # Change this to match the id of your plugin.
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "18"
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
id: build
|
||||||
|
run: |
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
mkdir ${{ env.PLUGIN_NAME }}
|
||||||
|
cp main.js manifest.json ${{ env.PLUGIN_NAME }}
|
||||||
|
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
|
||||||
|
ls
|
||||||
|
echo "tag_name=$(git tag --sort version:refname | tail -n 1)" >> $GITHUB_OUTPUT
|
||||||
126
README-zh.md
126
README-zh.md
@@ -1,22 +1,109 @@
|
|||||||
# Obsidian share to NotionNext
|
# Obsidian share to NotionNext
|
||||||
|
|
||||||
感谢[原作者](https://github.com/EasyChris/obsidian-to-notion)开发出了这么好用的插件,能够将obsidian同步到notion。 但是原仓库只能同步Name和Tags信息,如果像我一样通过[NotionNext](https://github.com/tangly1024/NotionNext)来搭建自己的网页,就有一些局限性。每次导入之后都需要进行大量的修改。
|
感谢[原作者](https://github.com/EasyChris/obsidian-to-notion)开发出了这么好用的插件,能够将obsidian同步到notion。 但是原仓库只能同步Name和Tags信息,如果像我一样通过[NotionNext](https://github.com/tangly1024/NotionNext)来搭建自己的网页,就有一些局限性。每次导入之后都需要进行大量的修改。
|
||||||
|
|
||||||
所以我在[原作者](https://github.com/EasyChris/obsidian-to-notion)的基础之上,增加了匹配[NotionNext](https://github.com/tangly1024/NotionNext)模板的功能。这样可以直接在Obsidian编辑,整理好之后一键发布。
|
所以我在[原作者](https://github.com/EasyChris/obsidian-to-notion)的基础之上,增加了匹配[NotionNext](https://github.com/tangly1024/NotionNext)模板的功能。这样可以直接在Obsidian编辑,整理好之后一键发布。
|
||||||
|
|
||||||
## 更新说明
|
## 更新说明
|
||||||
|
### 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
|
||||||
|
- 修复了在日语系统下,无法显示设置按钮的错误。
|
||||||
|
- 增加日语翻译。
|
||||||
|
### 1.1.0
|
||||||
|
- 修复设置中自定义标题的显示问题。
|
||||||
|
- 增加了标签同步的控制按钮。以减少空标签集造成的上传失败。
|
||||||
|
|
||||||
|
如果你不想使用同步标签功能,你可以在设置中关闭。不论你在md文件表头添加了tags与否,都不会将标签同步到Notion数据库中。
|
||||||
|
|
||||||
|
如果你需要同步标签到Notion数据库中,**你需要通过如下格式添加表填到md表头中。**
|
||||||
|
|
||||||
|
```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.10
|
||||||
|
|
||||||
- 修正了设置中的中文显示。
|
- 修正了设置中的中文显示。
|
||||||
|
|
||||||
### 0.1.8
|
### 0.1.8
|
||||||
|
|
||||||
- 重新整理了代码,增加了一个仓库转换按钮为之后的多数据库支持作准备。**但是现在还不支持多数据库,如果你的数据库不是NotionNext,你可以不用更新。**
|
- 重新整理了代码,增加了一个仓库转换按钮为之后的多数据库支持作准备。**但是现在还不支持多数据库,如果你的数据库不是NotionNext,你可以不用更新。**
|
||||||
|
|
||||||
### 0.1.7
|
### 0.1.7
|
||||||
|
|
||||||
- [x] 删除了设置中`convert tags`的选项。 你现在可以直接添加tags,而不需要考虑是否开启tags选项。如果你不需要tags,可以直接删除tags选项或者留白。
|
- [x] 删除了设置中`convert tags`的选项。 你现在可以直接添加tags,而不需要考虑是否开启tags选项。如果你不需要tags,可以直接删除tags选项或者留白。
|
||||||
|
|
||||||
## 使用方式
|
## 使用方式
|
||||||
|
|
||||||
### 注意事项
|
### 注意事项
|
||||||
|
|
||||||
本插件现在暂时只能用于匹配[NotionNext](https://github.com/tangly1024/NotionNext)。如果你不是使用这个模板,你只会无限返回`error 400`.
|
本插件现在暂时只能用于匹配[NotionNext](https://github.com/tangly1024/NotionNext)。如果你不是使用这个模板,你只会无限返回`error 400`.
|
||||||
|
|
||||||
所以没有NotionNext需求的,请使用原作者的[Obsidian-to-notion](https://github.com/EasyChris/obsidian-to-notion)
|
所以没有NotionNext需求的,请使用原作者的[Obsidian-to-notion](https://github.com/EasyChris/obsidian-to-notion)
|
||||||
|
|
||||||
### 准备安装
|
### 准备安装
|
||||||
|
|
||||||
在安装插件之前,你必须配置好了以下内容:
|
在安装插件之前,你必须配置好了以下内容:
|
||||||
|
|
||||||
1. 你的NotionNext数据库。
|
1. 你的NotionNext数据库。
|
||||||
@@ -35,29 +122,33 @@
|
|||||||
- icon
|
- icon
|
||||||
|
|
||||||
在最新的0.0.6版本,我还增加了以下内容:
|
在最新的0.0.6版本,我还增加了以下内容:
|
||||||
|
|
||||||
- titleicon: 标题的emoji图标,暂时只能支持emoji
|
- titleicon: 标题的emoji图标,暂时只能支持emoji
|
||||||
- coverurl: 封面图片的url, url可以是任何一种图片的url, 例如jpg,png,svg等等。
|
- coverurl: 封面图片的url, url可以是任何一种图片的url, 例如jpg,png,svg等等。
|
||||||
|
|
||||||
**如果你是直接复制的NotionNext的模板,这些内容应该已经有了。我在原作者的基础之上对本插件的内容进行了更改,所以你只需要保证你的数据库有如上内容,并且所有的字母都是小写!!!**
|
**如果你是直接复制的NotionNext的模板,这些内容应该已经有了。我在原作者的基础之上对本插件的内容进行了更改,所以你只需要保证你的数据库有如上内容,并且所有的字母都是小写!!!**
|
||||||
|
|
||||||
|
|
||||||
**⚠️⚠️⚠️:表头全部小写!!!顺序无所谓!**
|
**⚠️⚠️⚠️:表头全部小写!!!顺序无所谓!**
|
||||||
|
|
||||||
### 安装插件
|
### 安装插件
|
||||||
|
|
||||||
#### 社区插件市场下载
|
#### 社区插件市场下载
|
||||||
|
|
||||||
打开`Obsidian -> 设置 -> 社区插件 -> 浏览 -> 搜索Share to NotionNext`, 然后点击安装。
|
打开`Obsidian -> 设置 -> 社区插件 -> 浏览 -> 搜索Share to NotionNext`, 然后点击安装。
|
||||||
|
|
||||||
#### 手动安装
|
#### 手动安装
|
||||||
|
|
||||||
1. 关闭Obsidian
|
1. 关闭Obsidian
|
||||||
2. 从Release下载插件文件,解压到你的obsidian插件目录下。
|
2. 从Release下载插件文件,解压到你的obsidian插件目录下。
|
||||||
3. 重新打开Obsidian,进入设置,启用插件。
|
3. 重新打开Obsidian,进入设置,启用插件。
|
||||||
4. 在设置中,找到Obsidian to NotionNext,填入你的NotionNext Database ID 和 API token。
|
4. 在设置中,找到Obsidian to NotionNext,填入你的NotionNext Database ID 和 API token。
|
||||||
|
|
||||||
### 使用插件
|
### 使用插件
|
||||||
|
|
||||||
在仓库中我上传了一个模板,你可以直接复制到你的模板文件夹中。然后使用Obsidian的模板功能一键生成新笔记。
|
在仓库中我上传了一个模板,你可以直接复制到你的模板文件夹中。然后使用Obsidian的模板功能一键生成新笔记。
|
||||||
|
|
||||||
|
|
||||||
如果你不想使用模板,你也可以直接在Obsidian中创建一个新的文件,然后复制下边的内容。然后保存。
|
如果你不想使用模板,你也可以直接在Obsidian中创建一个新的文件,然后复制下边的内容。然后保存。
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
---
|
---
|
||||||
# default value has been set.
|
# default value has been set.
|
||||||
@@ -69,6 +160,7 @@
|
|||||||
# 现在阶段一定不要修改表头的名字, please do not change the name of the header in YAML front matter
|
# 现在阶段一定不要修改表头的名字, please do not change the name of the header in YAML front matter
|
||||||
# !!!!!!!!!!!!
|
# !!!!!!!!!!!!
|
||||||
titleicon: 📎 # emoji icon, default is 📜, 默认是📜
|
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, 默认是空
|
coverurl: https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg # default is empty, 默认是空
|
||||||
type: Post # Post or Page, default is Post, 默认是Post
|
type: Post # Post or Page, default is Post, 默认是Post
|
||||||
slug: test # slug for url, default is empty, 默认是空
|
slug: test # slug for url, default is empty, 默认是空
|
||||||
@@ -87,6 +179,7 @@ Contents Below
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
模板使用如下:
|
模板使用如下:
|
||||||

|

|
||||||
|
|
||||||
@@ -100,6 +193,7 @@ Contents Below
|
|||||||
非常感谢原作者的开发,我只是在原作者的基础之上进行了修改,增加了一些功能。如果你觉得这个插件对你有帮助,可以给[原作者](https://github.com/EasyChris/obsidian-to-notion)一个star。
|
非常感谢原作者的开发,我只是在原作者的基础之上进行了修改,增加了一些功能。如果你觉得这个插件对你有帮助,可以给[原作者](https://github.com/EasyChris/obsidian-to-notion)一个star。
|
||||||
|
|
||||||
# Obsidian to Notion
|
# Obsidian to Notion
|
||||||
|
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/CI.yml)
|
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/CI.yml)
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/release.yml)
|
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/release.yml)
|
||||||
[](https://raw.githubusercontent.com/EasyChris/obsidian-to-notion/master/LICENSE)
|
[](https://raw.githubusercontent.com/EasyChris/obsidian-to-notion/master/LICENSE)
|
||||||
@@ -115,31 +209,40 @@ Obsidian share to Notion [English](README.md)
|
|||||||

|

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

|

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

|

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

|

|
||||||
@@ -154,9 +257,6 @@ git clone https://github.com/EasyChris/obsidian-to-notion.git
|
|||||||
|
|
||||||

|

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

|

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

|

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

|

|
||||||
|
|
||||||
|
|
||||||
## 页面 Banner 链接[可选]
|
## 页面 Banner 链接[可选]
|
||||||
|
|
||||||
默认可以不填写
|
默认可以不填写
|
||||||
横幅URL必须是图像URL,例如:https://i.imgur.com/xxx.jpg
|
横幅URL必须是图像URL,例如:https://i.imgur.com/xxx.jpg
|
||||||
|
|
||||||
## Notion ID [可选]
|
## Notion ID [可选]
|
||||||
|
|
||||||
Notion ID是你想分享文件的页面ID。
|
Notion ID是你想分享文件的页面ID。
|
||||||
如果你不写它,notion将分享到默认的链接,如:https://www.notion.so/myworkspace/a8aec43384f447ed84390,访问这个页面将重定向到你的网站页面。
|
如果你不写它,notion将分享到默认的链接,如:<https://www.notion.so/myworkspace/a8aec43384f447ed84390,访问这个页面将重定向到你的网站页面。>
|
||||||
如果你写了Notion ID,它将分享到页面链接如:https://your_user_name.notion.site/myworkspace/a8aec43384f447ed84390。不需要重定向网址。
|
如果你写了Notion ID,它将分享到页面链接如:<https://your_user_name.notion.site/myworkspace/a8aec43384f447ed84390。不需要重定向网址。>
|
||||||
|
|
||||||
## 同步图片
|
## 同步图片
|
||||||
|
|
||||||
@@ -196,6 +297,7 @@ Notion ID是你想分享文件的页面ID。
|
|||||||
[顿顿饭](https://dun.mianbaoduo.com/@easy)
|
[顿顿饭](https://dun.mianbaoduo.com/@easy)
|
||||||
|
|
||||||
# 感谢
|
# 感谢
|
||||||
|
|
||||||
[开发流程 | Obsidian 插件开发文档](https://luhaifeng666.github.io/obsidian-plugin-docs-zh/zh/getting-started/development-workflow.html)
|
[开发流程 | 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 - devbean/obsidian-wordpress: An obsidian plugin for publishing docs to WordPress.](https://github.com/devbean/obsidian-wordpress)
|
||||||
|
|||||||
632
README.html
Normal file
632
README.html
Normal file
@@ -0,0 +1,632 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
||||||
|
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="generator" content="quarto-1.3.450">
|
||||||
|
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
|
|
||||||
|
|
||||||
|
<title>readme</title>
|
||||||
|
<style>
|
||||||
|
code{white-space: pre-wrap;}
|
||||||
|
span.smallcaps{font-variant: small-caps;}
|
||||||
|
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||||||
|
div.column{flex: auto; overflow-x: auto;}
|
||||||
|
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||||
|
ul.task-list{list-style: none;}
|
||||||
|
ul.task-list li input[type="checkbox"] {
|
||||||
|
width: 0.8em;
|
||||||
|
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
/* CSS for syntax highlighting */
|
||||||
|
pre > code.sourceCode { white-space: pre; position: relative; }
|
||||||
|
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
|
||||||
|
pre > code.sourceCode > span:empty { height: 1.2em; }
|
||||||
|
.sourceCode { overflow: visible; }
|
||||||
|
code.sourceCode > span { color: inherit; text-decoration: inherit; }
|
||||||
|
div.sourceCode { margin: 1em 0; }
|
||||||
|
pre.sourceCode { margin: 0; }
|
||||||
|
@media screen {
|
||||||
|
div.sourceCode { overflow: auto; }
|
||||||
|
}
|
||||||
|
@media print {
|
||||||
|
pre > code.sourceCode { white-space: pre-wrap; }
|
||||||
|
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
|
||||||
|
}
|
||||||
|
pre.numberSource code
|
||||||
|
{ counter-reset: source-line 0; }
|
||||||
|
pre.numberSource code > span
|
||||||
|
{ position: relative; left: -4em; counter-increment: source-line; }
|
||||||
|
pre.numberSource code > span > a:first-child::before
|
||||||
|
{ content: counter(source-line);
|
||||||
|
position: relative; left: -1em; text-align: right; vertical-align: baseline;
|
||||||
|
border: none; display: inline-block;
|
||||||
|
-webkit-touch-callout: none; -webkit-user-select: none;
|
||||||
|
-khtml-user-select: none; -moz-user-select: none;
|
||||||
|
-ms-user-select: none; user-select: none;
|
||||||
|
padding: 0 4px; width: 4em;
|
||||||
|
}
|
||||||
|
pre.numberSource { margin-left: 3em; padding-left: 4px; }
|
||||||
|
div.sourceCode
|
||||||
|
{ }
|
||||||
|
@media screen {
|
||||||
|
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
<script src="README_files/libs/clipboard/clipboard.min.js"></script>
|
||||||
|
<script src="README_files/libs/quarto-html/quarto.js"></script>
|
||||||
|
<script src="README_files/libs/quarto-html/popper.min.js"></script>
|
||||||
|
<script src="README_files/libs/quarto-html/tippy.umd.min.js"></script>
|
||||||
|
<script src="README_files/libs/quarto-html/anchor.min.js"></script>
|
||||||
|
<link href="README_files/libs/quarto-html/tippy.css" rel="stylesheet">
|
||||||
|
<link href="README_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
|
||||||
|
<script src="README_files/libs/bootstrap/bootstrap.min.js"></script>
|
||||||
|
<link href="README_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
||||||
|
<link href="README_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="fullcontent">
|
||||||
|
|
||||||
|
<div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
|
||||||
|
|
||||||
|
<main class="content" id="quarto-document-content">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<section id="obsidian-to-notionnext" class="level1">
|
||||||
|
<h1>Obsidian to NotionNext</h1>
|
||||||
|
<p><a href="https://github.com/jxpeng98/obsidian-to-NotionNext/actions/workflows/test.yml"><img src="https://github.com/jxpeng98/obsidian-to-NotionNext/actions/workflows/test.yml/badge.svg" class="img-fluid" alt="test.yml"></a> <a href="https://github.com/jxpeng98/obsidian-to-NotionNext/actions/workflows/release.yml"><img src="https://github.com/jxpeng98/obsidian-to-NotionNext/actions/workflows/release.yml/badge.svg" class="img-fluid" alt="Release Obsidian plugin"></a> <a href="https://GitHub.com/jxpeng98/obsidian-to-NotionNext/releases/"><img src="https://img.shields.io/github/downloads/jxpeng98/obsidian-to-NotionNext/total.svg" class="img-fluid" alt="Github all releases"></a> <a href="https://github.com/jxpeng98/obsidian-to-NotionNext/releases"><img src="https://badgen.net/github/release/jxpeng98/obsidian-to-NotionNext.png" class="img-fluid" alt="GitLab latest release"></a></p>
|
||||||
|
<p><a href="README-zh.md">中文文档</a></p>
|
||||||
|
<p>Thanks to the <a href="https://github.com/EasyChris/obsidian-to-notion">original author</a> for developing such a useful plugin that can synchronize Obsidian to Notion. However, the original repository can only sync Name and Tags information. For those like me who use <a href="https://github.com/tangly1024/NotionNext">NotionNext</a> to set up their website, this presents some limitations. Every time I import, I need to make a lot of modifications.</p>
|
||||||
|
<p>Thus, based on the <a href="https://github.com/EasyChris/obsidian-to-notion">original author’s work</a>, I’ve added a feature to match the <a href="https://github.com/tangly1024/NotionNext">NotionNext</a> template. This way, you can edit directly in Obsidian and publish with a single click after organizing.</p>
|
||||||
|
<p><strong>Now, support both NotionNext and General databases.</strong></p>
|
||||||
|
<section id="update" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="update">Update</h2>
|
||||||
|
<section id="section" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="section">1.0.1</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Fix the custom name element display bug in the settings.</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section id="big-update" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="big-update">1.0.0 (Big Update)</h3>
|
||||||
|
<ul>
|
||||||
|
<li>From this version, you can <strong>modify the first column name (title column, default: ‘title’)</strong> as you want. (<strong>Note: You need to have the ‘tags’ column in your Notion General database, and add <code>tags:</code> in your markdown frontmatter. If not, you will receive <code>network error 400</code>. But you can leave the <code>tags:</code> blank.</strong>)</li>
|
||||||
|
</ul>
|
||||||
|
<p><img src="https://minioapi.pjx.ac.cn/img1/2023/11/4a298b9be3990e9d2201bf2f50ca5a0a.png" class="img-fluid"> Like this: <img src="https://minioapi.pjx.ac.cn/img1/2023/11/4cd8d79cd9dd9dde299e39c666cb3473.gif" class="img-fluid"></p>
|
||||||
|
<ul>
|
||||||
|
<li>Add a switch button to control whether display the setting tabs in the plugin settings for both NotionNext and Notion General databases.</li>
|
||||||
|
</ul>
|
||||||
|
<p><img src="https://minioapi.pjx.ac.cn/img1/2023/11/becb60fc44783842da4b3cf4c322f363.gif" class="img-fluid"></p>
|
||||||
|
</section>
|
||||||
|
<section id="section-1" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="section-1">0.2.6</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Add a switch button to control whether to show the upload command in the command palette.</li>
|
||||||
|
</ul>
|
||||||
|
<p><img src="https://minioapi.pjx.ac.cn/img1/2023/11/147c6a4eaa34da41a6f102558ed77106.png" class="img-fluid"> If you turn off the button for the General database, you won’t see the option for the General database in the upload command list.</p>
|
||||||
|
<p>If you turn off the button for the NotionNext database, you won’t see the option for the NotionNext database in the upload command list.</p>
|
||||||
|
<p><img src="https://minioapi.pjx.ac.cn/img1/2023/11/70b8e4fc2148688ccbd6cfc53ce339a2.png" class="img-fluid"></p>
|
||||||
|
</section>
|
||||||
|
<section id="section-2" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="section-2">0.2.3</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Fix the bug, now you can update normally.</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section id="section-3" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="section-3">0.2.2</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Support both NotionNext and General Notion database.</li>
|
||||||
|
<li>You can have one NotionNext and one General Notion database.</li>
|
||||||
|
<li>General Notion database can only have <code>title</code> and <code>tags</code> columns, and <code>tags</code> columns should be the multi-selected property. <strong>the name of the columns is case sensitive. You should use small letter.</strong></li>
|
||||||
|
</ul>
|
||||||
|
<p><img src="https://minioapi.pjx.ac.cn/img1/2023/11/712a12081d855aa60f82a7b46913ab7e.gif" class="img-fluid"></p>
|
||||||
|
<p><img src="https://minioapi.pjx.ac.cn/img1/2023/11/9de76cecceef74c78884ddfc1c221659.gif" class="img-fluid"></p>
|
||||||
|
</section>
|
||||||
|
<section id="section-4" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="section-4">0.2.1</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Restructure the code</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section id="section-5" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="section-5">0.2.0</h3>
|
||||||
|
<ul>
|
||||||
|
<li>From this version, the interactive logic has been rewritten. When you click the ribbon icon, it will display the sync command for all presetting NotionNext databases. You can choose the database you want to sync to. <strong>However, only NotionNext database is supported for now.</strong></li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section id="section-6" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="section-6">0.1.10</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Fix the Chinese support in the settings.</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section id="section-7" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="section-7">0.1.8</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Rebuild the uploadCommand function, and add one button to select the different databases. <strong>However, only NotionNext database is supported for now.</strong></li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section id="section-8" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="section-8">0.1.7</h3>
|
||||||
|
<ul class="task-list">
|
||||||
|
<li><input type="checkbox" checked="">Removed the <code>convert tag</code> option. Now, you can directly add tags in the YAML front matter. If you don’t want to add tags, you can delete the tags in the YAML front matter or leave the tags blank.</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="how-to-use" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="how-to-use">How to Use</h2>
|
||||||
|
<section id="precautions" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="precautions">Precautions</h3>
|
||||||
|
<p>For now, this plugin is exclusively for <a href="https://github.com/tangly1024/NotionNext">NotionNext</a>. If you’re not using this template, you’ll keep receiving <code>error 400</code>.</p>
|
||||||
|
<p>For those without a NotionNext requirement, please use the original <a href="https://github.com/EasyChris/obsidian-to-notion">Obsidian-to-notion</a>.</p>
|
||||||
|
</section>
|
||||||
|
<section id="pre-installation-steps" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="pre-installation-steps">Pre-Installation Steps</h3>
|
||||||
|
<p>Before installing the plugin, you must have set up the following:</p>
|
||||||
|
<ol type="1">
|
||||||
|
<li>Your NotionNext database.</li>
|
||||||
|
<li>According to the original author’s readme.md, set up the Notion API, and it should already be associated with your NotionNext repository.</li>
|
||||||
|
<li>NotionNext Database ID</li>
|
||||||
|
<li>Your NotionNext database should have the following contents:
|
||||||
|
<ul>
|
||||||
|
<li>type</li>
|
||||||
|
<li>title</li>
|
||||||
|
<li>slug</li>
|
||||||
|
<li>category</li>
|
||||||
|
<li>tags</li>
|
||||||
|
<li>date</li>
|
||||||
|
<li>status</li>
|
||||||
|
<li>summary</li>
|
||||||
|
<li>password</li>
|
||||||
|
<li>icon</li>
|
||||||
|
</ul></li>
|
||||||
|
</ol>
|
||||||
|
<p>From version 0.0.6, I also add the following contents: - titleicon: the unique icon for each post, it can only support emoji currently. - cover url: the cover image for each post, it should be end with a type of image, such as .jpg, .png, .gif, etc.</p>
|
||||||
|
<p><strong>If you’ve directly copied the NotionNext template, these contents should already exist. I’ve made changes to this plugin based on the original author’s work. All you need to ensure is that your database has the above content, and every letter is in lowercase!!!</strong></p>
|
||||||
|
<p><strong>⚠️⚠️⚠️: All headers are in lowercase!!! The order doesn’t matter!</strong></p>
|
||||||
|
</section>
|
||||||
|
<section id="plugin-installation" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="plugin-installation">Plugin Installation</h3>
|
||||||
|
<section id="install-via-community-plugins" class="level4">
|
||||||
|
<h4 class="anchored" data-anchor-id="install-via-community-plugins">Install via Community Plugins</h4>
|
||||||
|
<p>Open <code>Obsidian settings -> Community Plugins -> Browse -> NotionNext -> Share to NotionNext</code></p>
|
||||||
|
</section>
|
||||||
|
<section id="mannually-install" class="level4">
|
||||||
|
<h4 class="anchored" data-anchor-id="mannually-install">Mannually Install</h4>
|
||||||
|
<ol type="1">
|
||||||
|
<li>Close Obsidian.</li>
|
||||||
|
<li>Download the plugin file from Release and unzip it into your Obsidian plugin directory.</li>
|
||||||
|
<li>Re-open Obsidian, go to settings, and enable the plugin.</li>
|
||||||
|
<li>In the settings, find Obsidian to NotionNext, and enter your NotionNext Database ID and API token.</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="how-to-use-1" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="how-to-use-1">How to Use</h3>
|
||||||
|
</section>
|
||||||
|
<section id="using-the-plugin" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="using-the-plugin">Using the Plugin</h3>
|
||||||
|
<p>In the repository, I have uploaded a template which you can directly copy into your template folder. After that, use Obsidian’s template feature to create a new note with one click.</p>
|
||||||
|
<p>If you don’t want to use the template, you can also directly create a new file in Obsidian and then copy the content below. Then save it.</p>
|
||||||
|
<div class="sourceCode" id="cb1"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co">---</span></span>
|
||||||
|
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="co"># default value has been set.</span></span>
|
||||||
|
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="co"># for any unwanted value, you can delete it or set it to empty.</span></span>
|
||||||
|
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="co"># for example, if you donot want to set password, you can delete password: "1234" or set it to password: ""</span></span>
|
||||||
|
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="co"># 我已经在插件中设置了默认值,如果有不需要的选项,可以直接删除。</span></span>
|
||||||
|
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="co"># 例如你不需要密码选项,你可以将password: "1234"删除,或者将它设置为空。</span></span>
|
||||||
|
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="co"># !!!!!!!!!!!!</span></span>
|
||||||
|
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="co"># 现在阶段一定不要修改表头的名字, please do not change the name of the header in YAML front matter</span></span>
|
||||||
|
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="co"># !!!!!!!!!!!!</span></span>
|
||||||
|
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a><span class="an">titleicon:</span><span class="co"> 📎 # emoji icon, default is 📜, 默认是📜</span></span>
|
||||||
|
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a><span class="an">date:</span><span class="co"> 2023-07-23 # default is today, 默认是今天。 Format is YYYY-MM-DD, 格式是YYYY-MM-DD</span></span>
|
||||||
|
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a><span class="an">coverurl:</span><span class="co"> https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg # default is empty, 默认是空</span></span>
|
||||||
|
<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a><span class="an">type:</span><span class="co"> Post # Post or Page, default is Post, 默认是Post</span></span>
|
||||||
|
<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a><span class="an">slug:</span><span class="co"> test # slug for url, default is empty, 默认是空</span></span>
|
||||||
|
<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a><span class="an">stats:</span><span class="co"> Draft # Draft, Invisible, Published, default is Draft, 默认是Draft</span></span>
|
||||||
|
<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a><span class="an">category:</span><span class="co"> test # default is 'Obsidian', 默认是'Obsidian'</span></span>
|
||||||
|
<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a><span class="an">summary:</span><span class="co"> this is a summary for test post # default is empty, 默认是空</span></span>
|
||||||
|
<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a><span class="an">icon:</span><span class="co"> fa-solid fa-camera # you can ignore this, default is empty, 默认是空,可直接删除</span></span>
|
||||||
|
<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a><span class="an">password:</span><span class="co"> "1234" # if you donot want to set password, you can delete this line, default is empty, 默认是空,可直接删除</span></span>
|
||||||
|
<span id="cb1-20"><a href="#cb1-20" aria-hidden="true" tabindex="-1"></a><span class="co"># 现在必须开启tags选项,否则会报错</span></span>
|
||||||
|
<span id="cb1-21"><a href="#cb1-21" aria-hidden="true" tabindex="-1"></a><span class="an">tags:</span></span>
|
||||||
|
<span id="cb1-22"><a href="#cb1-22" aria-hidden="true" tabindex="-1"></a><span class="co"> - test # tags for post</span></span>
|
||||||
|
<span id="cb1-23"><a href="#cb1-23" aria-hidden="true" tabindex="-1"></a><span class="co"> - web # add more tags if you want</span></span>
|
||||||
|
<span id="cb1-24"><a href="#cb1-24" aria-hidden="true" tabindex="-1"></a><span class="co">---</span></span>
|
||||||
|
<span id="cb1-25"><a href="#cb1-25" aria-hidden="true" tabindex="-1"></a></span>
|
||||||
|
<span id="cb1-26"><a href="#cb1-26" aria-hidden="true" tabindex="-1"></a>Contents Below</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
|
<p>Usage of the template is as follows: <img src="https://minioapi.pjx.ac.cn/img1/2023/09/354b950e5777b48832c2475e4a31f2cc.gif" class="img-fluid"></p>
|
||||||
|
<p><strong>Plugin preview is shown below</strong> <img src="https://minioapi.pjx.ac.cn/img1/2023/09/d6199619b68fab218fca8ae0cebece78.gif" class="img-fluid"></p>
|
||||||
|
<hr>
|
||||||
|
<p><strong>Original README.md</strong></p>
|
||||||
|
<p>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 <a href="https://github.com/EasyChris/obsidian-to-notion">original author</a> a star.</p>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="obsidian-to-notion" class="level1">
|
||||||
|
<h1>Obsidian to Notion</h1>
|
||||||
|
<p><a href="https://github.com/Easychris/obsidian-to-notion/actions/workflows/CI.yml"><img src="https://github.com/Easychris/obsidian-to-notion/actions/workflows/CI.yml/badge.svg" class="img-fluid"></a> <a href="https://github.com/Easychris/obsidian-to-notion/actions/workflows/release.yml"><img src="https://github.com/Easychris/obsidian-to-notion/actions/workflows/release.yml/badge.svg" class="img-fluid" alt="Release Obsidian plugin"></a> <a href="https://raw.githubusercontent.com/EasyChris/obsidian-to-notion/master/LICENSE"><img src="https://img.shields.io/github/license/EasyChris/obsidian-to-notion.png" class="img-fluid" alt="GitHub license"></a> <a href="https://GitHub.com/Easychris/obsidian-to-notion/releases/"><img src="https://img.shields.io/github/downloads/Easychris/obsidian-to-notion/total.svg" class="img-fluid" alt="Github all releases"></a> <a href="https://github.com/Easychris/obsidian-to-notion/releases"><img src="https://badgen.net/github/release/Easychris/obsidian-to-notion/.png" class="img-fluid" alt="GitLab latest release"></a></p>
|
||||||
|
<p>Share of obsidian to Notion <a href="README-zh.md">中文文档</a></p>
|
||||||
|
<p>Sharing files from Obsidian to Notion with a single click, and Obsidian will automatically add the Notion share link</p>
|
||||||
|
<p>You are welcome to offer it a star if it can benefit you.</p>
|
||||||
|
<p><img src="./doc/1.gif" class="img-fluid"></p>
|
||||||
|
</section>
|
||||||
|
<section id="todo" class="level1">
|
||||||
|
<h1>TODO</h1>
|
||||||
|
<section id="todo-board" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="todo-board"><a href="https://github.com/users/EasyChris/projects/3/views/1">TODO Board</a></h3>
|
||||||
|
<ul class="task-list">
|
||||||
|
<li><input type="checkbox" checked="">support for custom page banner</li>
|
||||||
|
<li><input type="checkbox" checked="">update the exsit page</li>
|
||||||
|
<li><input type="checkbox" checked="">support for mult language</li>
|
||||||
|
<li><input type="checkbox" checked="">support for auto copy the share link to clipboard</li>
|
||||||
|
<li><input type="checkbox" checked="">support for mobile</li>
|
||||||
|
<li><input type="checkbox" checked="">support tags thank for <a href="https://github.com/jannikbuscha"><span class="citation" data-cites="jannikbuscha">@jannikbuscha</span></a></li>
|
||||||
|
<li><input type="checkbox">transfer the bi-link format like [[]] into the format that Notion supports.</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="how-to-use-2" class="level1">
|
||||||
|
<h1>How to use</h1>
|
||||||
|
<section id="install-the-plugin" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="install-the-plugin">Install the plugin</h2>
|
||||||
|
<section id="marketplace-download" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="marketplace-download">Marketplace download</h3>
|
||||||
|
<p>Open obsidian setting -> Add plugin -> Search -> notion</p>
|
||||||
|
<p><img src="https://afox-1256168983.cos.ap-shanghai.myqcloud.com/20220628214145.png" class="img-fluid"></p>
|
||||||
|
</section>
|
||||||
|
<section id="brat" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="brat">BRAT</h3>
|
||||||
|
<p>Enter <code>BRAT</code> into the plugin market center to find it. Add <code>EasyChris/obsidian-to-notion</code> to the list of BRAT plugins that have been installed. Return to the plugin center and turn it on.</p>
|
||||||
|
</section>
|
||||||
|
<section id="manual-installation" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="manual-installation">Manual installation</h3>
|
||||||
|
<pre><code>cd YOUR_OBSIDIAN_FOLDER/.obsidian/plugins/
|
||||||
|
git clone https://github.com/EasyChris/obsidian-to-notion.git</code></pre>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="apply-notion-api" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="apply-notion-api">Apply Notion API</h2>
|
||||||
|
<p>Official reference documentation: <a href="https://developers.notion.com/docs">https://developers.notion.com/docs</a></p>
|
||||||
|
<section id="step-1-create-integration" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="step-1-create-integration">Step 1: Create integration</h3>
|
||||||
|
<p>Go to <a href="https://www.notion.com/my-integrations">https://www.notion.com/my-integrations</a> Once created, copy <code>secrets toekn</code> <img src="https://files.readme.io/2ec137d-093ad49-create-integration.gif" class="img-fluid"></p>
|
||||||
|
<section id="note" class="level4">
|
||||||
|
<h4 class="anchored" data-anchor-id="note">Note</h4>
|
||||||
|
<p>database first custom name must be “Name”, otherwise sync to notion will be failed</p>
|
||||||
|
<p><img src="https://afox-1256168983.cos.ap-shanghai.myqcloud.com/20220618102029.png" class="img-fluid"></p>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="step-2-share-a-database-with-your-integration" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="step-2-share-a-database-with-your-integration">Step 2: Share a database with your integration</h3>
|
||||||
|
<p>Create a new page (with public permissions) Create a new database in the page -> you need <code>full page database</code> <img src="./doc/3.gif" class="img-fluid"></p>
|
||||||
|
<p>Add <code>integration</code> to your new database</p>
|
||||||
|
<p><img src="./doc/6.gif" class="img-fluid"></p>
|
||||||
|
</section>
|
||||||
|
<section id="step-3-copy-the-database-id" class="level3">
|
||||||
|
<h3 class="anchored" data-anchor-id="step-3-copy-the-database-id">Step 3: Copy the database ID</h3>
|
||||||
|
<pre><code>https://www.notion.so/myworkspace/a8aec43384f447ed84390e8e42c2e089?v=...
|
||||||
|
| --------- Database ID --------|
|
||||||
|
</code></pre>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="open-the-plugin-configuration" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="open-the-plugin-configuration">Open the plugin configuration</h2>
|
||||||
|
<p>Fill the configuration with the <code>NOTION_API_KEY</code> and <code>DATABASE_ID</code> you got <img src="./doc/2.png" class="img-fluid"></p>
|
||||||
|
</section>
|
||||||
|
<section id="upload-file-content-to-notion" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="upload-file-content-to-notion">Upload file content to notion</h2>
|
||||||
|
<p>Click the uploadCommand notion button <img src="./doc/4.png" class="img-fluid"> A share link will be automatically generated after successful uploadCommand <img src="./doc/5.png" class="img-fluid"></p>
|
||||||
|
</section>
|
||||||
|
<section id="banner-url-option" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="banner-url-option">Banner URL [option]</h2>
|
||||||
|
<p>Banner url must be a image url like: <a href="https://i.imgur.com/xxx.jpg" class="uri">https://i.imgur.com/xxx.jpg</a> If you don’t want to use banner, leave it blank</p>
|
||||||
|
</section>
|
||||||
|
<section id="convert-tags-option" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="convert-tags-option">Convert Tags [option]</h2>
|
||||||
|
<p>Transfer the Obsidian tags to the Notion table. It requires the column with the name ‘Tags’. <img src="./doc/7.png" class="img-fluid"></p>
|
||||||
|
<p>Add tags to your notion page</p>
|
||||||
|
<p><img src="./doc/10.png" class="img-fluid"></p>
|
||||||
|
<ul>
|
||||||
|
<li>open plugin convert tags</li>
|
||||||
|
</ul>
|
||||||
|
<p><img src="./doc/8.png" class="img-fluid"></p>
|
||||||
|
<ul>
|
||||||
|
<li>add tags in the head</li>
|
||||||
|
</ul>
|
||||||
|
<div class="sourceCode" id="cb4"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="co">---</span></span>
|
||||||
|
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="an">tags:</span><span class="co"> [tag1,tag2]</span></span>
|
||||||
|
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="co">---</span></span>
|
||||||
|
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a></span>
|
||||||
|
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a>this is test tags</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
|
<div class="sourceCode" id="cb5"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co">---</span></span>
|
||||||
|
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="an">tags:</span></span>
|
||||||
|
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="co"> - tag4</span></span>
|
||||||
|
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="co">---</span></span>
|
||||||
|
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a></span>
|
||||||
|
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a>this is test tags</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
|
<p><img src="./doc/9.png" class="img-fluid"></p>
|
||||||
|
<p>Thanks for <a href="https://github.com/jannikbuscha"><span class="citation" data-cites="jannikbuscha">@jannikbuscha</span></a> contribution</p>
|
||||||
|
</section>
|
||||||
|
<section id="notion-id-option" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="notion-id-option">Notion ID [option]</h2>
|
||||||
|
<p>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: <a href="https://www.notion.so/myworkspace/a8aec43384f447ed84390" class="uri">https://www.notion.so/myworkspace/a8aec43384f447ed84390</a> 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: <a href="https://your_user_name.notion.site/myworkspace/a8aec43384f447ed84390" class="uri">https://your_user_name.notion.site/myworkspace/a8aec43384f447ed84390</a>. The visiter don’t need to redirect url.</p>
|
||||||
|
</section>
|
||||||
|
<section id="sync-image-to-notion" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="sync-image-to-notion">Sync image to Notion</h2>
|
||||||
|
<p>To sync images to your oss or cos bucket, use the <a href="https://github.com/renmu123/obsidian-image-auto-upload-plugin">Obsidian Image Auto Upload Plugin</a>.</p>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="development" class="level1">
|
||||||
|
<h1>Development</h1>
|
||||||
|
<pre><code>git clone https://github.com/EasyChris/obsidian-to-notion.git
|
||||||
|
yarn install
|
||||||
|
yarn dev</code></pre>
|
||||||
|
<section id="release" class="level2">
|
||||||
|
<h2 class="anchored" data-anchor-id="release">Release</h2>
|
||||||
|
<pre><code>node update-version.js
|
||||||
|
./release.sh</code></pre>
|
||||||
|
<p>```</p>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section id="thanks" class="level1">
|
||||||
|
<h1>Thanks</h1>
|
||||||
|
<p><a href="https://luhaifeng666.github.io/obsidian-plugin-docs-zh/zh/getting-started/development-workflow.html">Development Process | Obsidian Plugin Development Documentation</a></p>
|
||||||
|
<p><a href="https://github.com/devbean/obsidian-wordpress">GitHub - devbean/obsidian-wordpress: An obsidian plugin for publishing docs to WordPress.</a></p>
|
||||||
|
<p><a href="https://github.com/obsidianmd/obsidian-api">GitHub - obsidianmd/obsidian-api</a></p>
|
||||||
|
<p><a href="https://github.dev/zhaohongxuan/obsidian-weread-plugin">GitHub - Easychris/obsidian-to-notion: Obsidian Weread Plugin is an plugin to sync Weread(微信读书) hightlights and annotations into your Obsidian Vault.</a></p>
|
||||||
|
<p><a href="https://github.com/Quorafind/Obsidian-Memos">GitHub - Quorafind/Obsidian-Memos: A quick capture plugin for Obsidian, all data from your notes.</a></p>
|
||||||
|
<p><a href="https://github.com/jannikbuscha">https://github.com/jannikbuscha/obsidian-to-notion</a></p>
|
||||||
|
</section>
|
||||||
|
<section id="license" class="level1">
|
||||||
|
<h1>License</h1>
|
||||||
|
<p>GNU GPLv3</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
<!-- /main column -->
|
||||||
|
<script id="quarto-html-after-body" type="application/javascript">
|
||||||
|
window.document.addEventListener("DOMContentLoaded", function (event) {
|
||||||
|
const toggleBodyColorMode = (bsSheetEl) => {
|
||||||
|
const mode = bsSheetEl.getAttribute("data-mode");
|
||||||
|
const bodyEl = window.document.querySelector("body");
|
||||||
|
if (mode === "dark") {
|
||||||
|
bodyEl.classList.add("quarto-dark");
|
||||||
|
bodyEl.classList.remove("quarto-light");
|
||||||
|
} else {
|
||||||
|
bodyEl.classList.add("quarto-light");
|
||||||
|
bodyEl.classList.remove("quarto-dark");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const toggleBodyColorPrimary = () => {
|
||||||
|
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
|
||||||
|
if (bsSheetEl) {
|
||||||
|
toggleBodyColorMode(bsSheetEl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toggleBodyColorPrimary();
|
||||||
|
const icon = "";
|
||||||
|
const anchorJS = new window.AnchorJS();
|
||||||
|
anchorJS.options = {
|
||||||
|
placement: 'right',
|
||||||
|
icon: icon
|
||||||
|
};
|
||||||
|
anchorJS.add('.anchored');
|
||||||
|
const isCodeAnnotation = (el) => {
|
||||||
|
for (const clz of el.classList) {
|
||||||
|
if (clz.startsWith('code-annotation-')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const clipboard = new window.ClipboardJS('.code-copy-button', {
|
||||||
|
text: function(trigger) {
|
||||||
|
const codeEl = trigger.previousElementSibling.cloneNode(true);
|
||||||
|
for (const childEl of codeEl.children) {
|
||||||
|
if (isCodeAnnotation(childEl)) {
|
||||||
|
childEl.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return codeEl.innerText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
clipboard.on('success', function(e) {
|
||||||
|
// button target
|
||||||
|
const button = e.trigger;
|
||||||
|
// don't keep focus
|
||||||
|
button.blur();
|
||||||
|
// flash "checked"
|
||||||
|
button.classList.add('code-copy-button-checked');
|
||||||
|
var currentTitle = button.getAttribute("title");
|
||||||
|
button.setAttribute("title", "Copied!");
|
||||||
|
let tooltip;
|
||||||
|
if (window.bootstrap) {
|
||||||
|
button.setAttribute("data-bs-toggle", "tooltip");
|
||||||
|
button.setAttribute("data-bs-placement", "left");
|
||||||
|
button.setAttribute("data-bs-title", "Copied!");
|
||||||
|
tooltip = new bootstrap.Tooltip(button,
|
||||||
|
{ trigger: "manual",
|
||||||
|
customClass: "code-copy-button-tooltip",
|
||||||
|
offset: [0, -8]});
|
||||||
|
tooltip.show();
|
||||||
|
}
|
||||||
|
setTimeout(function() {
|
||||||
|
if (tooltip) {
|
||||||
|
tooltip.hide();
|
||||||
|
button.removeAttribute("data-bs-title");
|
||||||
|
button.removeAttribute("data-bs-toggle");
|
||||||
|
button.removeAttribute("data-bs-placement");
|
||||||
|
}
|
||||||
|
button.setAttribute("title", currentTitle);
|
||||||
|
button.classList.remove('code-copy-button-checked');
|
||||||
|
}, 1000);
|
||||||
|
// clear code selection
|
||||||
|
e.clearSelection();
|
||||||
|
});
|
||||||
|
function tippyHover(el, contentFn) {
|
||||||
|
const config = {
|
||||||
|
allowHTML: true,
|
||||||
|
content: contentFn,
|
||||||
|
maxWidth: 500,
|
||||||
|
delay: 100,
|
||||||
|
arrow: false,
|
||||||
|
appendTo: function(el) {
|
||||||
|
return el.parentElement;
|
||||||
|
},
|
||||||
|
interactive: true,
|
||||||
|
interactiveBorder: 10,
|
||||||
|
theme: 'quarto',
|
||||||
|
placement: 'bottom-start'
|
||||||
|
};
|
||||||
|
window.tippy(el, config);
|
||||||
|
}
|
||||||
|
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
|
||||||
|
for (var i=0; i<noterefs.length; i++) {
|
||||||
|
const ref = noterefs[i];
|
||||||
|
tippyHover(ref, function() {
|
||||||
|
// use id or data attribute instead here
|
||||||
|
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
|
||||||
|
try { href = new URL(href).hash; } catch {}
|
||||||
|
const id = href.replace(/^#\/?/, "");
|
||||||
|
const note = window.document.getElementById(id);
|
||||||
|
return note.innerHTML;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let selectedAnnoteEl;
|
||||||
|
const selectorForAnnotation = ( cell, annotation) => {
|
||||||
|
let cellAttr = 'data-code-cell="' + cell + '"';
|
||||||
|
let lineAttr = 'data-code-annotation="' + annotation + '"';
|
||||||
|
const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
|
||||||
|
return selector;
|
||||||
|
}
|
||||||
|
const selectCodeLines = (annoteEl) => {
|
||||||
|
const doc = window.document;
|
||||||
|
const targetCell = annoteEl.getAttribute("data-target-cell");
|
||||||
|
const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
|
||||||
|
const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
|
||||||
|
const lines = annoteSpan.getAttribute("data-code-lines").split(",");
|
||||||
|
const lineIds = lines.map((line) => {
|
||||||
|
return targetCell + "-" + line;
|
||||||
|
})
|
||||||
|
let top = null;
|
||||||
|
let height = null;
|
||||||
|
let parent = null;
|
||||||
|
if (lineIds.length > 0) {
|
||||||
|
//compute the position of the single el (top and bottom and make a div)
|
||||||
|
const el = window.document.getElementById(lineIds[0]);
|
||||||
|
top = el.offsetTop;
|
||||||
|
height = el.offsetHeight;
|
||||||
|
parent = el.parentElement.parentElement;
|
||||||
|
if (lineIds.length > 1) {
|
||||||
|
const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
|
||||||
|
const bottom = lastEl.offsetTop + lastEl.offsetHeight;
|
||||||
|
height = bottom - top;
|
||||||
|
}
|
||||||
|
if (top !== null && height !== null && parent !== null) {
|
||||||
|
// cook up a div (if necessary) and position it
|
||||||
|
let div = window.document.getElementById("code-annotation-line-highlight");
|
||||||
|
if (div === null) {
|
||||||
|
div = window.document.createElement("div");
|
||||||
|
div.setAttribute("id", "code-annotation-line-highlight");
|
||||||
|
div.style.position = 'absolute';
|
||||||
|
parent.appendChild(div);
|
||||||
|
}
|
||||||
|
div.style.top = top - 2 + "px";
|
||||||
|
div.style.height = height + 4 + "px";
|
||||||
|
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
|
||||||
|
if (gutterDiv === null) {
|
||||||
|
gutterDiv = window.document.createElement("div");
|
||||||
|
gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
|
||||||
|
gutterDiv.style.position = 'absolute';
|
||||||
|
const codeCell = window.document.getElementById(targetCell);
|
||||||
|
const gutter = codeCell.querySelector('.code-annotation-gutter');
|
||||||
|
gutter.appendChild(gutterDiv);
|
||||||
|
}
|
||||||
|
gutterDiv.style.top = top - 2 + "px";
|
||||||
|
gutterDiv.style.height = height + 4 + "px";
|
||||||
|
}
|
||||||
|
selectedAnnoteEl = annoteEl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const unselectCodeLines = () => {
|
||||||
|
const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
|
||||||
|
elementsIds.forEach((elId) => {
|
||||||
|
const div = window.document.getElementById(elId);
|
||||||
|
if (div) {
|
||||||
|
div.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
selectedAnnoteEl = undefined;
|
||||||
|
};
|
||||||
|
// Attach click handler to the DT
|
||||||
|
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
|
||||||
|
for (const annoteDlNode of annoteDls) {
|
||||||
|
annoteDlNode.addEventListener('click', (event) => {
|
||||||
|
const clickedEl = event.target;
|
||||||
|
if (clickedEl !== selectedAnnoteEl) {
|
||||||
|
unselectCodeLines();
|
||||||
|
const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
|
||||||
|
if (activeEl) {
|
||||||
|
activeEl.classList.remove('code-annotation-active');
|
||||||
|
}
|
||||||
|
selectCodeLines(clickedEl);
|
||||||
|
clickedEl.classList.add('code-annotation-active');
|
||||||
|
} else {
|
||||||
|
// Unselect the line
|
||||||
|
unselectCodeLines();
|
||||||
|
clickedEl.classList.remove('code-annotation-active');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const findCites = (el) => {
|
||||||
|
const parentEl = el.parentElement;
|
||||||
|
if (parentEl) {
|
||||||
|
const cites = parentEl.dataset.cites;
|
||||||
|
if (cites) {
|
||||||
|
return {
|
||||||
|
el,
|
||||||
|
cites: cites.split(' ')
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return findCites(el.parentElement)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
|
||||||
|
for (var i=0; i<bibliorefs.length; i++) {
|
||||||
|
const ref = bibliorefs[i];
|
||||||
|
const citeInfo = findCites(ref);
|
||||||
|
if (citeInfo) {
|
||||||
|
tippyHover(citeInfo.el, function() {
|
||||||
|
var popup = window.document.createElement('div');
|
||||||
|
citeInfo.cites.forEach(function(cite) {
|
||||||
|
var citeDiv = window.document.createElement('div');
|
||||||
|
citeDiv.classList.add('hanging-indent');
|
||||||
|
citeDiv.classList.add('csl-entry');
|
||||||
|
var biblioDiv = window.document.getElementById('ref-' + cite);
|
||||||
|
if (biblioDiv) {
|
||||||
|
citeDiv.innerHTML = biblioDiv.innerHTML;
|
||||||
|
}
|
||||||
|
popup.appendChild(citeDiv);
|
||||||
|
});
|
||||||
|
return popup.innerHTML;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</div> <!-- /content -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body></html>
|
||||||
167
README.md
167
README.md
@@ -1,26 +1,127 @@
|
|||||||
# Obsidian to NotionNext
|
# Obsidian to 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)
|
||||||
|
|
||||||
[中文文档](README-zh.md)
|
[中文文档](README-zh.md)
|
||||||
|
|
||||||
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 Tags 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.
|
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.
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
**Now, support both NotionNext and General databases.**
|
||||||
|
|
||||||
## Update
|
## Update
|
||||||
|
### 1.1.2
|
||||||
|
- Fix the typo that you cannot sync the markdown file `status` in the frontmatter to NotionNext. You can use `stats` or `status` to sync the status of the post to NotionNext. This update will not affect the function of syncing to General database.
|
||||||
|
- 修复了一个拼写错误,导致无法同步`status`到NotionNext。现在你可以使用`stats`或者`status`来同步文章的状态到NotionNext。这个更新不会影响到同步到General数据库的功能。
|
||||||
|
- **Both `stats` and `status` will work, but you can only use one of them.**
|
||||||
|
- **`stats`和`status`都可以使用,但是你只能使用其中一个。**
|
||||||
|
|
||||||
|
For example,
|
||||||
|
```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
|
||||||
|
- Fix the setting display bug in Japanese.
|
||||||
|
- Add Japanese translation.
|
||||||
|
|
||||||
|
### 1.1.0
|
||||||
|
- Fix the custom name setting tab display bug.
|
||||||
|
- Add a toggle to control whether to sync `tags` since the empty tags may cause the syncing error.
|
||||||
|
|
||||||
|
If you switch off the `tags` function in the plugin settings, it will ignore the `tags` in your frontmatter.
|
||||||
|
|
||||||
|
If you prefer to sync tags to Notion database, you can switch on the `tags` function in the plugin settings. **You can only use the following format for tags:**
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tags: #empty tags, option 1
|
||||||
|
tags: [test,test1,test2] # use the square brackets, option 2
|
||||||
|
tags:
|
||||||
|
- test
|
||||||
|
- test1
|
||||||
|
- test2 # use the dash option 3
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.0.1
|
||||||
|
|
||||||
|
- Fix the custom name element display bug in the settings.
|
||||||
|
|
||||||
|
### 1.0.0 (Big Update)
|
||||||
|
|
||||||
|
- From this version, you can **modify the first column name (title column, default: 'title')** as you want. (**Note: You need to have the 'tags' column in your Notion General database, and add `tags:` in your markdown frontmatter. If not, you will receive `network error 400`. But you can leave the `tags:` blank.**)
|
||||||
|
|
||||||
|

|
||||||
|
Like this:
|
||||||
|

|
||||||
|
|
||||||
|
- Add a switch button to control whether display the setting tabs in the plugin settings for both NotionNext and Notion General databases.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 0.2.6
|
||||||
|
|
||||||
|
- Add a switch button to control whether to show the upload command in the command palette.
|
||||||
|
|
||||||
|
<!-- 
|
||||||
|
If you turn off the button for the General database, you won't see the option for the General database in the upload command list.
|
||||||
|
|
||||||
|
If you turn off the button for the NotionNext database, you won't see the option for the NotionNext database in the upload command list.
|
||||||
|
|
||||||
|
 -->
|
||||||
|
|
||||||
|
### 0.2.3
|
||||||
|
|
||||||
|
- Fix the bug, now you can update normally.
|
||||||
|
|
||||||
|
### 0.2.2
|
||||||
|
|
||||||
|
- Support both NotionNext and General Notion database.
|
||||||
|
- You can have one NotionNext and one General Notion database.
|
||||||
|
- General Notion database can only have `title` and `tags` columns, and `tags` columns should be the multi-selected property. **the name of the columns is case sensitive. You should use small letter.**
|
||||||
|
|
||||||
|

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

|
||||||
|
|
||||||
|
### 0.2.1
|
||||||
|
|
||||||
|
- Restructure the code
|
||||||
|
|
||||||
|
### 0.2.0
|
||||||
|
|
||||||
|
- From this version, the interactive logic has been rewritten. When you click the ribbon icon, it will display the sync command for all presetting NotionNext databases. You can choose the database you want to sync to. **However, only NotionNext database is supported for now.**
|
||||||
|
|
||||||
### 0.1.10
|
### 0.1.10
|
||||||
|
|
||||||
- Fix the Chinese support in the settings.
|
- Fix the Chinese support in the settings.
|
||||||
|
|
||||||
### 0.1.8
|
### 0.1.8
|
||||||
- Rebuild the upload function, and add one button to select the different databases. **However, only NotionNext database is supported for now.**
|
|
||||||
|
- Rebuild the uploadCommand function, and add one button to select the different databases. **However, only NotionNext database is supported for now.**
|
||||||
|
|
||||||
### 0.1.7
|
### 0.1.7
|
||||||
|
|
||||||
- [x] Removed the `convert tag` option. Now, you can directly add tags in the YAML front matter. If you don't want to add tags, you can delete the tags in the YAML front matter or leave the tags blank.
|
- [x] Removed the `convert tag` option. Now, you can directly add tags in the YAML front matter. If you don't want to add tags, you can delete the tags in the YAML front matter or leave the tags blank.
|
||||||
|
|
||||||
|
|
||||||
## How to Use
|
## How to Use
|
||||||
|
|
||||||
### Precautions
|
### Precautions
|
||||||
|
|
||||||
For now, this plugin is exclusively for [NotionNext](https://github.com/tangly1024/NotionNext). If you're not using this template, you'll keep receiving `error 400`.
|
For now, this plugin is exclusively for [NotionNext](https://github.com/tangly1024/NotionNext). If you're not using this template, you'll keep receiving `error 400`.
|
||||||
|
|
||||||
For those without a NotionNext requirement, please use the original [Obsidian-to-notion](https://github.com/EasyChris/obsidian-to-notion).
|
For those without a NotionNext requirement, please use the original [Obsidian-to-notion](https://github.com/EasyChris/obsidian-to-notion).
|
||||||
|
|
||||||
### Pre-Installation Steps
|
### Pre-Installation Steps
|
||||||
|
|
||||||
Before installing the plugin, you must have set up the following:
|
Before installing the plugin, you must have set up the following:
|
||||||
|
|
||||||
1. Your NotionNext database.
|
1. Your NotionNext database.
|
||||||
2. According to the original author's readme.md, set up the Notion API, and it should already be associated with your NotionNext repository.
|
2. According to the original author's readme.md, set up the Notion API, and it should already be associated with your NotionNext repository.
|
||||||
3. NotionNext Database ID
|
3. NotionNext Database ID
|
||||||
@@ -45,20 +146,26 @@ From version 0.0.6, I also add the following contents:
|
|||||||
**⚠️⚠️⚠️: All headers are in lowercase!!! The order doesn't matter!**
|
**⚠️⚠️⚠️: All headers are in lowercase!!! The order doesn't matter!**
|
||||||
|
|
||||||
### Plugin Installation
|
### Plugin Installation
|
||||||
|
|
||||||
#### Install via Community Plugins
|
#### Install via Community Plugins
|
||||||
|
|
||||||
Open `Obsidian settings -> Community Plugins -> Browse -> NotionNext -> Share to NotionNext`
|
Open `Obsidian settings -> Community Plugins -> Browse -> NotionNext -> Share to NotionNext`
|
||||||
|
|
||||||
#### Mannually Install
|
#### Mannually Install
|
||||||
|
|
||||||
1. Close Obsidian.
|
1. Close Obsidian.
|
||||||
2. Download the plugin file from Release and unzip it into your Obsidian plugin directory.
|
2. Download the plugin file from Release and unzip it into your Obsidian plugin directory.
|
||||||
3. Re-open Obsidian, go to settings, and enable the plugin.
|
3. Re-open Obsidian, go to settings, and enable the plugin.
|
||||||
4. In the settings, find Obsidian to NotionNext, and enter your NotionNext Database ID and API token.
|
4. In the settings, find Obsidian to NotionNext, and enter your NotionNext Database ID and API token.
|
||||||
|
|
||||||
### How to Use
|
### How to Use
|
||||||
|
|
||||||
### Using the Plugin
|
### Using the Plugin
|
||||||
|
|
||||||
In the repository, I have uploaded a template which you can directly copy into your template folder. After that, use Obsidian's template feature to create a new note with one click.
|
In the repository, I have uploaded a template which you can directly copy into your template folder. After that, use Obsidian's template feature to create a new note with one click.
|
||||||
|
|
||||||
If you don't want to use the template, you can also directly create a new file in Obsidian and then copy the content below. Then save it.
|
If you don't want to use the template, you can also directly create a new file in Obsidian and then copy the content below. Then save it.
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
---
|
---
|
||||||
# default value has been set.
|
# default value has been set.
|
||||||
@@ -70,6 +177,7 @@ If you don't want to use the template, you can also directly create a new file i
|
|||||||
# 现在阶段一定不要修改表头的名字, please do not change the name of the header in YAML front matter
|
# 现在阶段一定不要修改表头的名字, please do not change the name of the header in YAML front matter
|
||||||
# !!!!!!!!!!!!
|
# !!!!!!!!!!!!
|
||||||
titleicon: 📎 # emoji icon, default is 📜, 默认是📜
|
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, 默认是空
|
coverurl: https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg # default is empty, 默认是空
|
||||||
type: Post # Post or Page, default is Post, 默认是Post
|
type: Post # Post or Page, default is Post, 默认是Post
|
||||||
slug: test # slug for url, default is empty, 默认是空
|
slug: test # slug for url, default is empty, 默认是空
|
||||||
@@ -87,6 +195,7 @@ tags:
|
|||||||
Contents Below
|
Contents Below
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Usage of the template is as follows:
|
Usage of the template is as follows:
|
||||||

|

|
||||||
|
|
||||||
@@ -100,13 +209,13 @@ Usage of the template is as follows:
|
|||||||
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.
|
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
|
# Obsidian to Notion
|
||||||
|
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/CI.yml)
|
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/CI.yml)
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/release.yml)
|
[](https://github.com/Easychris/obsidian-to-notion/actions/workflows/release.yml)
|
||||||
[](https://raw.githubusercontent.com/EasyChris/obsidian-to-notion/master/LICENSE)
|
[](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/)
|
||||||
[](https://github.com/Easychris/obsidian-to-notion/releases)
|
[](https://github.com/Easychris/obsidian-to-notion/releases)
|
||||||
|
|
||||||
|
|
||||||
Share of obsidian to Notion [中文文档](README-zh.md)
|
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
|
Sharing files from Obsidian to Notion with a single click, and Obsidian will automatically add the Notion share link
|
||||||
@@ -116,7 +225,9 @@ You are welcome to offer it a star if it can benefit you.
|
|||||||

|

|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
### [TODO Board](https://github.com/users/EasyChris/projects/3/views/1)
|
### [TODO Board](https://github.com/users/EasyChris/projects/3/views/1)
|
||||||
|
|
||||||
- [x] support for custom page banner
|
- [x] support for custom page banner
|
||||||
- [x] update the exsit page
|
- [x] update the exsit page
|
||||||
- [x] support for mult language
|
- [x] support for mult language
|
||||||
@@ -125,41 +236,47 @@ You are welcome to offer it a star if it can benefit you.
|
|||||||
- [x] support tags thank for [@jannikbuscha](https://github.com/jannikbuscha)
|
- [x] support tags thank for [@jannikbuscha](https://github.com/jannikbuscha)
|
||||||
- [ ] transfer the bi-link format like [[]] into the format that Notion supports.
|
- [ ] transfer the bi-link format like [[]] into the format that Notion supports.
|
||||||
|
|
||||||
|
|
||||||
# How to use
|
# How to use
|
||||||
|
|
||||||
## Install the plugin
|
## Install the plugin
|
||||||
|
|
||||||
### Marketplace download
|
### Marketplace download
|
||||||
|
|
||||||
Open obsidian setting -> Add plugin -> Search -> notion
|
Open obsidian setting -> Add plugin -> Search -> notion
|
||||||
|
|
||||||

|

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

|

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

|

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

|

|
||||||
@@ -176,25 +293,25 @@ https://www.notion.so/myworkspace/a8aec43384f447ed84390e8e42c2e089?v=...
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Open the plugin configuration
|
## Open the plugin configuration
|
||||||
|
|
||||||
Fill the configuration with the `NOTION_API_KEY` and `DATABASE_ID` you got
|
Fill the configuration with the `NOTION_API_KEY` and `DATABASE_ID` you got
|
||||||

|

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

|

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

|

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

|

|
||||||
@@ -203,11 +320,11 @@ Add tags to your notion page
|
|||||||
|
|
||||||

|

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

|

|
||||||
|
|
||||||
* add tags in the head
|
- add tags in the head
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
---
|
---
|
||||||
@@ -218,7 +335,6 @@ this is test tags
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
---
|
---
|
||||||
tags:
|
tags:
|
||||||
@@ -233,24 +349,20 @@ this is test tags
|
|||||||
|
|
||||||
Thanks for [@jannikbuscha](https://github.com/jannikbuscha) contribution
|
Thanks for [@jannikbuscha](https://github.com/jannikbuscha) contribution
|
||||||
|
|
||||||
|
|
||||||
## Notion ID [option]
|
## Notion ID [option]
|
||||||
|
|
||||||
Notion ID is the your notion site ID that you want to share the file to.
|
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:
|
if you don't write it, notion will share to the default link like:
|
||||||
https://www.notion.so/myworkspace/a8aec43384f447ed84390
|
<https://www.notion.so/myworkspace/a8aec43384f447ed84390>
|
||||||
that visit this page need to redirect to your site url
|
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:
|
if you write the Notion ID, it will share to the page link like:
|
||||||
https://your_user_name.notion.site/myworkspace/a8aec43384f447ed84390.
|
<https://your_user_name.notion.site/myworkspace/a8aec43384f447ed84390>.
|
||||||
The visiter don't need to redirect url.
|
The visiter don't need to redirect url.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Sync image to Notion
|
## 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).
|
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
|
# Development
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -265,6 +377,7 @@ yarn dev
|
|||||||
node update-version.js
|
node update-version.js
|
||||||
./release.sh
|
./release.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,58 +1,60 @@
|
|||||||
import esbuild from "esbuild";
|
import esbuild from "esbuild";
|
||||||
import process from "process";
|
import process from "process";
|
||||||
import builtins from 'builtin-modules'
|
import builtins from "builtin-modules";
|
||||||
|
|
||||||
const banner =
|
const banner = `/*
|
||||||
`/*
|
|
||||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||||
if you want to view the source, please visit the github repository of this plugin
|
if you want to view the source, please visit the github repository of this plugin
|
||||||
*/
|
*/
|
||||||
`;
|
`;
|
||||||
const prod = (process.argv[2] === 'production');
|
const prod = process.argv[2] === "production";
|
||||||
|
|
||||||
const ctx = await esbuild.context({
|
const ctx = await esbuild.context({
|
||||||
banner: {
|
banner: {
|
||||||
js: banner,
|
js: banner,
|
||||||
},
|
},
|
||||||
entryPoints: ['src/main.ts'],
|
entryPoints: ["src/main.ts"],
|
||||||
bundle: true,
|
bundle: true,
|
||||||
external: [
|
external: [
|
||||||
'obsidian',
|
"obsidian",
|
||||||
'electron',
|
"electron",
|
||||||
'@codemirror/autocomplete',
|
"@codemirror/autocomplete",
|
||||||
'@codemirror/closebrackets',
|
"@codemirror/closebrackets",
|
||||||
'@codemirror/collab',
|
"@codemirror/collab",
|
||||||
'@codemirror/commands',
|
"@codemirror/commands",
|
||||||
'@codemirror/comment',
|
"@codemirror/comment",
|
||||||
'@codemirror/fold',
|
"@codemirror/fold",
|
||||||
'@codemirror/gutter',
|
"@codemirror/gutter",
|
||||||
'@codemirror/highlight',
|
"@codemirror/highlight",
|
||||||
'@codemirror/history',
|
"@codemirror/history",
|
||||||
'@codemirror/language',
|
"@codemirror/language",
|
||||||
'@codemirror/lint',
|
"@codemirror/lint",
|
||||||
'@codemirror/matchbrackets',
|
"@codemirror/matchbrackets",
|
||||||
'@codemirror/panel',
|
"@codemirror/panel",
|
||||||
'@codemirror/rangeset',
|
"@codemirror/rangeset",
|
||||||
'@codemirror/rectangular-selection',
|
"@codemirror/rectangular-selection",
|
||||||
'@codemirror/search',
|
"@codemirror/search",
|
||||||
'@codemirror/state',
|
"@codemirror/state",
|
||||||
'@codemirror/stream-parser',
|
"@codemirror/stream-parser",
|
||||||
'@codemirror/text',
|
"@codemirror/text",
|
||||||
'@codemirror/tooltip',
|
"@codemirror/tooltip",
|
||||||
'@codemirror/view',
|
"@codemirror/view",
|
||||||
...builtins
|
...builtins,
|
||||||
],
|
],
|
||||||
format: 'cjs',
|
format: "cjs",
|
||||||
target: 'es2016',
|
target: "es2016",
|
||||||
logLevel: "info",
|
logLevel: "info",
|
||||||
sourcemap: prod ? false : 'inline',
|
sourcemap: prod ? false : "inline",
|
||||||
treeShaking: true,
|
treeShaking: true,
|
||||||
outfile: 'main.js',
|
outfile: "main.js",
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!prod) {
|
if (!prod) {
|
||||||
await ctx.watch();
|
await ctx.watch();
|
||||||
} else {
|
} else {
|
||||||
await ctx.rebuild()
|
await ctx.rebuild();
|
||||||
ctx.dispose().then(r => console.log('Build completed'), e => console.error(e));
|
ctx.dispose().then(
|
||||||
}
|
(r) => console.log("Build completed"),
|
||||||
|
(e) => console.error(e),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "share-to-notionnext",
|
"id": "share-to-notionnext",
|
||||||
"name": "Share to NotionNext",
|
"name": "Share to NotionNext",
|
||||||
"version": "0.1.10",
|
"version": "1.1.2",
|
||||||
"minAppVersion": "0.0.1",
|
"minAppVersion": "0.0.1",
|
||||||
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
||||||
"author": "EasyChris, jxpeng98",
|
"author": "EasyChris, jxpeng98",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
# 现在阶段一定不要修改表头的名字, please do not change the name of the header in YAML front matter
|
# 现在阶段一定不要修改表头的名字, please do not change the name of the header in YAML front matter
|
||||||
# !!!!!!!!!!!!
|
# !!!!!!!!!!!!
|
||||||
titleicon: 📎 # default is 📜, 默认是📜
|
titleicon: 📎 # 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, 默认是空
|
coverurl: https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg # default is empty, 默认是空
|
||||||
type: Post # Post or Page, default is Post, 默认是Post
|
type: Post # Post or Page, default is Post, 默认是Post
|
||||||
slug: test # slug for url, default is empty, 默认是空
|
slug: test # slug for url, default is empty, 默认是空
|
||||||
|
|||||||
16
package.json
16
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "share-to-notionnext",
|
"name": "share-to-notionnext",
|
||||||
"version": "0.1.10",
|
"version": "1.1.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
@@ -14,21 +14,21 @@
|
|||||||
"license": "GNU GPLv3",
|
"license": "GNU GPLv3",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.5.7",
|
"@types/node": "^20.5.7",
|
||||||
"@types/yaml-front-matter": "^4.1.0",
|
"@types/yaml-front-matter": "^4.1.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
||||||
"@typescript-eslint/parser": "^6.5.0",
|
"@typescript-eslint/parser": "^6.11.0",
|
||||||
"builtin-modules": "^3.2.0",
|
"builtin-modules": "^3.2.0",
|
||||||
"esbuild": "0.19.2",
|
"esbuild": "0.19.5",
|
||||||
"obsidian": "latest",
|
"obsidian": "latest",
|
||||||
"tslib": "2.6.2",
|
"tslib": "2.6.2",
|
||||||
"typescript": "5.2.2"
|
"typescript": "5.2.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tryfabric/martian": "^1.2.0",
|
"@tryfabric/martian": "^1.2.4",
|
||||||
"https-proxy-agent": "^7.0.1",
|
"https-proxy-agent": "^7.0.2",
|
||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"remark-math": "^6.0.0",
|
"remark-math": "^6.0.0",
|
||||||
"yaml": "^2.2.2",
|
"yaml": "^2.3.4",
|
||||||
"yaml-front-matter": "^4.1.1"
|
"yaml-front-matter": "^4.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
|
||||||
import { Client } from '@notionhq/client';
|
|
||||||
import { markdownToBlocks, } from "@tryfabric/martian";
|
|
||||||
import * as yamlFrontMatter from "yaml-front-matter";
|
|
||||||
// import * as yaml from "yaml"
|
|
||||||
import MyPlugin from "src/main";
|
|
||||||
|
|
||||||
export class UploadBase {
|
|
||||||
plugin: MyPlugin;
|
|
||||||
notion: Client;
|
|
||||||
agent: any;
|
|
||||||
constructor(plugin: MyPlugin) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
async deletePage(notionID: string) {
|
|
||||||
return requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/blocks/${notionID}`,
|
|
||||||
method: 'DELETE',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Authorization': 'Bearer ' + this.plugin.settings.notionAPI,
|
|
||||||
'Notion-Version': '2022-06-28',
|
|
||||||
},
|
|
||||||
body: ''
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async getDataBase(databaseID: string) {
|
|
||||||
const response = await requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/databases/${databaseID}`,
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Authorization': 'Bearer ' + this.plugin.settings.notionAPI,
|
|
||||||
'Notion-Version': '2022-06-28',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check if cover is present in the JSON response and then get the URL
|
|
||||||
if (response.json.cover && response.json.cover.external) {
|
|
||||||
return response.json.cover.external.url;
|
|
||||||
} else {
|
|
||||||
return null; // or some other default value, if you prefer
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async updateYamlInfo(yamlContent: string, nowFile: TFile, res: any, app: App, settings: any) {
|
|
||||||
let { url, id } = res.json
|
|
||||||
// replace www to notionID
|
|
||||||
const { notionID } = settings;
|
|
||||||
if (notionID !== "") {
|
|
||||||
// replace url str "www" to notionID
|
|
||||||
url = url.replace("www.notion.so", `${notionID}.notion.site`)
|
|
||||||
}
|
|
||||||
await app.fileManager.processFrontMatter(nowFile, yamlContent => {
|
|
||||||
if (yamlContent['notionID']) {
|
|
||||||
delete yamlContent['notionID']
|
|
||||||
}
|
|
||||||
if (yamlContent['link']) {
|
|
||||||
delete yamlContent['link']
|
|
||||||
}
|
|
||||||
// add new notionID and link
|
|
||||||
yamlContent.notionID = id;
|
|
||||||
yamlContent.link = url;
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
|
||||||
await navigator.clipboard.writeText(url)
|
|
||||||
} catch (error) {
|
|
||||||
new Notice(`复制链接失败,请手动复制${error}`)
|
|
||||||
}
|
|
||||||
// const __content = yamlContent.__content;
|
|
||||||
// delete yamlContent.__content
|
|
||||||
// const yamlhead = yaml.stringify(yamlContent)
|
|
||||||
// // if yamlhead hava last \n remove it
|
|
||||||
// const yamlhead_remove_n = yamlhead.replace(/\n$/, '')
|
|
||||||
// // if __content have start \n remove it
|
|
||||||
// const __content_remove_n = __content.replace(/^\n/, '')
|
|
||||||
// const content = '---\n' +yamlhead_remove_n +'\n---\n' + __content_remove_n;
|
|
||||||
// try {
|
|
||||||
// await nowFile.vault.modify(nowFile, content)
|
|
||||||
// } catch (error) {
|
|
||||||
// new Notice(`write file error ${error}`)
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
46
src/I18n.ts
46
src/I18n.ts
@@ -1,46 +0,0 @@
|
|||||||
export const I18n: { [key: string]: any } = {
|
|
||||||
"en": {
|
|
||||||
ribbonIcon: "Share to NotionNext",
|
|
||||||
CommandName: "share to notionnext",
|
|
||||||
NotionNextVersion: "NotionNext Version Database",
|
|
||||||
NotionNextVersionDesc: "Turn on this option if you are using NotionNext",
|
|
||||||
NotionNextSetting: "NotionNext Database Settings",
|
|
||||||
NotionAPI: "Notion API Token",
|
|
||||||
NotionAPIDesc: "It's a secret",
|
|
||||||
NotionAPIText:"Enter your Notion API Token",
|
|
||||||
NotionID: "Database ID",
|
|
||||||
NotionIDText: "Enter your Database ID",
|
|
||||||
BannerUrl: "Banner url(optional)",
|
|
||||||
BannerUrlDesc: "page banner url(optional), default is empty, if you want to show a banner, please enter the url(like:https://raw.githubusercontent.com/EasyChris/obsidian-to-notion/ae7a9ac6cf427f3ca338a409ce6967ced9506f12/doc/2.png)",
|
|
||||||
BannerUrlText: "Enter your banner url",
|
|
||||||
NotionUser: "Notion ID(username, optional)",
|
|
||||||
NotionUserDesc: "Your notion ID (optional),share link likes:https://username.notion.site/,your notion id is [username]",
|
|
||||||
NotionUserText: "Enter your notion ID (options)",
|
|
||||||
NotionGeneralSetting: "General Notion Database Settings",
|
|
||||||
NotYetFinish: "Not finished. This function will be available in the next version",
|
|
||||||
},
|
|
||||||
"zh": {
|
|
||||||
ribbonIcon: "分享到 NotionNext",
|
|
||||||
CommandName: "分享到 NotionNext",
|
|
||||||
NotionNextVersion: "NotionNext 版本数据库",
|
|
||||||
NotionNextVersionDesc: "如果你使用的是NotionNext,请打开此选项",
|
|
||||||
NotionNextSetting: "NotionNext 数据库参数设置",
|
|
||||||
NotionAPI: "Notion API 令牌",
|
|
||||||
NotionAPIDesc: "显示为密码",
|
|
||||||
NotionAPIText:"输入你的 Notion API 令牌",
|
|
||||||
NotionID: "数据库 ID",
|
|
||||||
NotionIDText: "输入你的数据库 ID",
|
|
||||||
BannerUrl: "封面图片地址(可选)",
|
|
||||||
BannerUrlDesc: "页面封面图片地址(可选),默认为空,如果你想显示封面图片,请输入图片地址(例如:https://raw.githubusercontent.com/EasyChris/obsidian-to-notion/ae7a9ac6cf427f3ca338a409ce6967ced9506f12/doc/2.png)",
|
|
||||||
BannerUrlText: "输入你的封面图片地址",
|
|
||||||
NotionUser: "Notion ID(用户名,可选)",
|
|
||||||
NotionUserDesc: "你的 Notion ID(可选),分享链接类似:https://username.notion.site/,你的 Notion ID 是 [username]",
|
|
||||||
NotionUserText: "输入你的 Notion ID(可选)",
|
|
||||||
NotionGeneralSetting: "普通 Notion 数据库设置",
|
|
||||||
NotYetFinish: "未完成。此功能将在之后版本中提供",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
export const I18nConfig = (lang: any): any => {
|
|
||||||
return I18n[lang]
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
export const NoticeMsg: { [key: string]: any } = {
|
|
||||||
"en": {
|
|
||||||
"notion-logo": "Share to NotionNext",
|
|
||||||
"sync-success": "Sync to NotionNext success: \n",
|
|
||||||
"sync-fail": "Sync to NotionNext fail: \n",
|
|
||||||
"open-notion": "Please open the file that needs to be synchronized",
|
|
||||||
"config-secrets-notion-api": "Please set up the notion API in the settings tab.",
|
|
||||||
"config-secrets-database-id": "Please set up the database id in the settings tab.",
|
|
||||||
"set-tags-fail": "Set tags fail,please check the frontmatter of the file or close the tag switch in the settings tab.",
|
|
||||||
"NNonMissing": "The 'NNon' property is missing in the settings. Please set it up.",
|
|
||||||
"set-api-id": "Please set up the notion API and database ID in the settings tab."
|
|
||||||
},
|
|
||||||
"zh": {
|
|
||||||
"notion-logo": "分享到NotionNext",
|
|
||||||
"sync-success": "同步到NotionNext成功:\n",
|
|
||||||
"sync-fail": "同步到NotionNext失败: \n",
|
|
||||||
"open-file": "请打开需要同步的文件",
|
|
||||||
"config-secrets-notion-api": "请在插件设置中添加notion API",
|
|
||||||
"config-secrets-database-id": "请在插件设置中添加database id",
|
|
||||||
"set-tags-fail": "设置标签失败,请检查文件的frontmatter,或者在插件设置中关闭设置tags开关",
|
|
||||||
"NNonMissing": "未设置'NNon'属性,请在插件设置中选择NotionNext数据库。",
|
|
||||||
"set-api-id": "请在插件设置中设置notion API和database ID"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export const NoticeMConfig = (lang: any): any => {
|
|
||||||
return NoticeMsg[lang]
|
|
||||||
}
|
|
||||||
@@ -1,178 +0,0 @@
|
|||||||
import {UploadBase} from "./BaseUpload2Notion";
|
|
||||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
|
||||||
import { Client } from '@notionhq/client';
|
|
||||||
import { markdownToBlocks, } from "@tryfabric/martian";
|
|
||||||
import * as yamlFrontMatter from "yaml-front-matter";
|
|
||||||
// import * as yaml from "yaml"
|
|
||||||
import MyPlugin from "src/main";
|
|
||||||
|
|
||||||
export class Upload2Notion extends UploadBase {
|
|
||||||
constructor(plugin: MyPlugin) {
|
|
||||||
super(plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 因为需要解析notion的block进行对比,非常的麻烦,
|
|
||||||
// 暂时就直接删除,新建一个page
|
|
||||||
async updatePage(notionID: string, title: string, emoji: string, cover: string, tags: string[], type: string, slug: string, stats: string, category: string, summary: string, paword: string, favicon: string, datetime: string, childArr: any) {
|
|
||||||
await this.deletePage(notionID)
|
|
||||||
|
|
||||||
const databasecover = await this.getDataBase(this.plugin.settings.databaseID)
|
|
||||||
|
|
||||||
if (cover == null) {
|
|
||||||
cover = databasecover
|
|
||||||
}
|
|
||||||
|
|
||||||
return await this.createPage(
|
|
||||||
title,
|
|
||||||
emoji,
|
|
||||||
cover,
|
|
||||||
tags,
|
|
||||||
type,
|
|
||||||
slug,
|
|
||||||
stats,
|
|
||||||
category,
|
|
||||||
summary,
|
|
||||||
paword,
|
|
||||||
favicon,
|
|
||||||
datetime,
|
|
||||||
childArr)
|
|
||||||
}
|
|
||||||
|
|
||||||
async createPage(title: string, emoji: string, cover: string, tags: string[], type: string, slug: string, stats: string, category: string, summary: string, pawrod: string, favicon: string, datetime: string, childArr: any) {
|
|
||||||
const bodyString: any = {
|
|
||||||
parent: {
|
|
||||||
database_id: this.plugin.settings.databaseID
|
|
||||||
},
|
|
||||||
icon: {
|
|
||||||
emoji: emoji || '📜'
|
|
||||||
},
|
|
||||||
properties: {
|
|
||||||
title: {
|
|
||||||
title: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: title
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
tags: {
|
|
||||||
multi_select: tags && true ? tags.map(tag => {
|
|
||||||
return { "name": tag }
|
|
||||||
}) : [],
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
select: {
|
|
||||||
name: type || 'Post'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
slug: {
|
|
||||||
rich_text: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: slug || ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
status: {
|
|
||||||
select: {
|
|
||||||
name: stats || 'Draft'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
category: {
|
|
||||||
select: {
|
|
||||||
name: category || 'Obsidian'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
summary: {
|
|
||||||
rich_text: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: summary || ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
password: {
|
|
||||||
rich_text: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: pawrod || ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
icon: {
|
|
||||||
rich_text: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: favicon || ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
date: {
|
|
||||||
date: {
|
|
||||||
start: datetime || new Date().toISOString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
children: childArr,
|
|
||||||
}
|
|
||||||
if (cover) {
|
|
||||||
bodyString.cover = {
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: cover
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bodyString.cover && this.plugin.settings.bannerUrl) {
|
|
||||||
bodyString.cover = {
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: this.plugin.settings.bannerUrl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
return await requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/pages`,
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
// 'User-Agent': 'obsidian.md',
|
|
||||||
'Authorization': 'Bearer ' + this.plugin.settings.notionAPI,
|
|
||||||
'Notion-Version': '2022-06-28',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(bodyString),
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
new Notice(`network error ${error}`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async syncMarkdownToNotion(title: string, emoji: string, cover: string, tags: string[], type: string, slug: string, stats: string, category: string, summary: string, paword: string, favicon: string, datetime: string, markdown: string, nowFile: TFile, app: App, settings: any): Promise<any> {
|
|
||||||
let res: any
|
|
||||||
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
|
||||||
const __content = yamlContent.__content
|
|
||||||
const file2Block = markdownToBlocks(__content);
|
|
||||||
const frontmasster = app.metadataCache.getFileCache(nowFile)?.frontmatter
|
|
||||||
const notionID = frontmasster ? frontmasster.notionID : null
|
|
||||||
|
|
||||||
if (notionID) {
|
|
||||||
res = await this.updatePage(notionID, title, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, file2Block);
|
|
||||||
} else {
|
|
||||||
res = await this.createPage(title, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, file2Block);
|
|
||||||
}
|
|
||||||
if (res.status === 200) {
|
|
||||||
await this.updateYamlInfo(markdown, nowFile, res, app, settings)
|
|
||||||
} else {
|
|
||||||
new Notice(`${res.text}`)
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
}
|
|
||||||
51
src/commands/FuzzySuggester.ts
Normal file
51
src/commands/FuzzySuggester.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import { FuzzySuggestModal, FuzzyMatch } from 'obsidian';
|
||||||
|
import MyPlugin from "../main";
|
||||||
|
import { i18nConfig } from "../lang/I18n";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple interface for what should be displayed and stored for suggester
|
||||||
|
*/
|
||||||
|
export interface DatabaseList {
|
||||||
|
name: string, // specific database name
|
||||||
|
match: any //
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class FuzzySuggester extends FuzzySuggestModal<DatabaseList>{
|
||||||
|
private plugin: MyPlugin;
|
||||||
|
private data: DatabaseList[];
|
||||||
|
private callback: any;
|
||||||
|
|
||||||
|
constructor(plugin: MyPlugin) {
|
||||||
|
super(plugin.app);
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.setPlaceholder(i18nConfig.PlaceHolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
setSuggesterData(suggesterData: Array<DatabaseList>): void { this.data = suggesterData }
|
||||||
|
|
||||||
|
async display(callBack: (item: DatabaseList, evt: MouseEvent | KeyboardEvent) => void): Promise<any> {
|
||||||
|
this.callback = callBack;
|
||||||
|
this.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store the data
|
||||||
|
getItems(): DatabaseList[] {
|
||||||
|
return this.data
|
||||||
|
}
|
||||||
|
|
||||||
|
getItemText(item: DatabaseList): string {
|
||||||
|
return item.name
|
||||||
|
}
|
||||||
|
|
||||||
|
onChooseItem(item: DatabaseList, evt: MouseEvent | KeyboardEvent): void { }
|
||||||
|
|
||||||
|
onChooseSuggestion(item: FuzzyMatch<DatabaseList>, evt: MouseEvent | KeyboardEvent): void {
|
||||||
|
this.callback(item.item, evt)
|
||||||
|
}
|
||||||
|
|
||||||
|
renderSuggestion(item: FuzzyMatch<DatabaseList>, el: HTMLElement): void {
|
||||||
|
el.createEl('div', { text: item.item.name })
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
110
src/commands/NotionCommands.ts
Normal file
110
src/commands/NotionCommands.ts
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
import { i18nConfig } from "src/lang/I18n";
|
||||||
|
import { Editor, MarkdownView } from "obsidian";
|
||||||
|
import { FuzzySuggester, DatabaseList } from "./FuzzySuggester";
|
||||||
|
import { uploadCommandGeneral, uploadCommandNext } from "../upload/uploadCommand";
|
||||||
|
import ObsidianSyncNotionPlugin from "src/main";
|
||||||
|
|
||||||
|
|
||||||
|
interface Command {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
editorCallback: (editor: Editor, view: MarkdownView) => Promise<void>;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// create the commands list
|
||||||
|
export default class RibbonCommands {
|
||||||
|
plugin: ObsidianSyncNotionPlugin;
|
||||||
|
|
||||||
|
Ncommand: Command[] = [];
|
||||||
|
|
||||||
|
constructor(plugin: ObsidianSyncNotionPlugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
|
||||||
|
// Check if NextButton is true, then include the corresponding command
|
||||||
|
if (this.plugin.settings.NextButton) {
|
||||||
|
this.Ncommand.push({
|
||||||
|
id: "share-to-notionnext",
|
||||||
|
name: i18nConfig.CommandName, // Use the translated text from i18nConfig
|
||||||
|
editorCallback: async (editor: Editor, view: MarkdownView) => {
|
||||||
|
await uploadCommandNext(this.plugin, this.plugin.settings, this.plugin.app);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if GeneralButton is true, then include the corresponding command
|
||||||
|
if (this.plugin.settings.GeneralButton) {
|
||||||
|
this.Ncommand.push({
|
||||||
|
id: "share-to-notion",
|
||||||
|
name: i18nConfig.CommandNameGeneral, // Use the translated text from i18nConfig
|
||||||
|
editorCallback: async (editor: Editor, view: MarkdownView) => {
|
||||||
|
await uploadCommandGeneral(this.plugin, this.plugin.settings, this.plugin.app);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register all the commands
|
||||||
|
this.Ncommand.forEach(command => {
|
||||||
|
this.plugin.addCommand(
|
||||||
|
{
|
||||||
|
id: command.id,
|
||||||
|
name: command.name,
|
||||||
|
editorCallback: command.editorCallback,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async ribbonDisplay() {
|
||||||
|
const NcommandList: DatabaseList[] = [];
|
||||||
|
|
||||||
|
this.Ncommand.map(command => NcommandList.push(
|
||||||
|
{
|
||||||
|
name: command.name,
|
||||||
|
match: command.editorCallback
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
const fusg = new FuzzySuggester(this.plugin);
|
||||||
|
|
||||||
|
fusg.setSuggesterData(NcommandList);
|
||||||
|
await fusg.display(async (results) => { await results.match() })
|
||||||
|
};
|
||||||
|
|
||||||
|
// if the setting has been changed, try to rebuild the command list
|
||||||
|
async updateCommand() {
|
||||||
|
|
||||||
|
this.Ncommand = [];
|
||||||
|
|
||||||
|
if (this.plugin.settings.NextButton) {
|
||||||
|
this.Ncommand.push({
|
||||||
|
id: "share-to-notionnext",
|
||||||
|
name: i18nConfig.CommandName, // Use the translated text from i18nConfig
|
||||||
|
editorCallback: async (editor: Editor, view: MarkdownView) => {
|
||||||
|
await uploadCommandNext(this.plugin, this.plugin.settings, this.plugin.app);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.plugin.settings.GeneralButton) {
|
||||||
|
this.Ncommand.push({
|
||||||
|
id: "share-to-notion",
|
||||||
|
name: i18nConfig.CommandNameGeneral, // Use the translated text from i18nConfig
|
||||||
|
editorCallback: async (editor: Editor, view: MarkdownView) => {
|
||||||
|
await uploadCommandGeneral(this.plugin, this.plugin.settings, this.plugin.app);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Ncommand.forEach(command => {
|
||||||
|
this.plugin.addCommand(
|
||||||
|
{
|
||||||
|
id: command.id,
|
||||||
|
name: command.name,
|
||||||
|
editorCallback: command.editorCallback,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
17
src/lang/I18n.ts
Normal file
17
src/lang/I18n.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import {en} from "./locale/en";
|
||||||
|
import {zh} from "./locale/zh";
|
||||||
|
import {ja} from "./locale/ja";
|
||||||
|
|
||||||
|
export const I18n: {[key: string]:any} = {
|
||||||
|
en,
|
||||||
|
zh,
|
||||||
|
ja,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const I18nConfig = (lang: string): any => {
|
||||||
|
return I18n[lang];
|
||||||
|
};
|
||||||
|
|
||||||
|
const storedLanguage = window.localStorage.getItem("language");
|
||||||
|
|
||||||
|
export const i18nConfig = I18n[storedLanguage || window.navigator.language.split('-')[0] || "en"];
|
||||||
54
src/lang/locale/en.ts
Normal file
54
src/lang/locale/en.ts
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
export const en = {
|
||||||
|
ribbonIcon: "Share to NotionNext",
|
||||||
|
GeneralSetting: "General information Settings",
|
||||||
|
CommandID: "share-to-notionnext",
|
||||||
|
CommandName: "Share to NotionNext Database",
|
||||||
|
CommandIDGeneral: "share-to-notion",
|
||||||
|
CommandNameGeneral: "Share to Notion General Database",
|
||||||
|
NotionNextButton: "NotionNext Sync",
|
||||||
|
NotionNextButtonDesc: "Open this option, Sync to NotionNext command will be displayed in the command palette (default: ON)",
|
||||||
|
NotionNextSettingHeader: "NotionNext Database Settings",
|
||||||
|
NotionAPI: "Notion API Token",
|
||||||
|
NotionAPIDesc: "Generate from https://www.notion.so/my-integrations",
|
||||||
|
NotionAPIText: "Enter your Notion API Token",
|
||||||
|
DatabaseID: "Database ID",
|
||||||
|
DatabaseIDText: "Enter your Database ID",
|
||||||
|
BannerUrl: "Banner url (optional)",
|
||||||
|
BannerUrlDesc:
|
||||||
|
"Default is empty, if you want to show a banner, please enter the url (like: https://minioapi.pjx.ac.cn/img1/2023/11/b7b40a0724e93b7d7ab494bb3b8a2da8.png)",
|
||||||
|
BannerUrlText: "Enter your banner url",
|
||||||
|
NotionUser: "Notion ID (username, optional)",
|
||||||
|
NotionUserDesc:
|
||||||
|
"Collect from share link likes:https://username.notion.site. Your notion id is [username]",
|
||||||
|
NotionUserText: "Enter your notion ID",
|
||||||
|
NotionGeneralSettingHeader: "General Notion Database Settings",
|
||||||
|
NotionGeneralButton: "Notion General Sync",
|
||||||
|
NotionGeneralButtonDesc: "Open this option, Sync to Notion General Database command will be displayed in the command palette (default: ON)",
|
||||||
|
NotionTagButton: "Notion Tags Sync",
|
||||||
|
NotionTagButtonDesc: "Sync Tags to Notion General Database (default: ON)",
|
||||||
|
NotionCustomTitle: "Customise title property",
|
||||||
|
NotionCustomTitleDesc: "Modify the column name of the Notion database (default: OFF)",
|
||||||
|
NotionCustomTitleName: "Preferred title name",
|
||||||
|
NotionCustomTitleNameDesc: "Enter the preferred title name for the first column of the Notion database (default: title)",
|
||||||
|
NotionCustomTitleText: "Enter the name",
|
||||||
|
NotYetFinish:
|
||||||
|
"Not finished. This function will be available in the next version",
|
||||||
|
PlaceHolder: "Enter database Name",
|
||||||
|
"notion-logo": "Share to NotionNext",
|
||||||
|
"sync-success": "Sync to NotionNext success: \n",
|
||||||
|
"sync-fail": "Sync to NotionNext fail: \n",
|
||||||
|
"open-notion": "Please open the file that needs to be synchronized",
|
||||||
|
"config-secrets-notion-api":
|
||||||
|
"Please set up the notion API in the settings tab.",
|
||||||
|
"config-secrets-database-id":
|
||||||
|
"Please set up the database id in the settings tab.",
|
||||||
|
"set-tags-fail":
|
||||||
|
"Set tags fail,please check the frontmatter of the file or close the tag switch in the settings tab.",
|
||||||
|
NNonMissing:
|
||||||
|
"The 'NNon' property is missing in the settings. Please set it up.",
|
||||||
|
"set-api-id":
|
||||||
|
"Please set up the notion API and database ID in the settings tab.",
|
||||||
|
NotionCustomSettingHeader: "Notion Custom Database Settings",
|
||||||
|
NotionCustomButton: "Notion Customised command switch",
|
||||||
|
NotionCustomButtonDesc: "Open this option, Sync to Notion Customised Database command will be displayed in the command palette",
|
||||||
|
}
|
||||||
46
src/lang/locale/ja.ts
Normal file
46
src/lang/locale/ja.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
export const ja = {
|
||||||
|
ribbonIcon: "NotionNextで共有",
|
||||||
|
GeneralSetting: "一般設定",
|
||||||
|
CommandID: "share-to-notionnext",
|
||||||
|
CommandName: "NotionNextデータベースに共有",
|
||||||
|
CommandIDGeneral: "share-to-notion",
|
||||||
|
CommandNameGeneral: "一般的なNotionデータベースに共有",
|
||||||
|
NotionNextButton: "NotionNext同期",
|
||||||
|
NotionNextButtonDesc: "このオプションを開くと、NotionNext同期コマンドがコマンドパレットに表示されます(デフォルト:ON)",
|
||||||
|
NotionNextSettingHeader: "NotionNextデータベース設定",
|
||||||
|
NotionAPI: "Notion API トークン",
|
||||||
|
NotionAPIDesc: "https://www.notion.so/my-integrations から生成してください",
|
||||||
|
NotionAPIText: "Notion API トークンを入力",
|
||||||
|
DatabaseID: "データベースID",
|
||||||
|
DatabaseIDText: "データベースIDを入力",
|
||||||
|
BannerUrl: "バナーのURL(任意)",
|
||||||
|
BannerUrlDesc: "デフォルトは空白です。バナーを表示したい場合は、URLを入力してください(例:https://minioapi.pjx.ac.cn/img1/2023/11/b7b40a0724e93b7d7ab494bb3b8a2da8.png)",
|
||||||
|
BannerUrlText: "バナーのURLを入力",
|
||||||
|
NotionUser: "Notion ID(ユーザー名、任意)",
|
||||||
|
NotionUserDesc: "共有リンクから取得(例:https://username.notion.site)。Notion IDは[username]です",
|
||||||
|
NotionUserText: "Notion IDを入力",
|
||||||
|
NotionGeneralSettingHeader: "一般的なNotionデータベース設定",
|
||||||
|
NotionGeneralButton: "一般的なNotion同期",
|
||||||
|
NotionGeneralButtonDesc: "このオプションを開くと、一般的なNotionデータベース同期コマンドがコマンドパレットに表示されます(デフォルト:ON)",
|
||||||
|
NotionTagButton: "Notionタグ同期",
|
||||||
|
NotionTagButtonDesc: "タグを一般的なNotionデータベースに同期(デフォルト:ON)",
|
||||||
|
NotionCustomTitle: "タイトルのカスタマイズ",
|
||||||
|
NotionCustomTitleDesc: "Notionデータベースの列名を変更(デフォルト:OFF)",
|
||||||
|
NotionCustomTitleName: "希望のタイトル名",
|
||||||
|
NotionCustomTitleNameDesc: "Notionデータベースの最初の列のための希望のタイトル名を入力(デフォルト:title)",
|
||||||
|
NotionCustomTitleText: "名前を入力",
|
||||||
|
NotYetFinish: "未完了。この機能は次のバージョンで利用可能になります",
|
||||||
|
PlaceHolder: "データベース名を入力",
|
||||||
|
"notion-logo": "NotionNextで共有",
|
||||||
|
"sync-success": "NotionNextへの同期に成功:\n",
|
||||||
|
"sync-fail": "NotionNextへの同期に失敗:\n",
|
||||||
|
"open-notion": "同期が必要なファイルを開いてください",
|
||||||
|
"config-secrets-notion-api": "設定タブでNotion APIを設定してください",
|
||||||
|
"config-secrets-database-id": "設定タブでデータベースIDを設定してください",
|
||||||
|
"set-tags-fail": "タグの設定に失敗。ファイルのfrontmatterを確認するか、設定タブでタグのスイッチをオフにしてください",
|
||||||
|
NNonMissing: "設定に 'NNon' プロパティがありません。設定してください",
|
||||||
|
"set-api-id": "設定タブでNotion APIおよびデータベースIDを設定してください",
|
||||||
|
NotionCustomSettingHeader: "Notionカスタムデータベース設定",
|
||||||
|
NotionCustomButton: "Notionカスタマイズコマンドの切り替え",
|
||||||
|
NotionCustomButtonDesc: "このオプションを開くと、Notionカスタムデータベース同期コマンドがコマンドパレットに表示されます",
|
||||||
|
};
|
||||||
49
src/lang/locale/zh.ts
Normal file
49
src/lang/locale/zh.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
export const zh = {
|
||||||
|
ribbonIcon: "分享到 NotionNext",
|
||||||
|
GeneralSetting: "通用设置",
|
||||||
|
CommandID: "share-to-notionnext",
|
||||||
|
CommandName: "分享到 NotionNext",
|
||||||
|
CommandIDGeneral: "share-to-notion",
|
||||||
|
CommandNameGeneral: "分享到 Notion 普通数据库",
|
||||||
|
NotionNextButton: "NotionNext 同步",
|
||||||
|
NotionNextButtonDesc: "打开此选项,NotionNext 同步将显示在命令面板中(默认:开)",
|
||||||
|
NotionNextSettingHeader: "NotionNext 数据库参数设置",
|
||||||
|
NotionAPI: "Notion API 令牌",
|
||||||
|
NotionAPIDesc: "从 https://www.notion.so/my-integrations 生成",
|
||||||
|
NotionAPIText: "输入你的 Notion API 令牌",
|
||||||
|
DatabaseID: "数据库 ID",
|
||||||
|
DatabaseIDText: "输入你的数据库 ID",
|
||||||
|
BannerUrl: "封面图片地址(可选)",
|
||||||
|
BannerUrlDesc:
|
||||||
|
"默认为空,如果你想显示封面图片,请输入图片地址(例如:https://minioapi.pjx.ac.cn/img1/2023/11/b7b40a0724e93b7d7ab494bb3b8a2da8.png)",
|
||||||
|
BannerUrlText: "输入你的封面图片地址",
|
||||||
|
NotionUser: "Notion ID(用户名,可选)",
|
||||||
|
NotionUserDesc:
|
||||||
|
"数据库分享链接类似:https://username.notion.site/。你的 Notion ID 是 [username]",
|
||||||
|
NotionUserText: "输入你的 Notion ID",
|
||||||
|
NotionGeneralSettingHeader: "普通 Notion 数据库设置",
|
||||||
|
NotionGeneralButton: "普通数据库同步",
|
||||||
|
NotionGeneralButtonDesc: "打开此选项,同步到普通数据库命令将显示在命令面板中(默认:开)",
|
||||||
|
NotionTagButton: "标签同步开关",
|
||||||
|
NotionTagButtonDesc: "将标签同步到普通数据库(默认:开)",
|
||||||
|
NotionCustomTitle: "修改 Notion 数据库表头开关",
|
||||||
|
NotionCustomTitleDesc: "自定义Notion 数据库第一列表头名(默认:关)",
|
||||||
|
NotionCustomTitleName: "想要修改的表头名",
|
||||||
|
NotionCustomTitleNameDesc: "输入你想要修改的notion数据库的表头名(默认:title)",
|
||||||
|
NotionCustomTitleText: "输入表头名",
|
||||||
|
NotYetFinish: "未完成。此功能将在之后版本中提供",
|
||||||
|
PlaceHolder: "输入数据库名称",
|
||||||
|
"notion-logo": "分享到NotionNext",
|
||||||
|
"sync-success": "同步到NotionNext成功:\n",
|
||||||
|
"sync-fail": "同步到NotionNext失败: \n",
|
||||||
|
"open-file": "请打开需要同步的文件",
|
||||||
|
"config-secrets-notion-api": "请在插件设置中添加notion API",
|
||||||
|
"config-secrets-database-id": "请在插件设置中添加database id",
|
||||||
|
"set-tags-fail":
|
||||||
|
"设置标签失败,请检查文件的frontmatter,或者在插件设置中关闭设置tags开关",
|
||||||
|
NNonMissing: "未设置'NNon'属性,请在插件设置中选择NotionNext数据库。",
|
||||||
|
"set-api-id": "请在插件设置中设置notion API和database ID",
|
||||||
|
NotionCustomSettingHeader: "Notion 自定义数据库设置",
|
||||||
|
NotionCustomButton: "Notion 自定义数据库同步命令开关",
|
||||||
|
NotionCustomButtonDesc: "打开此选项,同步到自定义数据库命令将显示在命令面板中",
|
||||||
|
}
|
||||||
252
src/main.ts
252
src/main.ts
@@ -1,39 +1,23 @@
|
|||||||
import {App, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting} from "obsidian";
|
import { App, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting } from "obsidian";
|
||||||
import {addIcons} from 'src/icon';
|
import { addIcons } from 'src/ui/icon';
|
||||||
import {Upload2Notion} from "src/Upload2Notion";
|
import { Upload2NotionGeneral } from "src/upload/upload_general/Upload2NotionGeneral";
|
||||||
import {Upload2NotionNext} from "src/Upload2Notion_NN";
|
import { Upload2NotionNext } from "src/upload/upload_next/Upload2NotionNext";
|
||||||
import {NoticeMConfig} from "src/Message";
|
import { i18nConfig } from "src/lang/I18n";
|
||||||
import {I18nConfig} from "src/I18n";
|
import ribbonCommands from "src/commands/NotionCommands";
|
||||||
|
import { ObsidianSettingTab, PluginSettings, DEFAULT_SETTINGS } from "src/ui/settingTabs";
|
||||||
|
|
||||||
// Remember to rename these classes and interfaces!
|
// Remember to rename these classes and interfaces!
|
||||||
|
|
||||||
interface PluginSettings {
|
|
||||||
NNon: boolean;
|
|
||||||
notionAPI: string;
|
|
||||||
databaseID: string;
|
|
||||||
bannerUrl: string;
|
|
||||||
notionID: string;
|
|
||||||
proxy: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const langConfig = NoticeMConfig(window.localStorage.getItem('language') || 'en')
|
|
||||||
|
|
||||||
const i18nConfig = I18nConfig(window.localStorage.getItem('language') || 'en')
|
|
||||||
|
|
||||||
const DEFAULT_SETTINGS: PluginSettings = {
|
|
||||||
NNon: undefined,
|
|
||||||
notionAPI: "",
|
|
||||||
databaseID: "",
|
|
||||||
bannerUrl: "",
|
|
||||||
notionID: "",
|
|
||||||
proxy: "",
|
|
||||||
};
|
|
||||||
|
|
||||||
export default class ObsidianSyncNotionPlugin extends Plugin {
|
export default class ObsidianSyncNotionPlugin extends Plugin {
|
||||||
settings: PluginSettings;
|
settings: PluginSettings;
|
||||||
|
commands: ribbonCommands;
|
||||||
|
app: App;
|
||||||
|
|
||||||
async onload() {
|
async onload() {
|
||||||
await this.loadSettings();
|
await this.loadSettings();
|
||||||
|
this.commands = new ribbonCommands(this);
|
||||||
|
|
||||||
addIcons();
|
addIcons();
|
||||||
// This creates an icon in the left ribbon.
|
// This creates an icon in the left ribbon.
|
||||||
const ribbonIconEl = this.addRibbonIcon(
|
const ribbonIconEl = this.addRibbonIcon(
|
||||||
@@ -41,22 +25,15 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
|||||||
i18nConfig.ribbonIcon,
|
i18nConfig.ribbonIcon,
|
||||||
async (evt: MouseEvent) => {
|
async (evt: MouseEvent) => {
|
||||||
// Called when the user clicks the icon.
|
// Called when the user clicks the icon.
|
||||||
await this.upload();
|
// await this.uploadCommand();
|
||||||
|
await this.commands.ribbonDisplay();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// This adds a status bar item to the bottom of the app. Does not work on mobile apps.
|
// This adds a status bar item to the bottom of the app. Does not work on mobile apps.
|
||||||
const statusBarItemEl = this.addStatusBarItem();
|
|
||||||
// statusBarItemEl.setText("share to notion");
|
|
||||||
|
|
||||||
this.addCommand({
|
|
||||||
id: "share-to-notionnext",
|
|
||||||
name: i18nConfig.CommandName,
|
|
||||||
editorCallback: async (editor: Editor, view: MarkdownView) => {
|
|
||||||
await this.upload()
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
|
// const statusBarItemEl = this.addStatusBarItem();
|
||||||
|
// // statusBarItemEl.setText("share to notion");
|
||||||
|
|
||||||
// This adds a settings tab so the user can configure various aspects of the plugin
|
// This adds a settings tab so the user can configure various aspects of the plugin
|
||||||
this.addSettingTab(new ObsidianSettingTab(this.app, this));
|
this.addSettingTab(new ObsidianSettingTab(this.app, this));
|
||||||
@@ -66,102 +43,6 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
|||||||
onunload() {
|
onunload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async upload() {
|
|
||||||
const { notionAPI, databaseID, NNon} = this.settings;
|
|
||||||
|
|
||||||
// Check if NNon exists
|
|
||||||
if (NNon === undefined) {
|
|
||||||
const NNonmessage = langConfig.NNonMissing;
|
|
||||||
new Notice(NNonmessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the user has set up the Notion API and database ID
|
|
||||||
if (notionAPI === "" || databaseID === "") {
|
|
||||||
const setAPIMessage = langConfig["set-api-id"];
|
|
||||||
new Notice(setAPIMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const {markDownData, nowFile, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime} = await this.getNowFileMarkdownContent(this.app);
|
|
||||||
|
|
||||||
|
|
||||||
if (markDownData) {
|
|
||||||
const { basename } = nowFile;
|
|
||||||
let upload;
|
|
||||||
|
|
||||||
if (NNon) {
|
|
||||||
upload = new Upload2NotionNext(this);
|
|
||||||
} else {
|
|
||||||
upload = new Upload2Notion(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await upload.syncMarkdownToNotion(basename, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, markDownData, nowFile, this.app, this.settings);
|
|
||||||
|
|
||||||
if (res.status === 200) {
|
|
||||||
new Notice(`${langConfig["sync-success"]}${basename}`);
|
|
||||||
} else {
|
|
||||||
new Notice(`${langConfig["sync-fail"]}${basename}`, 5000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async getNowFileMarkdownContent(app: App) {
|
|
||||||
const nowFile = app.workspace.getActiveFile();
|
|
||||||
const {NNon} = this.settings;
|
|
||||||
let emoji = ''
|
|
||||||
let cover = ''
|
|
||||||
let tags = []
|
|
||||||
let type = ''
|
|
||||||
let slug = ''
|
|
||||||
let stats = ''
|
|
||||||
let category = ''
|
|
||||||
let summary = ''
|
|
||||||
let paword = ''
|
|
||||||
let favicon = ''
|
|
||||||
let datetime = ''
|
|
||||||
|
|
||||||
const FileCache = app.metadataCache.getFileCache(nowFile)
|
|
||||||
try {
|
|
||||||
if (NNon) {
|
|
||||||
emoji = FileCache.frontmatter.titleicon;
|
|
||||||
cover = FileCache.frontmatter.coverurl;
|
|
||||||
tags = FileCache.frontmatter.tags;
|
|
||||||
type = FileCache.frontmatter.type;
|
|
||||||
slug = FileCache.frontmatter.slug;
|
|
||||||
stats = FileCache.frontmatter.stats;
|
|
||||||
category = FileCache.frontmatter.category;
|
|
||||||
summary = FileCache.frontmatter.summary;
|
|
||||||
paword = FileCache.frontmatter.password;
|
|
||||||
favicon = FileCache.frontmatter.icon;
|
|
||||||
datetime = FileCache.frontmatter.date;
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
new Notice(langConfig["set-tags-fail"]);
|
|
||||||
}
|
|
||||||
if (nowFile) {
|
|
||||||
const markDownData = await nowFile.vault.read(nowFile);
|
|
||||||
return {
|
|
||||||
markDownData,
|
|
||||||
nowFile,
|
|
||||||
emoji,
|
|
||||||
cover,
|
|
||||||
tags,
|
|
||||||
type,
|
|
||||||
slug,
|
|
||||||
stats,
|
|
||||||
category,
|
|
||||||
summary,
|
|
||||||
paword,
|
|
||||||
favicon,
|
|
||||||
datetime,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
new Notice(langConfig["open-file"]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async loadSettings() {
|
async loadSettings() {
|
||||||
this.settings = Object.assign(
|
this.settings = Object.assign(
|
||||||
{},
|
{},
|
||||||
@@ -173,110 +54,9 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
|||||||
async saveSettings() {
|
async saveSettings() {
|
||||||
await this.saveData(this.settings);
|
await this.saveData(this.settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ObsidianSettingTab extends PluginSettingTab {
|
|
||||||
plugin: ObsidianSyncNotionPlugin;
|
|
||||||
|
|
||||||
constructor(app: App, plugin: ObsidianSyncNotionPlugin) {
|
|
||||||
super(app, plugin);
|
|
||||||
this.plugin = plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
display(): void {
|
|
||||||
const {containerEl} = this;
|
|
||||||
|
|
||||||
containerEl.empty();
|
|
||||||
|
|
||||||
new Setting(containerEl)
|
|
||||||
.setName(i18nConfig.NotionNextVersion)
|
|
||||||
.setDesc(i18nConfig.NotionNextVersionDesc)
|
|
||||||
.addToggle((toggle) =>
|
|
||||||
toggle
|
|
||||||
.setValue(this.plugin.settings.NNon)
|
|
||||||
.onChange(async (value) => {
|
|
||||||
this.plugin.settings.NNon = value;
|
|
||||||
await this.plugin.saveSettings();
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
containerEl.createEl('h2', {text: i18nConfig.NotionNextSetting})
|
|
||||||
|
|
||||||
new Setting(containerEl)
|
|
||||||
.setName(i18nConfig.NotionAPI)
|
|
||||||
.setDesc(i18nConfig.NotionAPIDesc)
|
|
||||||
.addText((text) => {
|
|
||||||
text.inputEl.type = 'password';
|
|
||||||
return text
|
|
||||||
.setPlaceholder(i18nConfig.NotionAPIText)
|
|
||||||
.setValue(this.plugin.settings.notionAPI)
|
|
||||||
.onChange(async (value) => {
|
|
||||||
this.plugin.settings.notionAPI = value;
|
|
||||||
await this.plugin.saveSettings();
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
const notionDatabaseID = new Setting(containerEl)
|
|
||||||
.setName(i18nConfig.NotionID)
|
|
||||||
.setDesc(i18nConfig.NotionAPIDesc)
|
|
||||||
.addText((text) => {
|
|
||||||
text.inputEl.type = 'password';
|
|
||||||
return text
|
|
||||||
.setPlaceholder(i18nConfig.NotionIDText)
|
|
||||||
.setValue(this.plugin.settings.databaseID)
|
|
||||||
.onChange(async (value) => {
|
|
||||||
this.plugin.settings.databaseID = value;
|
|
||||||
await this.plugin.saveSettings();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// notionDatabaseID.controlEl.querySelector('input').type='password'
|
|
||||||
|
|
||||||
new Setting(containerEl)
|
|
||||||
.setName(i18nConfig.BannerUrl)
|
|
||||||
.setDesc(i18nConfig.BannerUrlDesc)
|
|
||||||
.addText((text) =>
|
|
||||||
text
|
|
||||||
.setPlaceholder(i18nConfig.BannerUrlText)
|
|
||||||
.setValue(this.plugin.settings.bannerUrl)
|
|
||||||
.onChange(async (value) => {
|
|
||||||
this.plugin.settings.bannerUrl = value;
|
|
||||||
await this.plugin.saveSettings();
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
new Setting(containerEl)
|
|
||||||
.setName(i18nConfig.NotionUser)
|
|
||||||
.setDesc(i18nConfig.NotionUserDesc)
|
|
||||||
.addText((text) =>
|
|
||||||
text
|
|
||||||
.setPlaceholder(i18nConfig.NotionUserText)
|
|
||||||
.setValue(this.plugin.settings.notionID)
|
|
||||||
.onChange(async (value) => {
|
|
||||||
this.plugin.settings.notionID = value;
|
|
||||||
await this.plugin.saveSettings();
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
// General Database Settings
|
|
||||||
containerEl.createEl('h2', {text: i18nConfig.NotionGeneralSetting});
|
|
||||||
|
|
||||||
new Setting(containerEl)
|
|
||||||
.setName(i18nConfig.NotYetFinish)
|
|
||||||
|
|
||||||
// new Setting(containerEl)
|
|
||||||
// .setName("Convert tags(optional)")
|
|
||||||
// .setDesc("Transfer the Obsidian tags to the Notion table. It requires the column with the name 'Tags'")
|
|
||||||
// .addToggle((toggle) =>
|
|
||||||
// toggle
|
|
||||||
// .setValue(this.plugin.settings.allowTags)
|
|
||||||
// .onChange(async (value) => {
|
|
||||||
// this.plugin.settings.allowTags = value;
|
|
||||||
// await this.plugin.saveSettings();
|
|
||||||
// })
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
0
src/ui/addButton.ts
Normal file
0
src/ui/addButton.ts
Normal file
247
src/ui/settingTabs.ts
Normal file
247
src/ui/settingTabs.ts
Normal file
@@ -0,0 +1,247 @@
|
|||||||
|
import { App, PluginSettingTab, Setting } from "obsidian";
|
||||||
|
import { i18nConfig } from "../lang/I18n";
|
||||||
|
import ObsidianSyncNotionPlugin from "../main";
|
||||||
|
|
||||||
|
export interface PluginSettings {
|
||||||
|
NextButton: boolean;
|
||||||
|
notionAPINext: string;
|
||||||
|
databaseIDNext: string;
|
||||||
|
bannerUrl: string;
|
||||||
|
notionUser: string;
|
||||||
|
proxy: string;
|
||||||
|
GeneralButton: boolean;
|
||||||
|
tagButton: boolean;
|
||||||
|
CustomTitleButton: boolean;
|
||||||
|
CustomTitleName: string;
|
||||||
|
notionAPIGeneral: string;
|
||||||
|
databaseIDGeneral: string;
|
||||||
|
CustomButton: boolean;
|
||||||
|
notionAPICustom: string;
|
||||||
|
databaseIDCustom: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DEFAULT_SETTINGS: PluginSettings = {
|
||||||
|
NextButton: true,
|
||||||
|
notionAPINext: "",
|
||||||
|
databaseIDNext: "",
|
||||||
|
bannerUrl: "",
|
||||||
|
notionUser: "",
|
||||||
|
proxy: "",
|
||||||
|
GeneralButton: true,
|
||||||
|
tagButton: true,
|
||||||
|
CustomTitleButton: false,
|
||||||
|
CustomTitleName: "",
|
||||||
|
notionAPIGeneral: "",
|
||||||
|
databaseIDGeneral: "",
|
||||||
|
CustomButton: false,
|
||||||
|
notionAPICustom: "",
|
||||||
|
databaseIDCustom: "",
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export class ObsidianSettingTab extends PluginSettingTab {
|
||||||
|
plugin: ObsidianSyncNotionPlugin;
|
||||||
|
|
||||||
|
constructor(app: App, plugin: ObsidianSyncNotionPlugin) {
|
||||||
|
super(app, plugin);
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
display(): void {
|
||||||
|
const { containerEl } = this;
|
||||||
|
|
||||||
|
containerEl.empty();
|
||||||
|
|
||||||
|
// General Settings
|
||||||
|
containerEl.createEl('h2', { text: i18nConfig.GeneralSetting });
|
||||||
|
|
||||||
|
this.createSettingEl(containerEl, i18nConfig.BannerUrl, i18nConfig.BannerUrlDesc, 'text', i18nConfig.BannerUrlText, this.plugin.settings.bannerUrl, 'bannerUrl')
|
||||||
|
|
||||||
|
this.createSettingEl(containerEl, i18nConfig.NotionUser, i18nConfig.NotionUserDesc, 'text', i18nConfig.NotionUserText, this.plugin.settings.notionUser, 'notionUser')
|
||||||
|
|
||||||
|
containerEl.createEl('h2', { text: i18nConfig.NotionNextSettingHeader })
|
||||||
|
|
||||||
|
|
||||||
|
new Setting(containerEl)
|
||||||
|
.setName(i18nConfig.NotionNextButton)
|
||||||
|
.setDesc(i18nConfig.NotionNextButtonDesc)
|
||||||
|
.addToggle((toggle) =>
|
||||||
|
toggle
|
||||||
|
.setValue(this.plugin.settings.NextButton)
|
||||||
|
.onChange(async (value) => {
|
||||||
|
this.plugin.settings.NextButton = value;
|
||||||
|
|
||||||
|
this.updateSettingEl(notionAPINextEl, value)
|
||||||
|
|
||||||
|
this.updateSettingEl(databaseIDNextEl, value)
|
||||||
|
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
await this.plugin.commands.updateCommand();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
const notionAPINextEl = this.createStyleDiv('api-next', this.plugin.settings.NextButton)
|
||||||
|
this.createSettingEl(notionAPINextEl, i18nConfig.NotionAPI, i18nConfig.NotionAPIDesc, 'password', i18nConfig.NotionAPIText, this.plugin.settings.notionAPINext, 'notionAPINext')
|
||||||
|
|
||||||
|
const databaseIDNextEl = this.createStyleDiv('databaseID-next', this.plugin.settings.NextButton)
|
||||||
|
this.createSettingEl(databaseIDNextEl, i18nConfig.DatabaseID, i18nConfig.NotionAPIDesc, 'password', i18nConfig.DatabaseIDText, this.plugin.settings.databaseIDNext, 'databaseIDNext')
|
||||||
|
|
||||||
|
|
||||||
|
// General Database Settings
|
||||||
|
containerEl.createEl('h2', { text: i18nConfig.NotionGeneralSettingHeader });
|
||||||
|
|
||||||
|
// new Setting(containerEl)
|
||||||
|
// .setName(i18nConfig.NotYetFinish)
|
||||||
|
new Setting(containerEl)
|
||||||
|
.setName(i18nConfig.NotionGeneralButton)
|
||||||
|
.setDesc(i18nConfig.NotionGeneralButtonDesc)
|
||||||
|
.addToggle((toggle) =>
|
||||||
|
toggle
|
||||||
|
.setValue(this.plugin.settings.GeneralButton)
|
||||||
|
.onChange(async (value) => {
|
||||||
|
this.plugin.settings.GeneralButton = value;
|
||||||
|
|
||||||
|
this.updateSettingEl(tagButtonEl, value)
|
||||||
|
this.updateSettingEl(CustomTitleEl, value)
|
||||||
|
// name should follow the result of the title button
|
||||||
|
if (value) {
|
||||||
|
this.updateSettingEl(CustomNameEl, this.plugin.settings.CustomTitleButton)
|
||||||
|
} else {
|
||||||
|
this.updateSettingEl(CustomNameEl, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.updateSettingEl(notionAPIGeneralEl, value)
|
||||||
|
this.updateSettingEl(databaseIDGeneralEl, value)
|
||||||
|
|
||||||
|
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
await this.plugin.commands.updateCommand();
|
||||||
|
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// add the tagButton to control whether to add tags to the general database
|
||||||
|
const tagButtonEl = this.createStyleDiv('tag-button', (this.plugin.settings.GeneralButton && this.plugin.settings.CustomTitleButton));
|
||||||
|
this.createSettingEl(tagButtonEl, i18nConfig.NotionTagButton, i18nConfig.NotionTagButtonDesc, 'toggle', i18nConfig.NotionCustomTitleText, this.plugin.settings.tagButton, 'tagButton')
|
||||||
|
|
||||||
|
// Custom Title Button
|
||||||
|
const CustomTitleEl = this.createStyleDiv('custom-title', this.plugin.settings.GeneralButton);
|
||||||
|
new Setting(CustomTitleEl)
|
||||||
|
.setName(i18nConfig.NotionCustomTitle)
|
||||||
|
.setDesc(i18nConfig.NotionCustomTitleDesc)
|
||||||
|
.addToggle((toggle) =>
|
||||||
|
toggle
|
||||||
|
.setValue(this.plugin.settings.CustomTitleButton)
|
||||||
|
.onChange(async (value) => {
|
||||||
|
this.plugin.settings.CustomTitleButton = value;
|
||||||
|
|
||||||
|
this.updateSettingEl(CustomNameEl, value)
|
||||||
|
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
await this.plugin.commands.updateCommand();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// Custom Title Name
|
||||||
|
const CustomNameEl = this.createStyleDiv('custom-name', (this.plugin.settings.CustomTitleButton && this.plugin.settings.GeneralButton));
|
||||||
|
this.createSettingEl(CustomNameEl, i18nConfig.NotionCustomTitleName, i18nConfig.NotionCustomTitleNameDesc, 'text', i18nConfig.NotionCustomTitleText, this.plugin.settings.CustomTitleName, 'CustomTitleName')
|
||||||
|
|
||||||
|
// new Setting(containerEl)
|
||||||
|
// .setName("Convert tags(optional)")
|
||||||
|
// .setDesc("Transfer the Obsidian tags to the Notion table. It requires the column with the name 'Tags'")
|
||||||
|
// .addToggle((toggle) =>
|
||||||
|
// toggle
|
||||||
|
// .setValue(this.plugin.settings.allowTags)
|
||||||
|
// .onChange(async (value) => {
|
||||||
|
// this.plugin.settings.allowTags = value;
|
||||||
|
// await this.plugin.saveSettings();
|
||||||
|
// })
|
||||||
|
// );
|
||||||
|
|
||||||
|
const notionAPIGeneralEl = this.createStyleDiv('api-general', this.plugin.settings.GeneralButton);
|
||||||
|
this.createSettingEl(notionAPIGeneralEl, i18nConfig.NotionAPI, i18nConfig.NotionAPIDesc, 'password', i18nConfig.NotionAPIText, this.plugin.settings.notionAPIGeneral, 'notionAPIGeneral')
|
||||||
|
|
||||||
|
|
||||||
|
const databaseIDGeneralEl = this.createStyleDiv('databaseID-general', this.plugin.settings.GeneralButton);
|
||||||
|
this.createSettingEl(databaseIDGeneralEl, i18nConfig.DatabaseID, i18nConfig.NotionAPIDesc, 'password', i18nConfig.DatabaseIDText, this.plugin.settings.databaseIDGeneral, 'databaseIDGeneral')
|
||||||
|
|
||||||
|
// Custom Database Settings
|
||||||
|
|
||||||
|
// containerEl.createEl('h2', {text: i18nConfig.NotionCustomSettingHeader});
|
||||||
|
//
|
||||||
|
// new Setting(containerEl)
|
||||||
|
// .setName(i18nConfig.NotionCustomButton)
|
||||||
|
// .setDesc(i18nConfig.NotionCustomButtonDesc)
|
||||||
|
// .addToggle((toggle) =>
|
||||||
|
// toggle
|
||||||
|
// .setValue(this.plugin.settings.CustomButton)
|
||||||
|
// .onChange(async (value) => {
|
||||||
|
// this.plugin.settings.CustomButton = value;
|
||||||
|
// await this.plugin.saveSettings();
|
||||||
|
// })
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
|
||||||
|
// create a function to create a div with a style for pop over elements
|
||||||
|
private createStyleDiv(className: string, commandValue: boolean = false) {
|
||||||
|
return this.containerEl.createDiv(className, (div) => {
|
||||||
|
this.updateSettingEl(div, commandValue);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// update the setting display style in the setting tab
|
||||||
|
private updateSettingEl(element: HTMLElement, commandValue: boolean) {
|
||||||
|
element.style.borderTop = commandValue ? "1px solid var(--background-modifier-border)" : "none";
|
||||||
|
element.style.paddingTop = commandValue ? "0.75em" : "0";
|
||||||
|
element.style.display = commandValue ? "block" : "none";
|
||||||
|
element.style.alignItems = "center";
|
||||||
|
}
|
||||||
|
|
||||||
|
// function to add one setting element in the setting tab.
|
||||||
|
private createSettingEl(containerEl: HTMLElement, name: string, desc: string, type: string, placeholder: string, holderValue: any, settingsKey: string) {
|
||||||
|
if (type === 'password') {
|
||||||
|
return new Setting(containerEl)
|
||||||
|
.setName(name)
|
||||||
|
.setDesc(desc)
|
||||||
|
.addText((text) => {
|
||||||
|
text.inputEl.type = type;
|
||||||
|
return text
|
||||||
|
.setPlaceholder(placeholder)
|
||||||
|
.setValue(holderValue)
|
||||||
|
.onChange(async (value) => {
|
||||||
|
this.plugin.settings[settingsKey] = value; // Update the plugin settings directly
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
})
|
||||||
|
});
|
||||||
|
} else if (type === 'toggle') {
|
||||||
|
return new Setting(containerEl)
|
||||||
|
.setName(name)
|
||||||
|
.setDesc(desc)
|
||||||
|
.addToggle((toggle) =>
|
||||||
|
toggle
|
||||||
|
.setValue(holderValue)
|
||||||
|
.onChange(async (value) => {
|
||||||
|
this.plugin.settings[settingsKey] = value; // Update the plugin settings directly
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
await this.plugin.commands.updateCommand();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else if (type === 'text') {
|
||||||
|
return new Setting(containerEl)
|
||||||
|
.setName(name)
|
||||||
|
.setDesc(desc)
|
||||||
|
.addText((text) =>
|
||||||
|
text
|
||||||
|
.setPlaceholder(placeholder)
|
||||||
|
.setValue(holderValue)
|
||||||
|
.onChange(async (value) => {
|
||||||
|
this.plugin.settings[settingsKey] = value; // Update the plugin settings directly
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
await this.plugin.commands.updateCommand();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
51
src/upload/updateYaml.ts
Normal file
51
src/upload/updateYaml.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import { App, Notice, TFile } from "obsidian";
|
||||||
|
import ObsidianSyncNotionPlugin from "../main";
|
||||||
|
import { PluginSettings } from "../ui/settingTabs";
|
||||||
|
|
||||||
|
export async function updateYamlInfo(
|
||||||
|
yamlContent: string,
|
||||||
|
nowFile: TFile,
|
||||||
|
res: any,
|
||||||
|
app: App,
|
||||||
|
plugin: ObsidianSyncNotionPlugin,
|
||||||
|
) {
|
||||||
|
let { url, id } = res.json
|
||||||
|
// replace www to notionID
|
||||||
|
const { notionUser } = plugin.settings;
|
||||||
|
|
||||||
|
if (notionUser !== "") {
|
||||||
|
// replace url str "www" to notionID
|
||||||
|
url = url.replace("www.notion.so", `${notionUser}.notion.site`)
|
||||||
|
}
|
||||||
|
|
||||||
|
await app.fileManager.processFrontMatter(nowFile, yamlContent => {
|
||||||
|
if (yamlContent['notionID']) {
|
||||||
|
delete yamlContent['notionID']
|
||||||
|
}
|
||||||
|
if (yamlContent['link']) {
|
||||||
|
delete yamlContent['link']
|
||||||
|
}
|
||||||
|
// add new notionID and link
|
||||||
|
yamlContent.notionID = id;
|
||||||
|
yamlContent.link = url;
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(url)
|
||||||
|
} catch (error) {
|
||||||
|
new Notice(`复制链接失败,请手动复制${error}`)
|
||||||
|
}
|
||||||
|
// const __content = yamlContent.__content;
|
||||||
|
// delete yamlContent.__content
|
||||||
|
// const yamlhead = yaml.stringify(yamlContent)
|
||||||
|
// // if yamlhead hava last \n remove it
|
||||||
|
// const yamlhead_remove_n = yamlhead.replace(/\n$/, '')
|
||||||
|
// // if __content have start \n remove it
|
||||||
|
// const __content_remove_n = __content.replace(/^\n/, '')
|
||||||
|
// const content = '---\n' +yamlhead_remove_n +'\n---\n' + __content_remove_n;
|
||||||
|
// try {
|
||||||
|
// await nowFile.vault.modify(nowFile, content)
|
||||||
|
// } catch (error) {
|
||||||
|
// new Notice(`write file error ${error}`)
|
||||||
|
// }
|
||||||
|
}
|
||||||
80
src/upload/uploadCommand.ts
Normal file
80
src/upload/uploadCommand.ts
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
import { i18nConfig } from "../lang/I18n";
|
||||||
|
import { App, Notice } from "obsidian";
|
||||||
|
import { Upload2NotionNext } from "./upload_next/Upload2NotionNext";
|
||||||
|
import { Upload2NotionGeneral } from "./upload_general/Upload2NotionGeneral";
|
||||||
|
import { PluginSettings } from "../ui/settingTabs";
|
||||||
|
import ObsidianSyncNotionPlugin from "../main";
|
||||||
|
import { getNowFileMarkdownContentNext } from "./upload_next/getMarkdownNext";
|
||||||
|
import { getNowFileMarkdownContentGeneral } from "./upload_general/getMarkdownGeneral";
|
||||||
|
|
||||||
|
export async function uploadCommandNext(
|
||||||
|
plugin: ObsidianSyncNotionPlugin,
|
||||||
|
settings: PluginSettings,
|
||||||
|
app: App,
|
||||||
|
) {
|
||||||
|
|
||||||
|
const { notionAPINext, databaseIDNext } = settings;
|
||||||
|
|
||||||
|
// Check if NNon exists
|
||||||
|
// if (NNon === undefined) {
|
||||||
|
// const NNonmessage = i18nConfig.NNonMissing;
|
||||||
|
// new Notice(NNonmessage);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Check if the user has set up the Notion API and database ID
|
||||||
|
if (notionAPINext === "" || databaseIDNext === "") {
|
||||||
|
const setAPIMessage = i18nConfig["set-api-id"];
|
||||||
|
new Notice(setAPIMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { markDownData, nowFile, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime } = await getNowFileMarkdownContentNext(app, settings)
|
||||||
|
|
||||||
|
if (markDownData) {
|
||||||
|
const { basename } = nowFile;
|
||||||
|
const upload = new Upload2NotionNext(plugin);
|
||||||
|
const res = await upload.syncMarkdownToNotionNext(basename, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, markDownData, nowFile, this.app);
|
||||||
|
|
||||||
|
if (res.status === 200) {
|
||||||
|
new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
||||||
|
} else {
|
||||||
|
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export async function uploadCommandGeneral(
|
||||||
|
plugin: ObsidianSyncNotionPlugin,
|
||||||
|
settings: PluginSettings,
|
||||||
|
app: App,
|
||||||
|
) {
|
||||||
|
|
||||||
|
const { notionAPIGeneral, databaseIDGeneral } = settings;
|
||||||
|
|
||||||
|
// Check if the user has set up the Notion API and database ID
|
||||||
|
if (notionAPIGeneral === "" || databaseIDGeneral === "") {
|
||||||
|
const setAPIMessage = i18nConfig["set-api-id"];
|
||||||
|
new Notice(setAPIMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { markDownData, nowFile, cover, tags } = await getNowFileMarkdownContentGeneral(app, settings)
|
||||||
|
|
||||||
|
if (markDownData) {
|
||||||
|
const { basename } = nowFile;
|
||||||
|
|
||||||
|
const upload = new Upload2NotionGeneral(plugin);
|
||||||
|
const res = await upload.syncMarkdownToNotionGeneral(basename, cover, tags, markDownData, nowFile, this.app);
|
||||||
|
|
||||||
|
if (res.status === 200) {
|
||||||
|
new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
||||||
|
} else {
|
||||||
|
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
90
src/upload/upload_general/BaseUpload2NotionGeneral.ts
Normal file
90
src/upload/upload_general/BaseUpload2NotionGeneral.ts
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
import {App, Notice, requestUrl, TFile} from "obsidian";
|
||||||
|
import {Client} from '@notionhq/client';
|
||||||
|
import {markdownToBlocks,} from "@tryfabric/martian";
|
||||||
|
import * as yamlFrontMatter from "yaml-front-matter";
|
||||||
|
// import * as yaml from "yaml"
|
||||||
|
import MyPlugin from "src/main";
|
||||||
|
|
||||||
|
export class UploadBaseGeneral {
|
||||||
|
plugin: MyPlugin;
|
||||||
|
notion: Client;
|
||||||
|
agent: any;
|
||||||
|
|
||||||
|
constructor(plugin: MyPlugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
async deletePage(notionID: string) {
|
||||||
|
return requestUrl({
|
||||||
|
url: `https://api.notion.com/v1/blocks/${notionID}`,
|
||||||
|
method: 'DELETE',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': 'Bearer ' + this.plugin.settings.notionAPINext,
|
||||||
|
'Notion-Version': '2022-06-28',
|
||||||
|
},
|
||||||
|
body: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async getDataBase(databaseID: string) {
|
||||||
|
const response = await requestUrl({
|
||||||
|
url: `https://api.notion.com/v1/databases/${databaseID}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Bearer ' + this.plugin.settings.notionAPINext,
|
||||||
|
'Notion-Version': '2022-06-28',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// Check if cover is present in the JSON response and then get the URL
|
||||||
|
if (response.json.cover && response.json.cover.external) {
|
||||||
|
return response.json.cover.external.url;
|
||||||
|
} else {
|
||||||
|
return null; // or some other default value, if you prefer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// async updateYamlInfo(yamlContent: string, nowFile: TFile, res: any, app: App, settings: any) {
|
||||||
|
// let {url, id} = res.json
|
||||||
|
// // replace www to notionID
|
||||||
|
// const {notionUser} = this.plugin.settings;
|
||||||
|
//
|
||||||
|
// if (notionUser !== "") {
|
||||||
|
// // replace url str "www" to notionID
|
||||||
|
// url = url.replace("www.notion.so", `${notionUser}.notion.site`)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// await app.fileManager.processFrontMatter(nowFile, yamlContent => {
|
||||||
|
// if (yamlContent['notionID']) {
|
||||||
|
// delete yamlContent['notionID']
|
||||||
|
// }
|
||||||
|
// if (yamlContent['link']) {
|
||||||
|
// delete yamlContent['link']
|
||||||
|
// }
|
||||||
|
// // add new notionID and link
|
||||||
|
// yamlContent.notionID = id;
|
||||||
|
// yamlContent.link = url;
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// await navigator.clipboard.writeText(url)
|
||||||
|
// } catch (error) {
|
||||||
|
// new Notice(`复制链接失败,请手动复制${error}`)
|
||||||
|
// }
|
||||||
|
// // const __content = yamlContent.__content;
|
||||||
|
// // delete yamlContent.__content
|
||||||
|
// // const yamlhead = yaml.stringify(yamlContent)
|
||||||
|
// // // if yamlhead hava last \n remove it
|
||||||
|
// // const yamlhead_remove_n = yamlhead.replace(/\n$/, '')
|
||||||
|
// // // if __content have start \n remove it
|
||||||
|
// // const __content_remove_n = __content.replace(/^\n/, '')
|
||||||
|
// // const content = '---\n' +yamlhead_remove_n +'\n---\n' + __content_remove_n;
|
||||||
|
// // try {
|
||||||
|
// // await nowFile.vault.modify(nowFile, content)
|
||||||
|
// // } catch (error) {
|
||||||
|
// // new Notice(`write file error ${error}`)
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
|
}
|
||||||
148
src/upload/upload_general/Upload2NotionGeneral.ts
Normal file
148
src/upload/upload_general/Upload2NotionGeneral.ts
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
import { App, Notice, requestUrl, TFile } from "obsidian";
|
||||||
|
import { Client } from "@notionhq/client";
|
||||||
|
import { markdownToBlocks } from "@tryfabric/martian";
|
||||||
|
import * as yamlFrontMatter from "yaml-front-matter";
|
||||||
|
// import * as yaml from "yaml"
|
||||||
|
import MyPlugin from "src/main";
|
||||||
|
import { PluginSettings } from "../../ui/settingTabs";
|
||||||
|
import { UploadBaseGeneral } from "./BaseUpload2NotionGeneral";
|
||||||
|
import { updateYamlInfo } from "../updateYaml";
|
||||||
|
|
||||||
|
export class Upload2NotionGeneral extends UploadBaseGeneral {
|
||||||
|
settings: PluginSettings;
|
||||||
|
|
||||||
|
constructor(plugin: MyPlugin) {
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 因为需要解析notion的block进行对比,非常的麻烦,
|
||||||
|
// 暂时就直接删除,新建一个page
|
||||||
|
async updatePage(
|
||||||
|
notionID: string,
|
||||||
|
title: string,
|
||||||
|
cover: string,
|
||||||
|
tags: string[],
|
||||||
|
childArr: any,
|
||||||
|
) {
|
||||||
|
await this.deletePage(notionID);
|
||||||
|
|
||||||
|
const databasecover = await this.getDataBase(
|
||||||
|
this.plugin.settings.databaseIDGeneral,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (cover == null) {
|
||||||
|
cover = databasecover;
|
||||||
|
}
|
||||||
|
|
||||||
|
return await this.createPage(title, cover, tags, childArr);
|
||||||
|
}
|
||||||
|
|
||||||
|
async createPage(
|
||||||
|
title: string,
|
||||||
|
cover: string,
|
||||||
|
tags: string[],
|
||||||
|
childArr: any,
|
||||||
|
) {
|
||||||
|
const bodyString: any = {
|
||||||
|
parent: {
|
||||||
|
database_id: this.plugin.settings.databaseIDGeneral,
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
[this.plugin.settings.CustomTitleButton
|
||||||
|
? this.plugin.settings.CustomTitleName
|
||||||
|
: "title"]: {
|
||||||
|
title: [
|
||||||
|
{
|
||||||
|
text: {
|
||||||
|
content: title,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
...(this.plugin.settings.tagsButton
|
||||||
|
? {
|
||||||
|
tags: {
|
||||||
|
multi_select: tags && true ? tags.map((tag) => ({ name: tag })) : [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
|
},
|
||||||
|
children: childArr,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (cover) {
|
||||||
|
bodyString.cover = {
|
||||||
|
type: "external",
|
||||||
|
external: {
|
||||||
|
url: cover,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bodyString.cover && this.plugin.settings.bannerUrl) {
|
||||||
|
bodyString.cover = {
|
||||||
|
type: "external",
|
||||||
|
external: {
|
||||||
|
url: this.plugin.settings.bannerUrl,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return await requestUrl({
|
||||||
|
url: `https://api.notion.com/v1/pages`,
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
// 'User-Agent': 'obsidian.md',
|
||||||
|
Authorization:
|
||||||
|
"Bearer " + this.plugin.settings.notionAPIGeneral,
|
||||||
|
"Notion-Version": "2022-06-28",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(bodyString),
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
new Notice(`network error ${error}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async syncMarkdownToNotionGeneral(
|
||||||
|
title: string,
|
||||||
|
cover: string,
|
||||||
|
tags: string[],
|
||||||
|
markdown: string,
|
||||||
|
nowFile: TFile,
|
||||||
|
app: App,
|
||||||
|
): Promise<any> {
|
||||||
|
const options = {
|
||||||
|
notionLimits: {
|
||||||
|
truncate: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let res: any;
|
||||||
|
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
||||||
|
const __content = yamlContent.__content;
|
||||||
|
const file2Block = markdownToBlocks(__content, options);
|
||||||
|
const frontmasster =
|
||||||
|
app.metadataCache.getFileCache(nowFile)?.frontmatter;
|
||||||
|
const notionID = frontmasster ? frontmasster.notionID : null;
|
||||||
|
|
||||||
|
if (notionID) {
|
||||||
|
res = await this.updatePage(
|
||||||
|
notionID,
|
||||||
|
title,
|
||||||
|
cover,
|
||||||
|
tags,
|
||||||
|
file2Block,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
res = await this.createPage(title, cover, tags, file2Block);
|
||||||
|
}
|
||||||
|
if (res.status === 200) {
|
||||||
|
await updateYamlInfo(markdown, nowFile, res, app, this.plugin);
|
||||||
|
} else {
|
||||||
|
new Notice(`${res.text}`);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
33
src/upload/upload_general/getMarkdownGeneral.ts
Normal file
33
src/upload/upload_general/getMarkdownGeneral.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import {App, Notice} from "obsidian";
|
||||||
|
import {i18nConfig} from "../../lang/I18n";
|
||||||
|
import {PluginSettings} from "../../ui/settingTabs";
|
||||||
|
|
||||||
|
export async function getNowFileMarkdownContentGeneral(
|
||||||
|
app: App,
|
||||||
|
settings: PluginSettings,
|
||||||
|
) {
|
||||||
|
const nowFile = app.workspace.getActiveFile();
|
||||||
|
let cover = '';
|
||||||
|
let tags = [];
|
||||||
|
|
||||||
|
const FileCache = app.metadataCache.getFileCache(nowFile);
|
||||||
|
try {
|
||||||
|
cover = FileCache.frontmatter.coverurl;
|
||||||
|
tags = FileCache.frontmatter.tags;
|
||||||
|
} catch (error) {
|
||||||
|
new Notice(i18nConfig["set-tags-fail"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nowFile) {
|
||||||
|
const markDownData = await nowFile.vault.read(nowFile);
|
||||||
|
return {
|
||||||
|
markDownData,
|
||||||
|
nowFile,
|
||||||
|
cover,
|
||||||
|
tags,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
new Notice(i18nConfig["open-file"]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
90
src/upload/upload_next/BaseUpload2NotionNext.ts
Normal file
90
src/upload/upload_next/BaseUpload2NotionNext.ts
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
import { App, Notice, requestUrl, TFile } from "obsidian";
|
||||||
|
import { Client } from '@notionhq/client';
|
||||||
|
import { markdownToBlocks, } from "@tryfabric/martian";
|
||||||
|
import * as yamlFrontMatter from "yaml-front-matter";
|
||||||
|
// import * as yaml from "yaml"
|
||||||
|
import MyPlugin from "src/main";
|
||||||
|
|
||||||
|
export class UploadBaseNext {
|
||||||
|
plugin: MyPlugin;
|
||||||
|
notion: Client;
|
||||||
|
agent: any;
|
||||||
|
|
||||||
|
constructor(plugin: MyPlugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
async deletePage(notionID: string) {
|
||||||
|
return requestUrl({
|
||||||
|
url: `https://api.notion.com/v1/blocks/${notionID}`,
|
||||||
|
method: 'DELETE',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': 'Bearer ' + this.plugin.settings.notionAPINext,
|
||||||
|
'Notion-Version': '2022-06-28',
|
||||||
|
},
|
||||||
|
body: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async getDataBase(databaseID: string) {
|
||||||
|
const response = await requestUrl({
|
||||||
|
url: `https://api.notion.com/v1/databases/${databaseID}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Bearer ' + this.plugin.settings.notionAPINext,
|
||||||
|
'Notion-Version': '2022-06-28',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// Check if cover is present in the JSON response and then get the URL
|
||||||
|
if (response.json.cover && response.json.cover.external) {
|
||||||
|
return response.json.cover.external.url;
|
||||||
|
} else {
|
||||||
|
return null; // or some other default value, if you prefer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// async updateYamlInfo(yamlContent: string, nowFile: TFile, res: any, app: App, settings: any) {
|
||||||
|
// let {url, id} = res.json
|
||||||
|
// // replace www to notionID
|
||||||
|
// const { notionUser} = this.plugin.settings;
|
||||||
|
//
|
||||||
|
// if (notionUser !== "") {
|
||||||
|
// // replace url str "www" to notionID
|
||||||
|
// url = url.replace("www.notion.so", `${notionUser}.notion.site`)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// await app.fileManager.processFrontMatter(nowFile, yamlContent => {
|
||||||
|
// if (yamlContent['notionID']) {
|
||||||
|
// delete yamlContent['notionID']
|
||||||
|
// }
|
||||||
|
// if (yamlContent['link']) {
|
||||||
|
// delete yamlContent['link']
|
||||||
|
// }
|
||||||
|
// // add new notionID and link
|
||||||
|
// yamlContent.notionID = id;
|
||||||
|
// yamlContent.link = url;
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// await navigator.clipboard.writeText(url)
|
||||||
|
// } catch (error) {
|
||||||
|
// new Notice(`复制链接失败,请手动复制${error}`)
|
||||||
|
// }
|
||||||
|
// // const __content = yamlContent.__content;
|
||||||
|
// // delete yamlContent.__content
|
||||||
|
// // const yamlhead = yaml.stringify(yamlContent)
|
||||||
|
// // // if yamlhead hava last \n remove it
|
||||||
|
// // const yamlhead_remove_n = yamlhead.replace(/\n$/, '')
|
||||||
|
// // // if __content have start \n remove it
|
||||||
|
// // const __content_remove_n = __content.replace(/^\n/, '')
|
||||||
|
// // const content = '---\n' +yamlhead_remove_n +'\n---\n' + __content_remove_n;
|
||||||
|
// // try {
|
||||||
|
// // await nowFile.vault.modify(nowFile, content)
|
||||||
|
// // } catch (error) {
|
||||||
|
// // new Notice(`write file error ${error}`)
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -1,22 +1,41 @@
|
|||||||
import {UploadBase} from "./BaseUpload2Notion";
|
import { UploadBaseNext } from "./BaseUpload2NotionNext";
|
||||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
import { App, Notice, requestUrl, TFile } from "obsidian";
|
||||||
import { Client } from '@notionhq/client';
|
import { Client } from '@notionhq/client';
|
||||||
import { markdownToBlocks, } from "@tryfabric/martian";
|
import { markdownToBlocks, } from "@tryfabric/martian";
|
||||||
import * as yamlFrontMatter from "yaml-front-matter";
|
import * as yamlFrontMatter from "yaml-front-matter";
|
||||||
// import * as yaml from "yaml"
|
// import * as yaml from "yaml"
|
||||||
import MyPlugin from "src/main";
|
import MyPlugin from "src/main";
|
||||||
|
import { PluginSettings } from "../../ui/settingTabs";
|
||||||
|
import { updateYamlInfo } from "../updateYaml";
|
||||||
|
|
||||||
|
export class Upload2NotionNext extends UploadBaseNext {
|
||||||
|
settings: PluginSettings;
|
||||||
|
|
||||||
export class Upload2NotionNext extends UploadBase {
|
|
||||||
constructor(plugin: MyPlugin) {
|
constructor(plugin: MyPlugin) {
|
||||||
super(plugin);
|
super(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 因为需要解析notion的block进行对比,非常的麻烦,
|
// 因为需要解析notion的block进行对比,非常的麻烦,
|
||||||
// 暂时就直接删除,新建一个page
|
// 暂时就直接删除,新建一个page
|
||||||
async updatePage(notionID: string, title: string, emoji: string, cover: string, tags: string[], type: string, slug: string, stats: string, category: string, summary: string, paword: string, favicon: string, datetime: string, childArr: any) {
|
async updatePage(
|
||||||
|
notionID: string,
|
||||||
|
title: string,
|
||||||
|
emoji: string,
|
||||||
|
cover: string,
|
||||||
|
tags: string[],
|
||||||
|
type: string,
|
||||||
|
slug: string,
|
||||||
|
stats: string,
|
||||||
|
category: string,
|
||||||
|
summary: string,
|
||||||
|
paword: string,
|
||||||
|
favicon: string,
|
||||||
|
datetime: string,
|
||||||
|
childArr: any
|
||||||
|
) {
|
||||||
await this.deletePage(notionID)
|
await this.deletePage(notionID)
|
||||||
|
|
||||||
const databasecover = await this.getDataBase(this.plugin.settings.databaseID)
|
const databasecover = await this.getDataBase(this.plugin.settings.databaseIDNext)
|
||||||
|
|
||||||
if (cover == null) {
|
if (cover == null) {
|
||||||
cover = databasecover
|
cover = databasecover
|
||||||
@@ -38,10 +57,24 @@ export class Upload2NotionNext extends UploadBase {
|
|||||||
childArr)
|
childArr)
|
||||||
}
|
}
|
||||||
|
|
||||||
async createPage(title: string, emoji: string, cover: string, tags: string[], type: string, slug: string, stats: string, category: string, summary: string, pawrod: string, favicon: string, datetime: string, childArr: any) {
|
async createPage(
|
||||||
|
title: string,
|
||||||
|
emoji: string,
|
||||||
|
cover: string,
|
||||||
|
tags: string[],
|
||||||
|
type: string,
|
||||||
|
slug: string,
|
||||||
|
stats: string,
|
||||||
|
category: string,
|
||||||
|
summary: string,
|
||||||
|
pawrod: string,
|
||||||
|
favicon: string,
|
||||||
|
datetime: string,
|
||||||
|
childArr: any
|
||||||
|
) {
|
||||||
const bodyString: any = {
|
const bodyString: any = {
|
||||||
parent: {
|
parent: {
|
||||||
database_id: this.plugin.settings.databaseID
|
database_id: this.plugin.settings.databaseIDNext
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
emoji: emoji || '📜'
|
emoji: emoji || '📜'
|
||||||
@@ -145,7 +178,7 @@ export class Upload2NotionNext extends UploadBase {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
// 'User-Agent': 'obsidian.md',
|
// 'User-Agent': 'obsidian.md',
|
||||||
'Authorization': 'Bearer ' + this.plugin.settings.notionAPI,
|
'Authorization': 'Bearer ' + this.plugin.settings.notionAPINext,
|
||||||
'Notion-Version': '2022-06-28',
|
'Notion-Version': '2022-06-28',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(bodyString),
|
body: JSON.stringify(bodyString),
|
||||||
@@ -155,21 +188,72 @@ export class Upload2NotionNext extends UploadBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async syncMarkdownToNotion(title: string, emoji: string, cover: string, tags: string[], type: string, slug: string, stats: string, category: string, summary: string, paword: string, favicon: string, datetime: string, markdown: string, nowFile: TFile, app: App, settings: any): Promise<any> {
|
async syncMarkdownToNotionNext(
|
||||||
|
title: string,
|
||||||
|
emoji: string,
|
||||||
|
cover: string,
|
||||||
|
tags: string[],
|
||||||
|
type: string,
|
||||||
|
slug: string,
|
||||||
|
stats: string,
|
||||||
|
category: string,
|
||||||
|
summary: string,
|
||||||
|
paword: string,
|
||||||
|
favicon: string,
|
||||||
|
datetime: string,
|
||||||
|
markdown: string,
|
||||||
|
nowFile: TFile,
|
||||||
|
app: App,
|
||||||
|
): Promise<any> {
|
||||||
|
const options = {
|
||||||
|
notionLimits: {
|
||||||
|
truncate: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
let res: any
|
let res: any
|
||||||
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
||||||
const __content = yamlContent.__content
|
const __content = yamlContent.__content
|
||||||
const file2Block = markdownToBlocks(__content);
|
const file2Block = markdownToBlocks(__content, options);
|
||||||
const frontmasster = app.metadataCache.getFileCache(nowFile)?.frontmatter
|
const frontmasster = app.metadataCache.getFileCache(nowFile)?.frontmatter
|
||||||
const notionID = frontmasster ? frontmasster.notionID : null
|
const notionID = frontmasster ? frontmasster.notionID : null
|
||||||
|
|
||||||
if (notionID) {
|
if (notionID) {
|
||||||
res = await this.updatePage(notionID, title, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, file2Block);
|
res = await this.updatePage(
|
||||||
|
notionID,
|
||||||
|
title,
|
||||||
|
emoji,
|
||||||
|
cover,
|
||||||
|
tags,
|
||||||
|
type,
|
||||||
|
slug,
|
||||||
|
stats,
|
||||||
|
category,
|
||||||
|
summary,
|
||||||
|
paword,
|
||||||
|
favicon,
|
||||||
|
datetime,
|
||||||
|
file2Block
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
res = await this.createPage(title, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, file2Block);
|
res = await this.createPage(
|
||||||
|
title,
|
||||||
|
emoji,
|
||||||
|
cover,
|
||||||
|
tags,
|
||||||
|
type,
|
||||||
|
slug,
|
||||||
|
stats,
|
||||||
|
category,
|
||||||
|
summary,
|
||||||
|
paword,
|
||||||
|
favicon,
|
||||||
|
datetime,
|
||||||
|
file2Block
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
await this.updateYamlInfo(markdown, nowFile, res, app, settings)
|
await updateYamlInfo(markdown, nowFile, res, app, this.plugin)
|
||||||
} else {
|
} else {
|
||||||
new Notice(`${res.text}`)
|
new Notice(`${res.text}`)
|
||||||
}
|
}
|
||||||
60
src/upload/upload_next/getMarkdownNext.ts
Normal file
60
src/upload/upload_next/getMarkdownNext.ts
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
import { App, Notice } from "obsidian";
|
||||||
|
import { i18nConfig } from "../../lang/I18n";
|
||||||
|
import { PluginSettings } from "../../ui/settingTabs";
|
||||||
|
|
||||||
|
export async function getNowFileMarkdownContentNext(
|
||||||
|
app: App,
|
||||||
|
settings: PluginSettings,
|
||||||
|
) {
|
||||||
|
const nowFile = app.workspace.getActiveFile();
|
||||||
|
let emoji = '';
|
||||||
|
let cover = '';
|
||||||
|
let tags = [];
|
||||||
|
let type = '';
|
||||||
|
let slug = '';
|
||||||
|
let stats = '';
|
||||||
|
let status = '';
|
||||||
|
let category = '';
|
||||||
|
let summary = '';
|
||||||
|
let paword = '';
|
||||||
|
let favicon = '';
|
||||||
|
let datetime = '';
|
||||||
|
|
||||||
|
const FileCache = app.metadataCache.getFileCache(nowFile);
|
||||||
|
try {
|
||||||
|
emoji = FileCache.frontmatter.titleicon;
|
||||||
|
cover = FileCache.frontmatter.coverurl;
|
||||||
|
tags = FileCache.frontmatter.tags;
|
||||||
|
type = FileCache.frontmatter.type;
|
||||||
|
slug = FileCache.frontmatter.slug;
|
||||||
|
stats = FileCache.frontmatter.stats || FileCache.frontmatter.status;
|
||||||
|
category = FileCache.frontmatter.category;
|
||||||
|
summary = FileCache.frontmatter.summary;
|
||||||
|
paword = FileCache.frontmatter.password;
|
||||||
|
favicon = FileCache.frontmatter.icon;
|
||||||
|
datetime = FileCache.frontmatter.date;
|
||||||
|
} catch (error) {
|
||||||
|
new Notice(i18nConfig["set-tags-fail"]);
|
||||||
|
}
|
||||||
|
if (nowFile) {
|
||||||
|
const markDownData = await nowFile.vault.read(nowFile);
|
||||||
|
return {
|
||||||
|
markDownData,
|
||||||
|
nowFile,
|
||||||
|
emoji,
|
||||||
|
cover,
|
||||||
|
tags,
|
||||||
|
type,
|
||||||
|
slug,
|
||||||
|
stats,
|
||||||
|
category,
|
||||||
|
summary,
|
||||||
|
paword,
|
||||||
|
favicon,
|
||||||
|
datetime,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
new Notice(i18nConfig["open-file"]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.ts"
|
"**/*.ts",
|
||||||
,
|
"src/Upload2Notion.ts",
|
||||||
"src/Upload2Notion.ts"
|
"src/*.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
// update package.json version
|
// update package.json version
|
||||||
import fs from 'fs';
|
import fs from "fs";
|
||||||
|
|
||||||
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
const packageJson = JSON.parse(fs.readFileSync("./package.json", "utf8"));
|
||||||
|
|
||||||
console.log(packageJson.version);
|
console.log(packageJson.version);
|
||||||
|
|
||||||
|
|
||||||
// get node args
|
// get node args
|
||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
|
|
||||||
@@ -13,14 +12,13 @@ packageJson.version = args[0];
|
|||||||
|
|
||||||
console.log(packageJson.version);
|
console.log(packageJson.version);
|
||||||
|
|
||||||
|
|
||||||
// write package.json
|
// write package.json
|
||||||
fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));
|
fs.writeFileSync("./package.json", JSON.stringify(packageJson, null, 2));
|
||||||
|
|
||||||
// read manifest.json
|
// read manifest.json
|
||||||
const manifestJson = JSON.parse(fs.readFileSync('./manifest.json', 'utf8'));
|
const manifestJson = JSON.parse(fs.readFileSync("./manifest.json", "utf8"));
|
||||||
|
|
||||||
manifestJson.version = args[0];
|
manifestJson.version = args[0];
|
||||||
|
|
||||||
// write manifest.json
|
// write manifest.json
|
||||||
fs.writeFileSync('./manifest.json', JSON.stringify(manifestJson, null, 2));
|
fs.writeFileSync("./manifest.json", JSON.stringify(manifestJson, null, 2));
|
||||||
|
|||||||
503
yarn.lock
503
yarn.lock
@@ -2,115 +2,115 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@esbuild/android-arm64@0.19.2":
|
"@esbuild/android-arm64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.2.tgz#bc35990f412a749e948b792825eef7df0ce0e073"
|
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz#276c5f99604054d3dbb733577e09adae944baa90"
|
||||||
integrity sha512-lsB65vAbe90I/Qe10OjkmrdxSX4UJDjosDgb8sZUKcg3oefEuW2OT2Vozz8ef7wrJbMcmhvCC+hciF8jY/uAkw==
|
integrity sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==
|
||||||
|
|
||||||
"@esbuild/android-arm@0.19.2":
|
"@esbuild/android-arm@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.2.tgz#edd1c8f23ba353c197f5b0337123c58ff2a56999"
|
resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.5.tgz#4a3cbf14758166abaae8ba9c01a80e68342a4eec"
|
||||||
integrity sha512-tM8yLeYVe7pRyAu9VMi/Q7aunpLwD139EY1S99xbQkT4/q2qa6eA4ige/WJQYdJ8GBL1K33pPFhPfPdJ/WzT8Q==
|
integrity sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==
|
||||||
|
|
||||||
"@esbuild/android-x64@0.19.2":
|
"@esbuild/android-x64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.2.tgz#2dcdd6e6f1f2d82ea1b746abd8da5b284960f35a"
|
resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.5.tgz#21a3d11cd4613d2d3c5ccb9e746c254eb9265b0a"
|
||||||
integrity sha512-qK/TpmHt2M/Hg82WXHRc/W/2SGo/l1thtDHZWqFq7oi24AjZ4O/CpPSu6ZuYKFkEgmZlFoa7CooAyYmuvnaG8w==
|
integrity sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==
|
||||||
|
|
||||||
"@esbuild/darwin-arm64@0.19.2":
|
"@esbuild/darwin-arm64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.2.tgz#55b36bc06d76f5c243987c1f93a11a80d8fc3b26"
|
resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz#714cb839f467d6a67b151ee8255886498e2b9bf6"
|
||||||
integrity sha512-Ora8JokrvrzEPEpZO18ZYXkH4asCdc1DLdcVy8TGf5eWtPO1Ie4WroEJzwI52ZGtpODy3+m0a2yEX9l+KUn0tA==
|
integrity sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==
|
||||||
|
|
||||||
"@esbuild/darwin-x64@0.19.2":
|
"@esbuild/darwin-x64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.2.tgz#982524af33a6424a3b5cb44bbd52559623ad719c"
|
resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz#2c553e97a6d2b4ae76a884e35e6cbab85a990bbf"
|
||||||
integrity sha512-tP+B5UuIbbFMj2hQaUr6EALlHOIOmlLM2FK7jeFBobPy2ERdohI4Ka6ZFjZ1ZYsrHE/hZimGuU90jusRE0pwDw==
|
integrity sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==
|
||||||
|
|
||||||
"@esbuild/freebsd-arm64@0.19.2":
|
"@esbuild/freebsd-arm64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.2.tgz#8e478a0856645265fe79eac4b31b52193011ee06"
|
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz#d554f556718adb31917a0da24277bf84b6ee87f3"
|
||||||
integrity sha512-YbPY2kc0acfzL1VPVK6EnAlig4f+l8xmq36OZkU0jzBVHcOTyQDhnKQaLzZudNJQyymd9OqQezeaBgkTGdTGeQ==
|
integrity sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==
|
||||||
|
|
||||||
"@esbuild/freebsd-x64@0.19.2":
|
"@esbuild/freebsd-x64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.2.tgz#01b96604f2540db023c73809bb8ae6cd1692d6f3"
|
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz#288f7358a3bb15d99e73c65c9adaa3dabb497432"
|
||||||
integrity sha512-nSO5uZT2clM6hosjWHAsS15hLrwCvIWx+b2e3lZ3MwbYSaXwvfO528OF+dLjas1g3bZonciivI8qKR/Hm7IWGw==
|
integrity sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==
|
||||||
|
|
||||||
"@esbuild/linux-arm64@0.19.2":
|
"@esbuild/linux-arm64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.2.tgz#7e5d2c7864c5c83ec789b59c77cd9c20d2594916"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz#95933ae86325c93cb6b5e8333d22120ecfdc901b"
|
||||||
integrity sha512-ig2P7GeG//zWlU0AggA3pV1h5gdix0MA3wgB+NsnBXViwiGgY77fuN9Wr5uoCrs2YzaYfogXgsWZbm+HGr09xg==
|
integrity sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==
|
||||||
|
|
||||||
"@esbuild/linux-arm@0.19.2":
|
"@esbuild/linux-arm@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.2.tgz#c32ae97bc0246664a1cfbdb4a98e7b006d7db8ae"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz#0acef93aa3e0579e46d33b666627bddb06636664"
|
||||||
integrity sha512-Odalh8hICg7SOD7XCj0YLpYCEc+6mkoq63UnExDCiRA2wXEmGlK5JVrW50vZR9Qz4qkvqnHcpH+OFEggO3PgTg==
|
integrity sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==
|
||||||
|
|
||||||
"@esbuild/linux-ia32@0.19.2":
|
"@esbuild/linux-ia32@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.2.tgz#3fc4f0fa026057fe885e4a180b3956e704f1ceaa"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz#b6e5c9e80b42131cbd6b1ddaa48c92835f1ed67f"
|
||||||
integrity sha512-mLfp0ziRPOLSTek0Gd9T5B8AtzKAkoZE70fneiiyPlSnUKKI4lp+mGEnQXcQEHLJAcIYDPSyBvsUbKUG2ri/XQ==
|
integrity sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==
|
||||||
|
|
||||||
"@esbuild/linux-loong64@0.19.2":
|
"@esbuild/linux-loong64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.2.tgz#633bcaea443f3505fb0ed109ab840c99ad3451a4"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz#e5f0cf95a180158b01ff5f417da796a1c09dfbea"
|
||||||
integrity sha512-hn28+JNDTxxCpnYjdDYVMNTR3SKavyLlCHHkufHV91fkewpIyQchS1d8wSbmXhs1fiYDpNww8KTFlJ1dHsxeSw==
|
integrity sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==
|
||||||
|
|
||||||
"@esbuild/linux-mips64el@0.19.2":
|
"@esbuild/linux-mips64el@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.2.tgz#e0bff2898c46f52be7d4dbbcca8b887890805823"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz#ae36fb86c7d5f641f3a0c8472e83dcb6ea36a408"
|
||||||
integrity sha512-KbXaC0Sejt7vD2fEgPoIKb6nxkfYW9OmFUK9XQE4//PvGIxNIfPk1NmlHmMg6f25x57rpmEFrn1OotASYIAaTg==
|
integrity sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==
|
||||||
|
|
||||||
"@esbuild/linux-ppc64@0.19.2":
|
"@esbuild/linux-ppc64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.2.tgz#d75798da391f54a9674f8c143b9a52d1dbfbfdde"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz#7960cb1666f0340ddd9eef7b26dcea3835d472d0"
|
||||||
integrity sha512-dJ0kE8KTqbiHtA3Fc/zn7lCd7pqVr4JcT0JqOnbj4LLzYnp+7h8Qi4yjfq42ZlHfhOCM42rBh0EwHYLL6LEzcw==
|
integrity sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==
|
||||||
|
|
||||||
"@esbuild/linux-riscv64@0.19.2":
|
"@esbuild/linux-riscv64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.2.tgz#012409bd489ed1bb9b775541d4a46c5ded8e6dd8"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz#32207df26af60a3a9feea1783fc21b9817bade19"
|
||||||
integrity sha512-7Z/jKNFufZ/bbu4INqqCN6DDlrmOTmdw6D0gH+6Y7auok2r02Ur661qPuXidPOJ+FSgbEeQnnAGgsVynfLuOEw==
|
integrity sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==
|
||||||
|
|
||||||
"@esbuild/linux-s390x@0.19.2":
|
"@esbuild/linux-s390x@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.2.tgz#ece3ed75c5a150de8a5c110f02e97d315761626b"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz#b38d5681db89a3723862dfa792812397b1510a7d"
|
||||||
integrity sha512-U+RinR6aXXABFCcAY4gSlv4CL1oOVvSSCdseQmGO66H+XyuQGZIUdhG56SZaDJQcLmrSfRmx5XZOWyCJPRqS7g==
|
integrity sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==
|
||||||
|
|
||||||
"@esbuild/linux-x64@0.19.2":
|
"@esbuild/linux-x64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.2.tgz#dea187019741602d57aaf189a80abba261fbd2aa"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.5.tgz#46feba2ad041a241379d150f415b472fe3885075"
|
||||||
integrity sha512-oxzHTEv6VPm3XXNaHPyUTTte+3wGv7qVQtqaZCrgstI16gCuhNOtBXLEBkBREP57YTd68P0VgDgG73jSD8bwXQ==
|
integrity sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==
|
||||||
|
|
||||||
"@esbuild/netbsd-x64@0.19.2":
|
"@esbuild/netbsd-x64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.2.tgz#bbfd7cf9ab236a23ee3a41b26f0628c57623d92a"
|
resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz#3b5c1fb068f26bfc681d31f682adf1bea4ef0702"
|
||||||
integrity sha512-WNa5zZk1XpTTwMDompZmvQLHszDDDN7lYjEHCUmAGB83Bgs20EMs7ICD+oKeT6xt4phV4NDdSi/8OfjPbSbZfQ==
|
integrity sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==
|
||||||
|
|
||||||
"@esbuild/openbsd-x64@0.19.2":
|
"@esbuild/openbsd-x64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.2.tgz#fa5c4c6ee52a360618f00053652e2902e1d7b4a7"
|
resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz#ca6830316ca68056c5c88a875f103ad3235e00db"
|
||||||
integrity sha512-S6kI1aT3S++Dedb7vxIuUOb3oAxqxk2Rh5rOXOTYnzN8JzW1VzBd+IqPiSpgitu45042SYD3HCoEyhLKQcDFDw==
|
integrity sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==
|
||||||
|
|
||||||
"@esbuild/sunos-x64@0.19.2":
|
"@esbuild/sunos-x64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.2.tgz#52a2ac8ac6284c02d25df22bb4cfde26fbddd68d"
|
resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz#9efc4eb9539a7be7d5a05ada52ee43cda0d8e2dd"
|
||||||
integrity sha512-VXSSMsmb+Z8LbsQGcBMiM+fYObDNRm8p7tkUDMPG/g4fhFX5DEFmjxIEa3N8Zr96SjsJ1woAhF0DUnS3MF3ARw==
|
integrity sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==
|
||||||
|
|
||||||
"@esbuild/win32-arm64@0.19.2":
|
"@esbuild/win32-arm64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.2.tgz#719ed5870855de8537aef8149694a97d03486804"
|
resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz#29f8184afa7a02a956ebda4ed638099f4b8ff198"
|
||||||
integrity sha512-5NayUlSAyb5PQYFAU9x3bHdsqB88RC3aM9lKDAz4X1mo/EchMIT1Q+pSeBXNgkfNmRecLXA0O8xP+x8V+g/LKg==
|
integrity sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==
|
||||||
|
|
||||||
"@esbuild/win32-ia32@0.19.2":
|
"@esbuild/win32-ia32@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.2.tgz#24832223880b0f581962c8660f8fb8797a1e046a"
|
resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz#f3de07afb292ecad651ae4bb8727789de2d95b05"
|
||||||
integrity sha512-47gL/ek1v36iN0wL9L4Q2MFdujR0poLZMJwhO2/N3gA89jgHp4MR8DKCmwYtGNksbfJb9JoTtbkoe6sDhg2QTA==
|
integrity sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==
|
||||||
|
|
||||||
"@esbuild/win32-x64@0.19.2":
|
"@esbuild/win32-x64@0.19.5":
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.2.tgz#1205014625790c7ff0e471644a878a65d1e34ab0"
|
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz#faad84c41ba12e3a0acb52571df9bff37bee75f6"
|
||||||
integrity sha512-tcuhV7ncXBqbt/Ybf0IyrMcwVOAPDckMK9rXNHtF17UTK18OKLpg08glminN06pt2WCoALhXdLfSPbVvK/6fxw==
|
integrity sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==
|
||||||
|
|
||||||
"@eslint-community/eslint-utils@^4.4.0":
|
"@eslint-community/eslint-utils@^4.4.0":
|
||||||
version "4.4.0"
|
version "4.4.0"
|
||||||
@@ -120,9 +120,9 @@
|
|||||||
eslint-visitor-keys "^3.3.0"
|
eslint-visitor-keys "^3.3.0"
|
||||||
|
|
||||||
"@eslint-community/regexpp@^4.5.1":
|
"@eslint-community/regexpp@^4.5.1":
|
||||||
version "4.8.0"
|
version "4.10.0"
|
||||||
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.8.0.tgz#11195513186f68d42fbf449f9a7136b2c0c92005"
|
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63"
|
||||||
integrity sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==
|
integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==
|
||||||
|
|
||||||
"@nodelib/fs.scandir@2.1.5":
|
"@nodelib/fs.scandir@2.1.5":
|
||||||
version "2.1.5"
|
version "2.1.5"
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
"@types/node-fetch" "^2.5.10"
|
"@types/node-fetch" "^2.5.10"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
"@tryfabric/martian@^1.2.0":
|
"@tryfabric/martian@^1.2.4":
|
||||||
version "1.2.4"
|
version "1.2.4"
|
||||||
resolved "https://registry.yarnpkg.com/@tryfabric/martian/-/martian-1.2.4.tgz#3fdfe7129f1c28bccddc34854cf353b0f37c0c02"
|
resolved "https://registry.yarnpkg.com/@tryfabric/martian/-/martian-1.2.4.tgz#3fdfe7129f1c28bccddc34854cf353b0f37c0c02"
|
||||||
integrity sha512-g7SP7beaxrjxLnW//vskra07a1jsJowqp07KMouxh4gCwaF+ItHbRZN8O+1dhJivBi3VdasT71BPyk+8wzEreQ==
|
integrity sha512-g7SP7beaxrjxLnW//vskra07a1jsJowqp07KMouxh4gCwaF+ItHbRZN8O+1dhJivBi3VdasT71BPyk+8wzEreQ==
|
||||||
@@ -172,111 +172,113 @@
|
|||||||
"@types/tern" "*"
|
"@types/tern" "*"
|
||||||
|
|
||||||
"@types/debug@^4.0.0":
|
"@types/debug@^4.0.0":
|
||||||
version "4.1.9"
|
version "4.1.12"
|
||||||
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.9.tgz#906996938bc672aaf2fb8c0d3733ae1dda05b005"
|
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917"
|
||||||
integrity sha512-8Hz50m2eoS56ldRlepxSBa6PWEVCtzUo/92HgLc2qTMnotJNIm7xP+UZhyWoYsyOdd5dxZ+NZLb24rsKyFs2ow==
|
integrity sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/ms" "*"
|
"@types/ms" "*"
|
||||||
|
|
||||||
"@types/estree@*":
|
"@types/estree@*":
|
||||||
version "1.0.1"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194"
|
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4"
|
||||||
integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==
|
integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==
|
||||||
|
|
||||||
"@types/hast@^3.0.0":
|
"@types/hast@^3.0.0":
|
||||||
version "3.0.1"
|
version "3.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.1.tgz#e1705ec9258ac4885659c2d50bac06b4fcd16466"
|
resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.3.tgz#7f75e6b43bc3f90316046a287d9ad3888309f7e1"
|
||||||
integrity sha512-hs/iBJx2aydugBQx5ETV3ZgeSS0oIreQrFJ4bjBl0XvM4wAmDjFEALY7p0rTSLt2eL+ibjRAAs9dTPiCLtmbqQ==
|
integrity sha512-2fYGlaDy/qyLlhidX42wAH0KBi2TCjKMH8CHmBXgRlJ3Y+OXTiqsPQ6IWarZKwF1JoUcAJdPogv1d4b0COTpmQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/unist" "*"
|
"@types/unist" "*"
|
||||||
|
|
||||||
"@types/js-yaml@*":
|
"@types/js-yaml@*":
|
||||||
version "4.0.5"
|
version "4.0.9"
|
||||||
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.5.tgz#738dd390a6ecc5442f35e7f03fa1431353f7e138"
|
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.9.tgz#cd82382c4f902fed9691a2ed79ec68c5898af4c2"
|
||||||
integrity sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA==
|
integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==
|
||||||
|
|
||||||
"@types/json-schema@^7.0.12":
|
"@types/json-schema@^7.0.12":
|
||||||
version "7.0.12"
|
version "7.0.15"
|
||||||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb"
|
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
|
||||||
integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==
|
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
|
||||||
|
|
||||||
"@types/katex@^0.16.0":
|
"@types/katex@^0.16.0":
|
||||||
version "0.16.3"
|
version "0.16.6"
|
||||||
resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.16.3.tgz#a341c89705145b7dd8e2a133b282a133eabe6076"
|
resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.16.6.tgz#6dd82f78a1a1d2eceeff6bb97ba98d7c062454cb"
|
||||||
integrity sha512-CeVMX9EhVUW8MWnei05eIRks4D5Wscw/W9Byz1s3PA+yJvcdvq9SaDjiUKvRvEgjpdTyJMjQA43ae4KTwsvOPg==
|
integrity sha512-rZYO1HInM99rAFYNwGqbYPxHZHxu2IwZYKj4bJ4oh6edVrm1UId8mmbHIZLBtG253qU6y3piag0XYe/joNnwzQ==
|
||||||
|
|
||||||
"@types/mdast@^3.0.0":
|
"@types/mdast@^3.0.0":
|
||||||
version "3.0.12"
|
version "3.0.15"
|
||||||
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.12.tgz#beeb511b977c875a5b0cc92eab6fcac2f0895514"
|
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.15.tgz#49c524a263f30ffa28b71ae282f813ed000ab9f5"
|
||||||
integrity sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==
|
integrity sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/unist" "^2"
|
"@types/unist" "^2"
|
||||||
|
|
||||||
"@types/mdast@^4.0.0":
|
"@types/mdast@^4.0.0":
|
||||||
version "4.0.1"
|
version "4.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.1.tgz#9c45e60a04e79f160dcefe6545d28ae536a6ed22"
|
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.3.tgz#1e011ff013566e919a4232d1701ad30d70cab333"
|
||||||
integrity sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==
|
integrity sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/unist" "*"
|
"@types/unist" "*"
|
||||||
|
|
||||||
"@types/ms@*":
|
"@types/ms@*":
|
||||||
version "0.7.32"
|
version "0.7.34"
|
||||||
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.32.tgz#f6cd08939ae3ad886fcc92ef7f0109dacddf61ab"
|
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433"
|
||||||
integrity sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g==
|
integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==
|
||||||
|
|
||||||
"@types/node-fetch@^2.5.10":
|
"@types/node-fetch@^2.5.10":
|
||||||
version "2.6.4"
|
version "2.6.9"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660"
|
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.9.tgz#15f529d247f1ede1824f7e7acdaa192d5f28071e"
|
||||||
integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==
|
integrity sha512-bQVlnMLFJ2d35DkPNjEPmd9ueO/rh5EiaZt2bhqiSarPjZIuIV6bPQVqcrEyvNo+AfTrRGVazle1tl597w3gfA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
form-data "^3.0.0"
|
form-data "^4.0.0"
|
||||||
|
|
||||||
"@types/node@*", "@types/node@^20.5.7":
|
"@types/node@*", "@types/node@^20.5.7":
|
||||||
version "20.5.7"
|
version "20.9.0"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.7.tgz#4b8ecac87fbefbc92f431d09c30e176fc0a7c377"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.0.tgz#bfcdc230583aeb891cf51e73cfdaacdd8deae298"
|
||||||
integrity sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA==
|
integrity sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==
|
||||||
|
dependencies:
|
||||||
|
undici-types "~5.26.4"
|
||||||
|
|
||||||
"@types/semver@^7.5.0":
|
"@types/semver@^7.5.0":
|
||||||
version "7.5.1"
|
version "7.5.5"
|
||||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.1.tgz#0480eeb7221eb9bc398ad7432c9d7e14b1a5a367"
|
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.5.tgz#deed5ab7019756c9c90ea86139106b0346223f35"
|
||||||
integrity sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==
|
integrity sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==
|
||||||
|
|
||||||
"@types/tern@*":
|
"@types/tern@*":
|
||||||
version "0.23.4"
|
version "0.23.7"
|
||||||
resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.4.tgz#03926eb13dbeaf3ae0d390caf706b2643a0127fb"
|
resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.7.tgz#f3c27fb7d6db5e86d7f069e7d5124bfa677a5b2d"
|
||||||
integrity sha512-JAUw1iXGO1qaWwEOzxTKJZ/5JxVeON9kvGZ/osgZaJImBnyjyn0cjovPsf6FNLmyGY8Vw9DoXZCMlfMkMwHRWg==
|
integrity sha512-0YS9XCZ0LAhlP11HV9SqncUYyz9Ggsgc7Om/AmchKvoeFyj0qPaJmX6rJ93mJVExizWDzUMb49gAtVpI1uHd8Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/estree" "*"
|
"@types/estree" "*"
|
||||||
|
|
||||||
"@types/unist@*", "@types/unist@^3.0.0":
|
"@types/unist@*", "@types/unist@^3.0.0":
|
||||||
version "3.0.0"
|
version "3.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.0.tgz#988ae8af1e5239e89f9fbb1ade4c935f4eeedf9a"
|
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.2.tgz#6dd61e43ef60b34086287f83683a5c1b2dc53d20"
|
||||||
integrity sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==
|
integrity sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==
|
||||||
|
|
||||||
"@types/unist@^2", "@types/unist@^2.0.0", "@types/unist@^2.0.2":
|
"@types/unist@^2", "@types/unist@^2.0.0", "@types/unist@^2.0.2":
|
||||||
version "2.0.7"
|
version "2.0.10"
|
||||||
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.7.tgz#5b06ad6894b236a1d2bd6b2f07850ca5c59cf4d6"
|
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.10.tgz#04ffa7f406ab628f7f7e97ca23e290cd8ab15efc"
|
||||||
integrity sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==
|
integrity sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==
|
||||||
|
|
||||||
"@types/yaml-front-matter@^4.1.0":
|
"@types/yaml-front-matter@^4.1.3":
|
||||||
version "4.1.0"
|
version "4.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/@types/yaml-front-matter/-/yaml-front-matter-4.1.0.tgz#324404e069353972286bf60117f8b404b7cb0220"
|
resolved "https://registry.yarnpkg.com/@types/yaml-front-matter/-/yaml-front-matter-4.1.3.tgz#76478882b5ee3e892dd2ee2af86a6dd8c089ce4d"
|
||||||
integrity sha512-d4YGe2onl1T4VA6QhT4agdxaStOBe/ig9RAFAT1OltytvO2z9Ro69DiwHD2FUwewcjeD9PWEfUeZhw7E9hApcQ==
|
integrity sha512-XDsnZdIZ8QGRFzfRTCSxjbm0NGQQfFPxk2zqy0DB4SH2TXJVptzdY+IgDNM1K2ZIjFvFaHo2l5wJd71JzMeI9A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/js-yaml" "*"
|
"@types/js-yaml" "*"
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
"@typescript-eslint/eslint-plugin@^6.5.0":
|
"@typescript-eslint/eslint-plugin@^6.11.0":
|
||||||
version "6.5.0"
|
version "6.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.5.0.tgz#5cee33edf0d45d5ec773e3b3111206b098ac8599"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.11.0.tgz#52aae65174ff526576351f9ccd41cea01001463f"
|
||||||
integrity sha512-2pktILyjvMaScU6iK3925uvGU87E+N9rh372uGZgiMYwafaw9SXq86U04XPq3UH6tzRvNgBsub6x2DacHc33lw==
|
integrity sha512-uXnpZDc4VRjY4iuypDBKzW1rz9T5YBBK0snMn8MaTSNd2kMlj50LnLBABELjJiOL5YHk7ZD8hbSpI9ubzqYI0w==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@eslint-community/regexpp" "^4.5.1"
|
"@eslint-community/regexpp" "^4.5.1"
|
||||||
"@typescript-eslint/scope-manager" "6.5.0"
|
"@typescript-eslint/scope-manager" "6.11.0"
|
||||||
"@typescript-eslint/type-utils" "6.5.0"
|
"@typescript-eslint/type-utils" "6.11.0"
|
||||||
"@typescript-eslint/utils" "6.5.0"
|
"@typescript-eslint/utils" "6.11.0"
|
||||||
"@typescript-eslint/visitor-keys" "6.5.0"
|
"@typescript-eslint/visitor-keys" "6.11.0"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
graphemer "^1.4.0"
|
graphemer "^1.4.0"
|
||||||
ignore "^5.2.4"
|
ignore "^5.2.4"
|
||||||
@@ -284,72 +286,72 @@
|
|||||||
semver "^7.5.4"
|
semver "^7.5.4"
|
||||||
ts-api-utils "^1.0.1"
|
ts-api-utils "^1.0.1"
|
||||||
|
|
||||||
"@typescript-eslint/parser@^6.5.0":
|
"@typescript-eslint/parser@^6.11.0":
|
||||||
version "6.5.0"
|
version "6.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.5.0.tgz#3d6ed231c5e307c5f5f4a0d86893ec01e92b8c77"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.11.0.tgz#9640d9595d905f3be4f278bf515130e6129b202e"
|
||||||
integrity sha512-LMAVtR5GN8nY0G0BadkG0XIe4AcNMeyEy3DyhKGAh9k4pLSMBO7rF29JvDBpZGCmp5Pgz5RLHP6eCpSYZJQDuQ==
|
integrity sha512-+whEdjk+d5do5nxfxx73oanLL9ghKO3EwM9kBCkUtWMRwWuPaFv9ScuqlYfQ6pAD6ZiJhky7TZ2ZYhrMsfMxVQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/scope-manager" "6.5.0"
|
"@typescript-eslint/scope-manager" "6.11.0"
|
||||||
"@typescript-eslint/types" "6.5.0"
|
"@typescript-eslint/types" "6.11.0"
|
||||||
"@typescript-eslint/typescript-estree" "6.5.0"
|
"@typescript-eslint/typescript-estree" "6.11.0"
|
||||||
"@typescript-eslint/visitor-keys" "6.5.0"
|
"@typescript-eslint/visitor-keys" "6.11.0"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
|
|
||||||
"@typescript-eslint/scope-manager@6.5.0":
|
"@typescript-eslint/scope-manager@6.11.0":
|
||||||
version "6.5.0"
|
version "6.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.5.0.tgz#f2cb20895aaad41b3ad27cc3a338ce8598f261c5"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.11.0.tgz#621f603537c89f4d105733d949aa4d55eee5cea8"
|
||||||
integrity sha512-A8hZ7OlxURricpycp5kdPTH3XnjG85UpJS6Fn4VzeoH4T388gQJ/PGP4ole5NfKt4WDVhmLaQ/dBLNDC4Xl/Kw==
|
integrity sha512-0A8KoVvIURG4uhxAdjSaxy8RdRE//HztaZdG8KiHLP8WOXSk0vlF7Pvogv+vlJA5Rnjj/wDcFENvDaHb+gKd1A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types" "6.5.0"
|
"@typescript-eslint/types" "6.11.0"
|
||||||
"@typescript-eslint/visitor-keys" "6.5.0"
|
"@typescript-eslint/visitor-keys" "6.11.0"
|
||||||
|
|
||||||
"@typescript-eslint/type-utils@6.5.0":
|
"@typescript-eslint/type-utils@6.11.0":
|
||||||
version "6.5.0"
|
version "6.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.5.0.tgz#6d246c93739282bc0d2e623f28d0dec6cfcc38d7"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.11.0.tgz#d0b8b1ab6c26b974dbf91de1ebc5b11fea24e0d1"
|
||||||
integrity sha512-f7OcZOkRivtujIBQ4yrJNIuwyCQO1OjocVqntl9dgSIZAdKqicj3xFDqDOzHDlGCZX990LqhLQXWRnQvsapq8A==
|
integrity sha512-nA4IOXwZtqBjIoYrJcYxLRO+F9ri+leVGoJcMW1uqr4r1Hq7vW5cyWrA43lFbpRvQ9XgNrnfLpIkO3i1emDBIA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/typescript-estree" "6.5.0"
|
"@typescript-eslint/typescript-estree" "6.11.0"
|
||||||
"@typescript-eslint/utils" "6.5.0"
|
"@typescript-eslint/utils" "6.11.0"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
ts-api-utils "^1.0.1"
|
ts-api-utils "^1.0.1"
|
||||||
|
|
||||||
"@typescript-eslint/types@6.5.0":
|
"@typescript-eslint/types@6.11.0":
|
||||||
version "6.5.0"
|
version "6.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.5.0.tgz#f4e55cfd99ac5346ea772770bf212a3e689a8f04"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.11.0.tgz#8ad3aa000cbf4bdc4dcceed96e9b577f15e0bf53"
|
||||||
integrity sha512-eqLLOEF5/lU8jW3Bw+8auf4lZSbbljHR2saKnYqON12G/WsJrGeeDHWuQePoEf9ro22+JkbPfWQwKEC5WwLQ3w==
|
integrity sha512-ZbEzuD4DwEJxwPqhv3QULlRj8KYTAnNsXxmfuUXFCxZmO6CF2gM/y+ugBSAQhrqaJL3M+oe4owdWunaHM6beqA==
|
||||||
|
|
||||||
"@typescript-eslint/typescript-estree@6.5.0":
|
"@typescript-eslint/typescript-estree@6.11.0":
|
||||||
version "6.5.0"
|
version "6.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.5.0.tgz#1cef6bc822585e9ef89d88834bc902d911d747ed"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.11.0.tgz#7b52c12a623bf7f8ec7f8a79901b9f98eb5c7990"
|
||||||
integrity sha512-q0rGwSe9e5Kk/XzliB9h2LBc9tmXX25G0833r7kffbl5437FPWb2tbpIV9wAATebC/018pGa9fwPDuvGN+LxWQ==
|
integrity sha512-Aezzv1o2tWJwvZhedzvD5Yv7+Lpu1by/U1LZ5gLc4tCx8jUmuSCMioPFRjliN/6SJIvY6HpTtJIWubKuYYYesQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types" "6.5.0"
|
"@typescript-eslint/types" "6.11.0"
|
||||||
"@typescript-eslint/visitor-keys" "6.5.0"
|
"@typescript-eslint/visitor-keys" "6.11.0"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
globby "^11.1.0"
|
globby "^11.1.0"
|
||||||
is-glob "^4.0.3"
|
is-glob "^4.0.3"
|
||||||
semver "^7.5.4"
|
semver "^7.5.4"
|
||||||
ts-api-utils "^1.0.1"
|
ts-api-utils "^1.0.1"
|
||||||
|
|
||||||
"@typescript-eslint/utils@6.5.0":
|
"@typescript-eslint/utils@6.11.0":
|
||||||
version "6.5.0"
|
version "6.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.5.0.tgz#6668bee4f7f24978b11df8a2ea42d56eebc4662c"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.11.0.tgz#11374f59ef4cea50857b1303477c08aafa2ca604"
|
||||||
integrity sha512-9nqtjkNykFzeVtt9Pj6lyR9WEdd8npPhhIPM992FWVkZuS6tmxHfGVnlUcjpUP2hv8r4w35nT33mlxd+Be1ACQ==
|
integrity sha512-p23ibf68fxoZy605dc0dQAEoUsoiNoP3MD9WQGiHLDuTSOuqoTsa4oAy+h3KDkTcxbbfOtUjb9h3Ta0gT4ug2g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@eslint-community/eslint-utils" "^4.4.0"
|
"@eslint-community/eslint-utils" "^4.4.0"
|
||||||
"@types/json-schema" "^7.0.12"
|
"@types/json-schema" "^7.0.12"
|
||||||
"@types/semver" "^7.5.0"
|
"@types/semver" "^7.5.0"
|
||||||
"@typescript-eslint/scope-manager" "6.5.0"
|
"@typescript-eslint/scope-manager" "6.11.0"
|
||||||
"@typescript-eslint/types" "6.5.0"
|
"@typescript-eslint/types" "6.11.0"
|
||||||
"@typescript-eslint/typescript-estree" "6.5.0"
|
"@typescript-eslint/typescript-estree" "6.11.0"
|
||||||
semver "^7.5.4"
|
semver "^7.5.4"
|
||||||
|
|
||||||
"@typescript-eslint/visitor-keys@6.5.0":
|
"@typescript-eslint/visitor-keys@6.11.0":
|
||||||
version "6.5.0"
|
version "6.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.5.0.tgz#1a6f474a0170a447b76f0699ce6700110fd11436"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.11.0.tgz#d991538788923f92ec40d44389e7075b359f3458"
|
||||||
integrity sha512-yCB/2wkbv3hPsh02ZS8dFQnij9VVQXJMN/gbQsaaY+zxALkZnxa/wagvLEFsAWMPv7d7lxQmNsIzGU1w/T/WyA==
|
integrity sha512-+SUN/W7WjBr05uRxPggJPSzyB8zUpaYo2hByKasWbqr3PM8AXfZt8UHdNpBS1v9SA62qnSSMF3380SwDqqprgQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types" "6.5.0"
|
"@typescript-eslint/types" "6.11.0"
|
||||||
eslint-visitor-keys "^3.4.1"
|
eslint-visitor-keys "^3.4.1"
|
||||||
|
|
||||||
agent-base@^7.0.2:
|
agent-base@^7.0.2:
|
||||||
@@ -483,33 +485,33 @@ dir-glob@^3.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
path-type "^4.0.0"
|
path-type "^4.0.0"
|
||||||
|
|
||||||
esbuild@0.19.2:
|
esbuild@0.19.5:
|
||||||
version "0.19.2"
|
version "0.19.5"
|
||||||
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.2.tgz#b1541828a89dfb6f840d38538767c6130dca2aac"
|
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.5.tgz#53a0e19dfbf61ba6c827d51a80813cf071239a8c"
|
||||||
integrity sha512-G6hPax8UbFakEj3hWO0Vs52LQ8k3lnBhxZWomUJDxfz3rZTLqF5k/FCzuNdLx2RbpBiQQF9H9onlDDH1lZsnjg==
|
integrity sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
"@esbuild/android-arm" "0.19.2"
|
"@esbuild/android-arm" "0.19.5"
|
||||||
"@esbuild/android-arm64" "0.19.2"
|
"@esbuild/android-arm64" "0.19.5"
|
||||||
"@esbuild/android-x64" "0.19.2"
|
"@esbuild/android-x64" "0.19.5"
|
||||||
"@esbuild/darwin-arm64" "0.19.2"
|
"@esbuild/darwin-arm64" "0.19.5"
|
||||||
"@esbuild/darwin-x64" "0.19.2"
|
"@esbuild/darwin-x64" "0.19.5"
|
||||||
"@esbuild/freebsd-arm64" "0.19.2"
|
"@esbuild/freebsd-arm64" "0.19.5"
|
||||||
"@esbuild/freebsd-x64" "0.19.2"
|
"@esbuild/freebsd-x64" "0.19.5"
|
||||||
"@esbuild/linux-arm" "0.19.2"
|
"@esbuild/linux-arm" "0.19.5"
|
||||||
"@esbuild/linux-arm64" "0.19.2"
|
"@esbuild/linux-arm64" "0.19.5"
|
||||||
"@esbuild/linux-ia32" "0.19.2"
|
"@esbuild/linux-ia32" "0.19.5"
|
||||||
"@esbuild/linux-loong64" "0.19.2"
|
"@esbuild/linux-loong64" "0.19.5"
|
||||||
"@esbuild/linux-mips64el" "0.19.2"
|
"@esbuild/linux-mips64el" "0.19.5"
|
||||||
"@esbuild/linux-ppc64" "0.19.2"
|
"@esbuild/linux-ppc64" "0.19.5"
|
||||||
"@esbuild/linux-riscv64" "0.19.2"
|
"@esbuild/linux-riscv64" "0.19.5"
|
||||||
"@esbuild/linux-s390x" "0.19.2"
|
"@esbuild/linux-s390x" "0.19.5"
|
||||||
"@esbuild/linux-x64" "0.19.2"
|
"@esbuild/linux-x64" "0.19.5"
|
||||||
"@esbuild/netbsd-x64" "0.19.2"
|
"@esbuild/netbsd-x64" "0.19.5"
|
||||||
"@esbuild/openbsd-x64" "0.19.2"
|
"@esbuild/openbsd-x64" "0.19.5"
|
||||||
"@esbuild/sunos-x64" "0.19.2"
|
"@esbuild/sunos-x64" "0.19.5"
|
||||||
"@esbuild/win32-arm64" "0.19.2"
|
"@esbuild/win32-arm64" "0.19.5"
|
||||||
"@esbuild/win32-ia32" "0.19.2"
|
"@esbuild/win32-ia32" "0.19.5"
|
||||||
"@esbuild/win32-x64" "0.19.2"
|
"@esbuild/win32-x64" "0.19.5"
|
||||||
|
|
||||||
escape-string-regexp@^4.0.0:
|
escape-string-regexp@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
@@ -532,9 +534,9 @@ extend@^3.0.0:
|
|||||||
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
|
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
|
||||||
|
|
||||||
fast-glob@^3.2.9:
|
fast-glob@^3.2.9:
|
||||||
version "3.3.1"
|
version "3.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4"
|
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129"
|
||||||
integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==
|
integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@nodelib/fs.stat" "^2.0.2"
|
"@nodelib/fs.stat" "^2.0.2"
|
||||||
"@nodelib/fs.walk" "^1.2.3"
|
"@nodelib/fs.walk" "^1.2.3"
|
||||||
@@ -556,10 +558,10 @@ fill-range@^7.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
to-regex-range "^5.0.1"
|
to-regex-range "^5.0.1"
|
||||||
|
|
||||||
form-data@^3.0.0:
|
form-data@^4.0.0:
|
||||||
version "3.0.1"
|
version "4.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f"
|
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
|
||||||
integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==
|
integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
|
||||||
dependencies:
|
dependencies:
|
||||||
asynckit "^0.4.0"
|
asynckit "^0.4.0"
|
||||||
combined-stream "^1.0.8"
|
combined-stream "^1.0.8"
|
||||||
@@ -589,18 +591,18 @@ graphemer@^1.4.0:
|
|||||||
resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6"
|
resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6"
|
||||||
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
|
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
|
||||||
|
|
||||||
https-proxy-agent@^7.0.1:
|
https-proxy-agent@^7.0.2:
|
||||||
version "7.0.1"
|
version "7.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.1.tgz#0277e28f13a07d45c663633841e20a40aaafe0ab"
|
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz#e2645b846b90e96c6e6f347fb5b2e41f1590b09b"
|
||||||
integrity sha512-Eun8zV0kcYS1g19r78osiQLEFIRspRUDd9tIfBCTBPBeMieF/EsJNL8VI3xOIdYRDEkjQnqOYPsZ2DsWsVsFwQ==
|
integrity sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==
|
||||||
dependencies:
|
dependencies:
|
||||||
agent-base "^7.0.2"
|
agent-base "^7.0.2"
|
||||||
debug "4"
|
debug "4"
|
||||||
|
|
||||||
ignore@^5.2.0, ignore@^5.2.4:
|
ignore@^5.2.0, ignore@^5.2.4:
|
||||||
version "5.2.4"
|
version "5.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
|
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78"
|
||||||
integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==
|
integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==
|
||||||
|
|
||||||
is-alphabetical@^1.0.0:
|
is-alphabetical@^1.0.0:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
@@ -1024,9 +1026,9 @@ micromark-util-combine-extensions@^2.0.0:
|
|||||||
micromark-util-types "^2.0.0"
|
micromark-util-types "^2.0.0"
|
||||||
|
|
||||||
micromark-util-decode-numeric-character-reference@^2.0.0:
|
micromark-util-decode-numeric-character-reference@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.0.tgz#a798808d02cc74113e2c939fc95363096ade7f1d"
|
resolved "https://registry.yarnpkg.com/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz#2698bbb38f2a9ba6310e359f99fcb2b35a0d2bd5"
|
||||||
integrity sha512-pIgcsGxpHEtTG/rPJRz/HOLSqp5VTuIIjXlPI+6JSDlK2oljApusG6KzpS8AF0ENUMCHlC/IBb5B9xdFiVlm5Q==
|
integrity sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
micromark-util-symbol "^2.0.0"
|
micromark-util-symbol "^2.0.0"
|
||||||
|
|
||||||
@@ -1167,9 +1169,9 @@ node-fetch@^2.6.1:
|
|||||||
whatwg-url "^5.0.0"
|
whatwg-url "^5.0.0"
|
||||||
|
|
||||||
obsidian@latest:
|
obsidian@latest:
|
||||||
version "1.4.4"
|
version "1.4.11"
|
||||||
resolved "https://registry.yarnpkg.com/obsidian/-/obsidian-1.4.4.tgz#b987be40f6e33843b773e4248931139c3d55e1db"
|
resolved "https://registry.yarnpkg.com/obsidian/-/obsidian-1.4.11.tgz#5cba594c83a74ebad58b630c610265018abdadaa"
|
||||||
integrity sha512-q2V5GNT/M40uYOENdVw5kovPSoaO6vppiiyBCkIqWgKp4oN654jA/GQ0OaNBA7p5NdfS245QCeRgCFQ42wOZiw==
|
integrity sha512-BCVYTvaXxElJMl6MMbDdY/CGK+aq18SdtDY/7vH8v6BxCBQ6KF4kKxL0vG9UZ0o5qh139KpUoJHNm+6O5dllKA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/codemirror" "5.60.8"
|
"@types/codemirror" "5.60.8"
|
||||||
moment "2.29.4"
|
moment "2.29.4"
|
||||||
@@ -1296,9 +1298,9 @@ trough@^2.0.0:
|
|||||||
integrity sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==
|
integrity sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==
|
||||||
|
|
||||||
ts-api-utils@^1.0.1:
|
ts-api-utils@^1.0.1:
|
||||||
version "1.0.2"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.2.tgz#7c094f753b6705ee4faee25c3c684ade52d66d99"
|
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331"
|
||||||
integrity sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==
|
integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==
|
||||||
|
|
||||||
tslib@2.6.2:
|
tslib@2.6.2:
|
||||||
version "2.6.2"
|
version "2.6.2"
|
||||||
@@ -1310,10 +1312,15 @@ typescript@5.2.2:
|
|||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
|
||||||
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==
|
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==
|
||||||
|
|
||||||
|
undici-types@~5.26.4:
|
||||||
|
version "5.26.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
|
||||||
|
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
|
||||||
|
|
||||||
unified@^11.0.0:
|
unified@^11.0.0:
|
||||||
version "11.0.3"
|
version "11.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.3.tgz#e141be0fe466a2d28b2160f62712bc9cbc08fdd4"
|
resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.4.tgz#f4be0ac0fe4c88cb873687c07c64c49ed5969015"
|
||||||
integrity sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==
|
integrity sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/unist" "^3.0.0"
|
"@types/unist" "^3.0.0"
|
||||||
bail "^2.0.0"
|
bail "^2.0.0"
|
||||||
@@ -1455,10 +1462,10 @@ yaml-front-matter@^4.1.1:
|
|||||||
commander "^6.2.0"
|
commander "^6.2.0"
|
||||||
js-yaml "^3.14.1"
|
js-yaml "^3.14.1"
|
||||||
|
|
||||||
yaml@^2.2.2:
|
yaml@^2.3.4:
|
||||||
version "2.3.2"
|
version "2.3.4"
|
||||||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.2.tgz#f522db4313c671a0ca963a75670f1c12ea909144"
|
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2"
|
||||||
integrity sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==
|
integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==
|
||||||
|
|
||||||
zwitch@^1.0.0:
|
zwitch@^1.0.0:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
|
|||||||
Reference in New Issue
Block a user