Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-11-14 12:09:43 +08:00
commit 092c58f629
15 changed files with 304 additions and 110 deletions

View file

@ -1,4 +1,6 @@
{
"freezeCol": "Freeze column",
"unfreezeCol": "Unfreeze column",
"snippetsTip": "The code snippet has been updated, do you want to save it?",
"addBelowAbove": "Click to add below<br>⌥Click to add above",
"imported": "Import completed",

View file

@ -1,4 +1,6 @@
{
"freezeCol": "Congelar columna",
"unfreezeCol": "Descongelar columna",
"snippetsTip": "El fragmento de código ha sido actualizado, ¿quieres guardarlo?",
"addBelowAbove": "Haga clic para agregar abajo<br>⌥Clic para agregar arriba",
"imported": "Importación completada",

View file

@ -1,4 +1,6 @@
{
"freezeCol": "Geler la colonne",
"unfreezeCol": "Dégeler la colonne",
"snippetsTip": "L'extrait de code a été mis à jour, voulez-vous le sauvegarder ?",
"addBelowAbove": "Cliquez pour ajouter ci-dessous<br>⌥Cliquez pour ajouter ci-dessus",
"imported": "Importation terminée",

View file

@ -1,4 +1,6 @@
{
"freezeCol": "固定列",
"unfreezeCol": "取消列固定",
"snippetsTip": "程式碼片段已更新,是否儲存?",
"addBelowAbove": "Click 在下方新增<br>⌥Click 在上方新增",
"imported": "導入完成",

View file

@ -0,0 +1,57 @@
## Overview
This version fixes a bug in data synchronization where local files are accidentally deleted. It is recommended to upgrade as soon as possible.
Advertisement: Currently, `PRO Features` are in the early bird price stage, welcome to [learn more](https://b3log.org/siyuan/en/pricing.html).
Note: The annual `Subscription` includes `Pro features`. If you are an annual subscriber, you do not need to buy PRO Features separately.
## Changelogs
Below are the detailed changes in this version.
### Enhancement
* [Supports `⌃⌥⇧⌘`, `⌃⌥⌘`, `⌃⇧⌘` hotkeys on macOS](https://github.com/siyuan-note/siyuan/issues/9220)
* [PDF text layer misalignment](https://github.com/siyuan-note/siyuan/issues/9600)
* [Confirm whether to save after closing the code snippet](https://github.com/siyuan-note/siyuan/issues/9604)
* [If the data repo indexing time is greater than 7s, prompt user to purge the data repo](https://github.com/siyuan-note/siyuan/issues/9613)
* [Copy one cell from Excel/HTML table and paste it using the cell's content](https://github.com/siyuan-note/siyuan/issues/9614)
* [Automatically selects the first item after searching in the command panel](https://github.com/siyuan-note/siyuan/issues/9616)
* [Automatically check and eliminate duplicate reference relationship indexes](https://github.com/siyuan-note/siyuan/issues/9618)
* [Supports via environment var `SIYUAN_TESSERACT_ENABLED=false` to close OCR](https://github.com/siyuan-note/siyuan/issues/9619)
* [Show card NextDue to the flashcard management UI](https://github.com/siyuan-note/siyuan/pull/9621)
* [Do not use ligature in input/textarea](https://github.com/siyuan-note/siyuan/issues/9623)
* [Improve S3/WebDAV data sync error message](https://github.com/siyuan-note/siyuan/issues/9626)
* [Improve localhost address validation](https://github.com/siyuan-note/siyuan/pull/9634)
* [`Ctrl+End` Jump to the last character of the last block](https://github.com/siyuan-note/siyuan/issues/9642)
* [Improve checking out files order of data sync](https://github.com/siyuan-note/siyuan/issues/9646)
* [Automatically create notebook conf.json if not found it](https://github.com/siyuan-note/siyuan/issues/9647)
### Bugfix
* [The authentication page after startup Alt+M fails](https://github.com/siyuan-note/siyuan/issues/9575)
* [The referenced block under the folded heading cannot be hovered to view](https://github.com/siyuan-note/siyuan/issues/9582)
* [Editor missing after close all tabs when has pin tabs](https://github.com/siyuan-note/siyuan/issues/9624)
* [Data synchronization accidentally deletes local files](https://github.com/siyuan-note/siyuan/issues/9631)
* [The window title is hidden after the graph is minimized](https://github.com/siyuan-note/siyuan/issues/9638)
### Document
* [Docker containers run in the background](https://github.com/siyuan-note/siyuan/pull/9602)
### Refactor
* [Upgrade Electron](https://github.com/siyuan-note/siyuan/issues/9611)
### Development
* [Improve adaptive width for `Attributes View`](https://github.com/siyuan-note/siyuan/pull/9280)
* [Adding row overwriting data after enabling sort in database](https://github.com/siyuan-note/siyuan/issues/9599)
* [Database table view date column filter time zone adjustment](https://github.com/siyuan-note/siyuan/issues/9610)
* [Database table view supports pin/unpin column](https://github.com/siyuan-note/siyuan/pull/9617)
* [Improve database table view in super block](https://github.com/siyuan-note/siyuan/issues/9620)
* [Click on the blank area of the link column cannot be edited](https://github.com/siyuan-note/siyuan/issues/9632)
* [`resize` cannot be triggered after dragging to unpin the dock](https://github.com/siyuan-note/siyuan/issues/9640)
* [Add licenses for the template, widget, theme and icon samples](https://github.com/siyuan-note/siyuan/issues/9641)
* [Kernel API `createDocWithMd` supports concurrent calls](https://github.com/siyuan-note/siyuan/issues/9644)

View file

@ -0,0 +1,57 @@
## 概述
此版本修復了一個資料同步誤刪本地檔案的缺陷,建議盡快升級。
廣告: 目前 `功能特性` 正處於早鳥價階段,歡迎[了解](https://b3log.org/siyuan/pricing.html)。
註:`年付訂閱` 包含 `功能特性`,如果你是訂閱會員,則無需單獨購買功能特性。
## 變更記錄
以下是此版本中的詳細變更。
### 改進功能
* [macOS 桌面端支援 `⌃⌥⇧⌘`, `⌃⌥⌘`, `⌃⇧⌘` 快捷鍵](https://github.com/siyuan-note/siyuan/issues/9220)
* [PDF 文字圖層未對齊](https://github.com/siyuan-note/siyuan/issues/9600)
* [關閉程式碼片段編輯時確認是否已儲存](https://github.com/siyuan-note/siyuan/issues/9604)
* [資料同步時如果資料倉儲索引時間超過 7 秒則提示使用者清理資料倉儲](https://github.com/siyuan-note/siyuan/issues/9613)
* [從 Excel/HTML 複製一個表格單元格後貼上僅貼上其單元格內容](https://github.com/siyuan-note/siyuan/issues/9614)
* [指令面板中搜尋後自動選擇第一個結果項目](https://github.com/siyuan-note/siyuan/issues/9616)
* [自動檢查並刪除重複的引用關係索引](https://github.com/siyuan-note/siyuan/issues/9618)
* [支援透過環境變數 `SIYUAN_TESSERACT_ENABLED=false` 關閉 OCR](https://github.com/siyuan-note/siyuan/issues/9619)
* [在閃卡管理介面中顯示下次複習日期](https://github.com/siyuan-note/siyuan/pull/9621)
* [在編輯輸入框中不再使用連字號](https://github.com/siyuan-note/siyuan/issues/9623)
* [改進 S3/WebDAV 資料同步錯誤提示文案](https://github.com/siyuan-note/siyuan/issues/9626)
* [改進本地網路位址校驗](https://github.com/siyuan-note/siyuan/pull/9634)
* [`Ctrl+End` 跳到最後一個區塊的最後一個字元](https://github.com/siyuan-note/siyuan/issues/9642)
* [改進資料同步時遷出檔案的順序](https://github.com/siyuan-note/siyuan/issues/9646)
* [自動建立筆記本缺少的設定檔](https://github.com/siyuan-note/siyuan/issues/9647)
### 修復缺陷
* [啟動後辨識頁無法使用 Alt+M 最小化](https://github.com/siyuan-note/siyuan/issues/9575)
* [無法懸浮預覽折疊標題下方的被引用塊](https://github.com/siyuan-note/siyuan/issues/9582)
* [存在固定頁籤時關閉所有頁籤導致編輯器異常](https://github.com/siyuan-note/siyuan/issues/9624)
* [資料同步誤刪本機檔案](https://github.com/siyuan-note/siyuan/issues/9631)
* [關係圖最小化後視窗標題被隱藏](https://github.com/siyuan-note/siyuan/issues/9638)
### 改進文檔
* [Docker 容器在背景運作](https://github.com/siyuan-note/siyuan/pull/9602)
### 開發重構
* [升級 Electron](https://github.com/siyuan-note/siyuan/issues/9611)
### 開發者
* [改進資料庫表格視圖自適應寬度](https://github.com/siyuan-note/siyuan/pull/9280)
* [資料庫表格檢視啟用排序後新增行覆蓋資料](https://github.com/siyuan-note/siyuan/issues/9599)
* [資料庫表格檢視日期列時區調整](https://github.com/siyuan-note/siyuan/issues/9610)
* [資料庫表格視圖支援固定列](https://github.com/siyuan-note/siyuan/pull/9617)
* [改進超級區塊下的資料庫表格檢視](https://github.com/siyuan-note/siyuan/issues/9620)
* [資料庫表格視圖超連結列空白處無法點選編輯](https://github.com/siyuan-note/siyuan/issues/9632)
* [未固定的停靠面板拖曳寬度時未觸發 `resize`](https://github.com/siyuan-note/siyuan/issues/9640)
* [為範本、掛件、主題和圖示範例庫新增開源許可證](https://github.com/siyuan-note/siyuan/issues/9641)
* [核心 API `createDocWithMd` 支援並發呼叫](https://github.com/siyuan-note/siyuan/issues/9644)

View file

@ -0,0 +1,57 @@
## 概述
该版本修复了一个数据同步误删本地文件的缺陷,建议尽快升级。
广告: 目前 `功能特性` 正处于早鸟价阶段,欢迎[了解](https://b3log.org/siyuan/pricing.html)。
注:`年付订阅` 包含 `功能特性`,如果你是订阅会员,则无需单独购买功能特性。
## 变更记录
以下是此版本中的详细变更。
### 改进功能
* [macOS 桌面端支持 `⌃⌥⇧⌘`, `⌃⌥⌘`, `⌃⇧⌘` 快捷键](https://github.com/siyuan-note/siyuan/issues/9220)
* [PDF 文本层未对齐](https://github.com/siyuan-note/siyuan/issues/9600)
* [关闭代码片段编辑时确认是否保存](https://github.com/siyuan-note/siyuan/issues/9604)
* [数据同步时如果数据仓库索引时间超过 7 秒则提示用户清理数据仓库](https://github.com/siyuan-note/siyuan/issues/9613)
* [从 Excel/HTML 复制一个表格单元格后粘贴仅粘贴其单元格内容](https://github.com/siyuan-note/siyuan/issues/9614)
* [命令面板中搜索后自动选择第一个结果项](https://github.com/siyuan-note/siyuan/issues/9616)
* [自动检查并删除重复的引用关系索引](https://github.com/siyuan-note/siyuan/issues/9618)
* [支持通过环境变量 `SIYUAN_TESSERACT_ENABLED=false` 关闭 OCR](https://github.com/siyuan-note/siyuan/issues/9619)
* [在闪卡管理界面中显示下次复习日期](https://github.com/siyuan-note/siyuan/pull/9621)
* [在编辑输入框中不再使用连字符](https://github.com/siyuan-note/siyuan/issues/9623)
* [改进 S3/WebDAV 数据同步错误提示文案](https://github.com/siyuan-note/siyuan/issues/9626)
* [改进本地网络地址校验](https://github.com/siyuan-note/siyuan/pull/9634)
* [`Ctrl+End` 跳转到最后一个块的最后一个字符](https://github.com/siyuan-note/siyuan/issues/9642)
* [改进数据同步时迁出文件的顺序](https://github.com/siyuan-note/siyuan/issues/9646)
* [自动创建笔记本缺失的配置文件](https://github.com/siyuan-note/siyuan/issues/9647)
### 修复缺陷
* [启动后鉴权页无法使用 Alt+M 最小化](https://github.com/siyuan-note/siyuan/issues/9575)
* [无法悬浮预览折叠标题下方的被引用块](https://github.com/siyuan-note/siyuan/issues/9582)
* [存在固定页签时关闭所有页签导致编辑器异常](https://github.com/siyuan-note/siyuan/issues/9624)
* [数据同步误删本地文件](https://github.com/siyuan-note/siyuan/issues/9631)
* [关系图最小化后窗口标题被隐藏](https://github.com/siyuan-note/siyuan/issues/9638)
### 改进文档
* [Docker 容器在后台运行](https://github.com/siyuan-note/siyuan/pull/9602)
### 开发重构
* [升级 Electron](https://github.com/siyuan-note/siyuan/issues/9611)
### 开发者
* [改进数据库表格视图自适应宽度](https://github.com/siyuan-note/siyuan/pull/9280)
* [数据库表格视图启用排序后添加行覆盖数据](https://github.com/siyuan-note/siyuan/issues/9599)
* [数据库表格视图日期列时区调整](https://github.com/siyuan-note/siyuan/issues/9610)
* [数据库表格视图支持固定列](https://github.com/siyuan-note/siyuan/pull/9617)
* [改进超级块下的数据库表格视图](https://github.com/siyuan-note/siyuan/issues/9620)
* [数据库表格视图超链接列空白处无法点击编辑](https://github.com/siyuan-note/siyuan/issues/9632)
* [未固定的停靠面板拖拽宽度时未触发 `resize`](https://github.com/siyuan-note/siyuan/issues/9640)
* [为模板、挂件、主题和图标示例库添加开源许可证](https://github.com/siyuan-note/siyuan/issues/9641)
* [内核 API `createDocWithMd` 支持并发调用](https://github.com/siyuan-note/siyuan/issues/9644)

View file

@ -52,7 +52,7 @@
* [行级公式显示 `<wbr>`](https://github.com/siyuan-note/siyuan/issues/8378)
* [`Backspace` 删除 Markdown 转义符异常](https://github.com/siyuan-note/siyuan/issues/8406)
### 文档
### 改进文档
* [在用户指南中添加订阅过期后删除云端存储的详细说明](https://github.com/siyuan-note/siyuan/issues/8370)
* [在自述文件中添加架构设计章节](https://github.com/siyuan-note/siyuan/issues/8416)

View file

@ -44,7 +44,7 @@
* [在已有引用前后粘贴引用后不应该合并](https://github.com/siyuan-note/siyuan/issues/8309)
* [移动端在某些情况下显示空白](https://github.com/siyuan-note/siyuan/issues/8320)
### 文档
### 改进文档
* [更新内核 API `insertBlock`](https://github.com/siyuan-note/siyuan/issues/8270)
* [在用户指南中添加 最新进展 章节](https://github.com/siyuan-note/siyuan/issues/8306)

File diff suppressed because one or more lines are too long

View file

@ -9,7 +9,7 @@ require (
github.com/88250/clipboard v0.1.5
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/gulu v1.2.3-0.20231023172823-f152fc5d93ef
github.com/88250/lute v1.7.6-0.20231108015409-190efcc81cd8
github.com/88250/lute v1.7.6-0.20231113042205-e8dab3abc952
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
@ -49,11 +49,11 @@ require (
github.com/radovskyb/watcher v1.0.7
github.com/sashabaranov/go-openai v1.17.5
github.com/shirou/gopsutil/v3 v3.23.10
github.com/siyuan-note/dejavu v0.0.0-20231112164555-a00187a95fec
github.com/siyuan-note/dejavu v0.0.0-20231114024923-42c60dc5343a
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80
github.com/siyuan-note/filelock v0.0.0-20231107122348-6ed75b0b525a
github.com/siyuan-note/httpclient v0.0.0-20231028070852-3c2c5a151c13
github.com/siyuan-note/httpclient v0.0.0-20231114005512-c39c76a8c333
github.com/siyuan-note/logging v0.0.0-20231030034701-8265764f00ff
github.com/siyuan-note/riff v0.0.0-20231106140614-c67ff0c69e33
github.com/steambap/captcha v1.4.1
@ -77,7 +77,7 @@ require (
github.com/andybalholm/brotli v1.0.6 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect
github.com/aws/aws-sdk-go v1.47.9 // indirect
github.com/aws/aws-sdk-go v1.47.10 // indirect
github.com/bytedance/sonic v1.10.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect

View file

@ -10,8 +10,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20231023172823-f152fc5d93ef h1:LVJO3aj18v63T2whGGt3gL5imkJk+7ujPfFv38X7Oi8=
github.com/88250/gulu v1.2.3-0.20231023172823-f152fc5d93ef/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k=
github.com/88250/lute v1.7.6-0.20231108015409-190efcc81cd8 h1:JTDntAVUvuBTDyT4AZJodUd64eBU6Z4xFszEokDV9hQ=
github.com/88250/lute v1.7.6-0.20231108015409-190efcc81cd8/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/lute v1.7.6-0.20231113042205-e8dab3abc952 h1:ECggYsXuyJvhxoxVbLVaJ985y5hrboF6X7W5vB4zn3I=
github.com/88250/lute v1.7.6-0.20231113042205-e8dab3abc952/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=
@ -49,8 +49,8 @@ github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhP
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM=
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII=
github.com/aws/aws-sdk-go v1.47.9 h1:rarTsos0mA16q+huicGx0e560aYRtOucV5z2Mw23JRY=
github.com/aws/aws-sdk-go v1.47.9/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go v1.47.10 h1:cvufN7WkD1nlOgpRopsmxKQlFp5X1MfyAw4r7BBORQc=
github.com/aws/aws-sdk-go v1.47.10/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE=
@ -352,16 +352,16 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d h1:lvCTyBbr36+tqMccdGMwuEU+hjux/zL6xSmf5S9ITaA=
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8=
github.com/siyuan-note/dejavu v0.0.0-20231112164555-a00187a95fec h1:lhTPFSD7IhOvYyV6gnXkaW4UQjXT0zS7purEf/AMMt8=
github.com/siyuan-note/dejavu v0.0.0-20231112164555-a00187a95fec/go.mod h1:6RdIofCDZP8vL0qYnVZfB12NhK7cUgh1ooUxRvRdlmI=
github.com/siyuan-note/dejavu v0.0.0-20231114024923-42c60dc5343a h1:4VkGtdry3LDv6zyQSkTkp2BrYgyFt2lWIF7GROgYTFg=
github.com/siyuan-note/dejavu v0.0.0-20231114024923-42c60dc5343a/go.mod h1:g8x1cYUKzmvrjuV/EcTeb7EQmgWIYBZlRiDtM1TtNhI=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80 h1:XghjHKJd+SiL0DkGYFVC+UGUDFtnR4v9gkAbPeh9Eq8=
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80/go.mod h1:Sqo4FYX5lAXu7gWkbEdJF0e6P57tNNVV4WDKYDctokI=
github.com/siyuan-note/filelock v0.0.0-20231107122348-6ed75b0b525a h1:fNWhSpB+e0zOc76isiXAhjiQRaHocitRhWthCaCYTJA=
github.com/siyuan-note/filelock v0.0.0-20231107122348-6ed75b0b525a/go.mod h1:HjtfP1NLDw53BRSeAPJgZDIGqyxi4bANYn1IhgDCQUY=
github.com/siyuan-note/httpclient v0.0.0-20231028070852-3c2c5a151c13 h1:DQwiRQa63wsjSKQN5TvTWI2Dd5XSulhnXvxIdOG8/x8=
github.com/siyuan-note/httpclient v0.0.0-20231028070852-3c2c5a151c13/go.mod h1:mS0nX5fX99R/5HLnKqG40kpbathSCXxL/oxe88rURNI=
github.com/siyuan-note/httpclient v0.0.0-20231114005512-c39c76a8c333 h1:IelcK7j2VVNeiU9ta/B7JsohG+wzGXT2iO25oQVmP7A=
github.com/siyuan-note/httpclient v0.0.0-20231114005512-c39c76a8c333/go.mod h1:yiR/Uml8/YF9a/m7P2Fb7MlYNXSXX9peWTuPggGddB4=
github.com/siyuan-note/logging v0.0.0-20231030034701-8265764f00ff h1:5GcxrTOJTsusXOLhg4GuHWbEa4M5gu+CNfL0giwNjDM=
github.com/siyuan-note/logging v0.0.0-20231030034701-8265764f00ff/go.mod h1:6mRFtAAvYPn3cDzqvyv+t8BVPGqpONDMMb5ywOhY1D4=
github.com/siyuan-note/riff v0.0.0-20231106140614-c67ff0c69e33 h1:oEJoBL0ZSDwKckZcS37zMuIsPplTnN1aHz+04700P2o=

View file

@ -111,42 +111,40 @@ func ListNotebooks() (ret []*Box, err error) {
boxConf := conf.NewBoxConf()
boxDirPath := filepath.Join(util.DataDir, dir.Name())
boxConfPath := filepath.Join(boxDirPath, ".siyuan", "conf.json")
if !filelock.IsExist(boxConfPath) {
// Automatically move corrupted notebook folders to the corrupted folder https://github.com/siyuan-note/siyuan/issues/9202
isExistConf := filelock.IsExist(boxConfPath)
if !isExistConf {
// 数据同步时展开文档树操作可能导致数据丢失 https://github.com/siyuan-note/siyuan/issues/7129
logging.LogWarnf("found a corrupted box [%s]", boxDirPath)
to := filepath.Join(util.WorkspaceDir, "corrupted", time.Now().Format("2006-01-02-150405"), dir.Name())
if copyErr := filelock.Copy(boxDirPath, to); nil != copyErr {
logging.LogErrorf("copy corrupted notebook dir [%s] failed: %s", boxDirPath, copyErr)
} else {
data, readErr := filelock.ReadFile(boxConfPath)
if nil != readErr {
logging.LogErrorf("read box conf [%s] failed: %s", boxConfPath, readErr)
continue
}
if removeErr := filelock.Remove(boxDirPath); nil != removeErr {
logging.LogErrorf("remove corrupted data file [%s] failed: %s", boxDirPath, removeErr)
if readErr = gulu.JSON.UnmarshalJSON(data, boxConf); nil != readErr {
logging.LogErrorf("parse box conf [%s] failed: %s", boxConfPath, readErr)
os.RemoveAll(boxConfPath)
continue
}
util.ReloadUI()
continue
}
data, readErr := filelock.ReadFile(boxConfPath)
if nil != readErr {
logging.LogErrorf("read box conf [%s] failed: %s", boxConfPath, readErr)
continue
}
if readErr = gulu.JSON.UnmarshalJSON(data, boxConf); nil != readErr {
logging.LogErrorf("parse box conf [%s] failed: %s", boxConfPath, readErr)
os.RemoveAll(boxConfPath)
continue
}
id := dir.Name()
ret = append(ret, &Box{
box := &Box{
ID: id,
Name: boxConf.Name,
Icon: boxConf.Icon,
Sort: boxConf.Sort,
SortMode: boxConf.SortMode,
Closed: boxConf.Closed,
})
}
if !isExistConf {
// Automatically create notebook conf.json if not found it https://github.com/siyuan-note/siyuan/issues/9647
box.SaveConf(boxConf)
box.Unindex()
logging.LogWarnf("fixed a corrupted box [%s]", boxDirPath)
}
ret = append(ret, box)
}
switch Conf.FileTree.Sort {

View file

@ -902,7 +902,12 @@ func upgradeUserGuide() {
boxConf := conf.NewBoxConf()
boxConfPath := filepath.Join(boxDirPath, ".siyuan", "conf.json")
if !filelock.IsExist(boxConfPath) {
logging.LogWarnf("found a corrupted box [%s]", boxDirPath)
logging.LogWarnf("found a corrupted user guide box [%s]", boxDirPath)
if removeErr := filelock.Remove(boxDirPath); nil != removeErr {
logging.LogErrorf("remove corrupted user guide box [%s] failed: %s", boxDirPath, removeErr)
} else {
logging.LogInfof("removed corrupted user guide box [%s]", boxDirPath)
}
continue
}

View file

@ -25,6 +25,7 @@ import (
"sort"
"strconv"
"strings"
"sync"
"time"
"unicode/utf8"
@ -1008,7 +1009,12 @@ func createTreeTx(tree *parse.Tree) {
PerformTransactions(&[]*Transaction{transaction})
}
var createDocLock = sync.Mutex{}
func CreateDocByMd(boxID, p, title, md string, sorts []string) (tree *parse.Tree, err error) {
createDocLock.Lock()
defer createDocLock.Unlock()
box := Conf.Box(boxID)
if nil == box {
err = errors.New(Conf.Language(0))
@ -1027,6 +1033,9 @@ func CreateDocByMd(boxID, p, title, md string, sorts []string) (tree *parse.Tree
}
func CreateWithMarkdown(boxID, hPath, md, parentID, id string) (retID string, err error) {
createDocLock.Lock()
defer createDocLock.Unlock()
box := Conf.Box(boxID)
if nil == box {
err = errors.New(Conf.Language(0))
@ -1040,6 +1049,81 @@ func CreateWithMarkdown(boxID, hPath, md, parentID, id string) (retID string, er
return
}
func CreateDailyNote(boxID string) (p string, existed bool, err error) {
createDocLock.Lock()
defer createDocLock.Unlock()
box := Conf.Box(boxID)
if nil == box {
err = ErrBoxNotFound
return
}
boxConf := box.GetConf()
if "" == boxConf.DailyNoteSavePath || "/" == boxConf.DailyNoteSavePath {
err = errors.New(Conf.Language(49))
return
}
hPath, err := RenderGoTemplate(boxConf.DailyNoteSavePath)
if nil != err {
return
}
WaitForWritingFiles()
existRoot := treenode.GetBlockTreeRootByHPath(box.ID, hPath)
if nil != existRoot {
existed = true
p = existRoot.Path
return
}
id, err := createDocsByHPath(box.ID, hPath, "", "", "")
if nil != err {
return
}
var dom string
if "" != boxConf.DailyNoteTemplatePath {
tplPath := filepath.Join(util.DataDir, "templates", boxConf.DailyNoteTemplatePath)
if !filelock.IsExist(tplPath) {
logging.LogWarnf("not found daily note template [%s]", tplPath)
} else {
dom, err = renderTemplate(tplPath, id, false)
if nil != err {
logging.LogWarnf("render daily note template [%s] failed: %s", boxConf.DailyNoteTemplatePath, err)
}
}
}
if "" != dom {
var tree *parse.Tree
tree, err = loadTreeByBlockID(id)
if nil == err {
tree.Root.FirstChild.Unlink()
luteEngine := util.NewLute()
newTree := luteEngine.BlockDOM2Tree(dom)
var children []*ast.Node
for c := newTree.Root.FirstChild; nil != c; c = c.Next {
children = append(children, c)
}
for _, c := range children {
tree.Root.AppendChild(c)
}
tree.Root.SetIALAttr("updated", util.CurrentTimeSecondsStr())
if err = indexWriteJSONQueue(tree); nil != err {
return
}
}
}
IncSync()
b := treenode.GetBlockTree(id)
p = b.Path
return
}
func GetHPathByPath(boxID, p string) (hPath string, err error) {
if "/" == p {
hPath = "/"
@ -1414,78 +1498,6 @@ func RenameDoc(boxID, p, title string) (err error) {
return
}
func CreateDailyNote(boxID string) (p string, existed bool, err error) {
box := Conf.Box(boxID)
if nil == box {
err = ErrBoxNotFound
return
}
boxConf := box.GetConf()
if "" == boxConf.DailyNoteSavePath || "/" == boxConf.DailyNoteSavePath {
err = errors.New(Conf.Language(49))
return
}
hPath, err := RenderGoTemplate(boxConf.DailyNoteSavePath)
if nil != err {
return
}
WaitForWritingFiles()
existRoot := treenode.GetBlockTreeRootByHPath(box.ID, hPath)
if nil != existRoot {
existed = true
p = existRoot.Path
return
}
id, err := createDocsByHPath(box.ID, hPath, "", "", "")
if nil != err {
return
}
var dom string
if "" != boxConf.DailyNoteTemplatePath {
tplPath := filepath.Join(util.DataDir, "templates", boxConf.DailyNoteTemplatePath)
if !filelock.IsExist(tplPath) {
logging.LogWarnf("not found daily note template [%s]", tplPath)
} else {
dom, err = renderTemplate(tplPath, id, false)
if nil != err {
logging.LogWarnf("render daily note template [%s] failed: %s", boxConf.DailyNoteTemplatePath, err)
}
}
}
if "" != dom {
var tree *parse.Tree
tree, err = loadTreeByBlockID(id)
if nil == err {
tree.Root.FirstChild.Unlink()
luteEngine := util.NewLute()
newTree := luteEngine.BlockDOM2Tree(dom)
var children []*ast.Node
for c := newTree.Root.FirstChild; nil != c; c = c.Next {
children = append(children, c)
}
for _, c := range children {
tree.Root.AppendChild(c)
}
tree.Root.SetIALAttr("updated", util.CurrentTimeSecondsStr())
if err = indexWriteJSONQueue(tree); nil != err {
return
}
}
}
IncSync()
b := treenode.GetBlockTree(id)
p = b.Path
return
}
func createDoc(boxID, p, title, dom string) (tree *parse.Tree, err error) {
title = gulu.Str.RemoveInvisible(title)
if 512 < utf8.RuneCountInString(title) {