mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 03:50:16 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
7b5d58d5d3
6
.github/CONTRIBUTING.md
vendored
6
.github/CONTRIBUTING.md
vendored
@ -5,7 +5,7 @@
|
|||||||
* `git clone git@github.com:siyuan-note/siyuan.git`
|
* `git clone git@github.com:siyuan-note/siyuan.git`
|
||||||
* switch to dev branch `git checkout dev`
|
* switch to dev branch `git checkout dev`
|
||||||
|
|
||||||
## User Interface
|
## NPM dependencies
|
||||||
|
|
||||||
Install pnpm: `npm install -g pnpm@9.12.1`
|
Install pnpm: `npm install -g pnpm@9.12.1`
|
||||||
|
|
||||||
@ -23,7 +23,6 @@ NPM mirror:
|
|||||||
|
|
||||||
* Use npmmirror China mirror repository `pnpm --registry https://registry.npmmirror.com/ i`
|
* Use npmmirror China mirror repository `pnpm --registry https://registry.npmmirror.com/ i`
|
||||||
* Revert to using official repository `pnpm --registry https://registry.npmjs.org i`
|
* Revert to using official repository `pnpm --registry https://registry.npmjs.org i`
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
On the desktop, go to the app folder to run:
|
On the desktop, go to the app folder to run:
|
||||||
@ -57,7 +56,8 @@ Note: In the development environment, the kernel process will not be automatical
|
|||||||
### Android
|
### Android
|
||||||
|
|
||||||
* `cd kernel`
|
* `cd kernel`
|
||||||
* `set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8; gomobile bind --tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/`
|
* `set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8`
|
||||||
|
* `gomobile bind --tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/`
|
||||||
* https://github.com/siyuan-note/siyuan-android
|
* https://github.com/siyuan-note/siyuan-android
|
||||||
|
|
||||||
### Harmony
|
### Harmony
|
||||||
|
7
.github/CONTRIBUTING_zh_CN.md
vendored
7
.github/CONTRIBUTING_zh_CN.md
vendored
@ -14,11 +14,8 @@
|
|||||||
|
|
||||||
设置 Electron 镜像环境变量并安装 Electron:
|
设置 Electron 镜像环境变量并安装 Electron:
|
||||||
|
|
||||||
* macOS/Linux:
|
* macOS/Linux:`ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v34.3.4 -D`
|
||||||
```
|
* Windows:
|
||||||
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v34.3.4 -D
|
|
||||||
```
|
|
||||||
* Windows:
|
|
||||||
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
|
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
|
||||||
* `pnpm install electron@v34.3.4 -D`
|
* `pnpm install electron@v34.3.4 -D`
|
||||||
|
|
||||||
|
2
app/stage/protyle/js/lute/lute.min.js
vendored
2
app/stage/protyle/js/lute/lute.min.js
vendored
File diff suppressed because one or more lines are too long
@ -10,7 +10,7 @@ require (
|
|||||||
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
|
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
|
||||||
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
|
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
|
||||||
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689
|
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689
|
||||||
github.com/88250/lute v1.7.7-0.20250404112626-6633163ba03b
|
github.com/88250/lute v1.7.7-0.20250410111856-ed39794479ef
|
||||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
|
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
|
||||||
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
|
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
|
||||||
github.com/ConradIrwin/font v0.2.1
|
github.com/ConradIrwin/font v0.2.1
|
||||||
|
@ -14,8 +14,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
|
|||||||
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||||
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689 h1:39y5g7vnFAIcXhTN3IXPk7h2xBhC4a9hBTykDhHJqRY=
|
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689 h1:39y5g7vnFAIcXhTN3IXPk7h2xBhC4a9hBTykDhHJqRY=
|
||||||
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689/go.mod h1:c8uVw25vW2W4dhJ/j4iYsX5H1hc19spim266jO5x2hU=
|
github.com/88250/gulu v1.2.3-0.20250227144607-7f4570b0d689/go.mod h1:c8uVw25vW2W4dhJ/j4iYsX5H1hc19spim266jO5x2hU=
|
||||||
github.com/88250/lute v1.7.7-0.20250404112626-6633163ba03b h1:kvGbMhVrE8erJLSWAZx+7LpdouBsu2TD0c1XCzGAjUY=
|
github.com/88250/lute v1.7.7-0.20250410111856-ed39794479ef h1:DgaFVGD0RXjY4D+vJtGGZ3z+NL8LsAcD+TD74cE2hSs=
|
||||||
github.com/88250/lute v1.7.7-0.20250404112626-6633163ba03b/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
|
github.com/88250/lute v1.7.7-0.20250410111856-ed39794479ef/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
|
||||||
github.com/88250/pdfcpu v0.3.14-0.20241201033812-5a93b7586a01 h1:AcFe63RXjIh1XtX/dc4Es3U8bYKjlEkvavHd1nFBOHM=
|
github.com/88250/pdfcpu v0.3.14-0.20241201033812-5a93b7586a01 h1:AcFe63RXjIh1XtX/dc4Es3U8bYKjlEkvavHd1nFBOHM=
|
||||||
github.com/88250/pdfcpu v0.3.14-0.20241201033812-5a93b7586a01/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI=
|
github.com/88250/pdfcpu v0.3.14-0.20241201033812-5a93b7586a01/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI=
|
||||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=
|
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=
|
||||||
|
@ -25,7 +25,6 @@ import (
|
|||||||
"github.com/88250/gulu"
|
"github.com/88250/gulu"
|
||||||
"github.com/88250/lute/ast"
|
"github.com/88250/lute/ast"
|
||||||
"github.com/emirpasic/gods/sets/hashset"
|
"github.com/emirpasic/gods/sets/hashset"
|
||||||
"github.com/siyuan-note/logging"
|
|
||||||
"github.com/siyuan-note/siyuan/kernel/search"
|
"github.com/siyuan-note/siyuan/kernel/search"
|
||||||
"github.com/siyuan-note/siyuan/kernel/sql"
|
"github.com/siyuan-note/siyuan/kernel/sql"
|
||||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||||
@ -303,7 +302,6 @@ func sortTags(tags Tags) {
|
|||||||
|
|
||||||
func SearchTags(keyword string) (ret []string) {
|
func SearchTags(keyword string) (ret []string) {
|
||||||
ret = []string{}
|
ret = []string{}
|
||||||
defer logging.Recover() // 定位 无法添加题头图标签 https://github.com/siyuan-note/siyuan/issues/6756
|
|
||||||
|
|
||||||
sql.FlushQueue()
|
sql.FlushQueue()
|
||||||
|
|
||||||
|
@ -96,8 +96,16 @@ func QueryTagSpansByLabel(label string) (ret []*Span) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func QueryTagSpansByKeyword(keyword string, limit int) (ret []*Span) {
|
func QueryTagSpansByKeyword(keyword string, limit int) (ret []*Span) {
|
||||||
stmt := "SELECT * FROM spans WHERE type LIKE '%tag%' AND content LIKE '%" + keyword + "%' GROUP BY markdown"
|
// 标签搜索支持空格分隔关键字 Tag search supports space-separated keywords https://github.com/siyuan-note/siyuan/issues/14580
|
||||||
stmt += " LIMIT " + strconv.Itoa(limit)
|
keywords := strings.Split(keyword, " ")
|
||||||
|
contentLikes := ""
|
||||||
|
for _, k := range keywords {
|
||||||
|
if contentLikes != "" {
|
||||||
|
contentLikes += " OR "
|
||||||
|
}
|
||||||
|
contentLikes += "content LIKE '%" + k + "%'"
|
||||||
|
}
|
||||||
|
stmt := "SELECT * FROM spans WHERE type LIKE '%tag%' AND (" + contentLikes + ") GROUP BY markdown LIMIT " + strconv.Itoa(limit)
|
||||||
rows, err := query(stmt)
|
rows, err := query(stmt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logging.LogErrorf("sql query failed: %s", err)
|
logging.LogErrorf("sql query failed: %s", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user