mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 02:59:50 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
7b5d58d5d3
12
.github/CONTRIBUTING.md
vendored
12
.github/CONTRIBUTING.md
vendored
@ -5,7 +5,7 @@
|
||||
* `git clone git@github.com:siyuan-note/siyuan.git`
|
||||
* switch to dev branch `git checkout dev`
|
||||
|
||||
## User Interface
|
||||
## NPM dependencies
|
||||
|
||||
Install pnpm: `npm install -g pnpm@9.12.1`
|
||||
|
||||
@ -16,19 +16,18 @@ Set the Electron mirror environment variable and install Electron:
|
||||
|
||||
* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v34.3.4 -D`
|
||||
* Windows:
|
||||
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
|
||||
* `pnpm install electron@v34.3.4 -D`
|
||||
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
|
||||
* `pnpm install electron@v34.3.4 -D`
|
||||
|
||||
NPM mirror:
|
||||
|
||||
* Use npmmirror China mirror repository `pnpm --registry https://registry.npmmirror.com/ i`
|
||||
* Revert to using official repository `pnpm --registry https://registry.npmjs.org i`
|
||||
|
||||
</details>
|
||||
|
||||
On the desktop, go to the app folder to run:
|
||||
|
||||
* `pnpm install electron@v34.3.4 -D`
|
||||
* `pnpm install electron@v34.3.4-D`
|
||||
* `pnpm run dev`
|
||||
* `pnpm run start`
|
||||
|
||||
@ -57,7 +56,8 @@ Note: In the development environment, the kernel process will not be automatical
|
||||
### Android
|
||||
|
||||
* `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
|
||||
|
||||
### Harmony
|
||||
|
13
.github/CONTRIBUTING_zh_CN.md
vendored
13
.github/CONTRIBUTING_zh_CN.md
vendored
@ -14,13 +14,10 @@
|
||||
|
||||
设置 Electron 镜像环境变量并安装 Electron:
|
||||
|
||||
* macOS/Linux:
|
||||
```
|
||||
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v34.3.4 -D
|
||||
```
|
||||
* Windows:
|
||||
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
|
||||
* `pnpm install electron@v34.3.4 -D`
|
||||
* macOS/Linux:`ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v34.3.4 -D`
|
||||
* Windows:
|
||||
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
|
||||
* `pnpm install electron@v34.3.4 -D`
|
||||
|
||||
NPM 镜像:
|
||||
|
||||
@ -30,7 +27,7 @@ NPM 镜像:
|
||||
|
||||
桌面端进入 app 文件夹运行:
|
||||
|
||||
* `pnpm install electron@v34.3.4 -D`
|
||||
* `pnpm install electron@v34.3.4-D`
|
||||
* `pnpm run dev`
|
||||
* `pnpm run start`
|
||||
|
||||
|
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/go-humanize v0.0.0-20240424102817-4f78fac47ea7
|
||||
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/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
|
||||
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/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/lute v1.7.7-0.20250404112626-6633163ba03b h1:kvGbMhVrE8erJLSWAZx+7LpdouBsu2TD0c1XCzGAjUY=
|
||||
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 h1:DgaFVGD0RXjY4D+vJtGGZ3z+NL8LsAcD+TD74cE2hSs=
|
||||
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/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI=
|
||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=
|
||||
|
@ -25,7 +25,6 @@ import (
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/emirpasic/gods/sets/hashset"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/search"
|
||||
"github.com/siyuan-note/siyuan/kernel/sql"
|
||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
@ -303,7 +302,6 @@ func sortTags(tags Tags) {
|
||||
|
||||
func SearchTags(keyword string) (ret []string) {
|
||||
ret = []string{}
|
||||
defer logging.Recover() // 定位 无法添加题头图标签 https://github.com/siyuan-note/siyuan/issues/6756
|
||||
|
||||
sql.FlushQueue()
|
||||
|
||||
|
@ -96,8 +96,16 @@ func QueryTagSpansByLabel(label string) (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"
|
||||
stmt += " LIMIT " + strconv.Itoa(limit)
|
||||
// 标签搜索支持空格分隔关键字 Tag search supports space-separated keywords https://github.com/siyuan-note/siyuan/issues/14580
|
||||
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)
|
||||
if err != nil {
|
||||
logging.LogErrorf("sql query failed: %s", err)
|
||||
|
Loading…
Reference in New Issue
Block a user