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

This commit is contained in:
Vanessa 2023-10-24 10:39:48 +08:00
commit cc0c7fc1b5
8 changed files with 42 additions and 16 deletions

View file

@ -49,4 +49,4 @@ jobs:
- name: Build the Docker image
run: |
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t b3log/siyuan:latest -t b3log/siyuan:v2.10.11 .
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t b3log/siyuan:latest -t b3log/siyuan:v2.10.12 .

2
API.md
View file

@ -1149,7 +1149,7 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
"/conf/appearance/boot",
"/conf/appearance/langs",
"/conf/appearance/emojis/conf.json",
"/conf/appearance/icons/index.html",
"/conf/appearance/icons/index.html"
],
"name": "zip-file-name"
}

View file

@ -1141,7 +1141,7 @@
"/conf/appearance/boot",
"/conf/appearance/langs",
"/conf/appearance/emojis/conf.json",
"/conf/appearance/icons/index.html",
"/conf/appearance/icons/index.html"
],
"name": "zip-file-name"
}

View file

@ -9,7 +9,7 @@
<Identity Name="89C2A984.SiYuan"
ProcessorArchitecture="x64"
Publisher="CN=087C656E-C1D9-42D8-8807-CED45A74FC0F"
Version="2.10.11.0"/>
Version="2.10.12.0"/>
<Properties>
<DisplayName>SiYuan</DisplayName>
<PublisherDisplayName>云南链滴科技有限公司</PublisherDisplayName>

View file

@ -1,6 +1,6 @@
{
"name": "SiYuan",
"version": "2.10.11",
"version": "2.10.12",
"description": "Refactor your thinking",
"homepage": "https://b3log.org/siyuan",
"main": "./electron/main.js",

View file

@ -1890,16 +1890,10 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
return ast.WalkContinue
}
var view *av.View
if "" != attrView.ViewID {
for _, v := range attrView.Views {
if v.ID == attrView.ViewID {
view = v
break
}
}
} else {
view = attrView.Views[0]
view, err := attrView.GetView()
if nil != err {
logging.LogErrorf("get attribute view [%s] failed: %s", avID, err)
return ast.WalkContinue
}
table, err := renderAttributeViewTable(attrView, view)

View file

@ -290,9 +290,41 @@ func renderTemplate(p, id string, preview bool) (string, error) {
if nil != cloned {
n.AttributeViewID = cloned.ID
if !preview {
// 非预览时持久化数据库
if saveErr := av.SaveAttributeView(cloned); nil != saveErr {
logging.LogErrorf("save attribute view [%s] failed: %s", cloned.ID, saveErr)
}
} else {
// 预览时使用简单表格渲染
view, getErr := attrView.GetView()
if nil != getErr {
logging.LogErrorf("get attribute view [%s] failed: %s", n.AttributeViewID, getErr)
return ast.WalkContinue
}
table, renderErr := renderAttributeViewTable(attrView, view)
if nil != renderErr {
logging.LogErrorf("render attribute view [%s] table failed: %s", n.AttributeViewID, renderErr)
return ast.WalkContinue
}
var aligns []int
for range table.Columns {
aligns = append(aligns, 0)
}
mdTable := &ast.Node{Type: ast.NodeTable, TableAligns: aligns}
mdTableHead := &ast.Node{Type: ast.NodeTableHead}
mdTable.AppendChild(mdTableHead)
mdTableHeadRow := &ast.Node{Type: ast.NodeTableRow, TableAligns: aligns}
mdTableHead.AppendChild(mdTableHeadRow)
for _, col := range table.Columns {
cell := &ast.Node{Type: ast.NodeTableCell}
cell.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(col.Name)})
mdTableHeadRow.AppendChild(cell)
}
n.InsertBefore(mdTable)
unlinks = append(unlinks, n)
}
}
}

View file

@ -42,7 +42,7 @@ import (
var Mode = "prod"
const (
Ver = "2.10.11"
Ver = "2.10.12"
IsInsider = false
)