mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-15 08:30:42 +08:00
🎨 Database table view breadcrumb
This commit is contained in:
parent
6b1a2925c9
commit
d78a0205f5
@ -304,6 +304,8 @@ func buildBlockBreadcrumb(node *ast.Node, excludeTypes []string) (ret []*BlockPa
|
|||||||
name := util.EscapeHTML(parent.IALAttr("name"))
|
name := util.EscapeHTML(parent.IALAttr("name"))
|
||||||
if ast.NodeDocument == parent.Type {
|
if ast.NodeDocument == parent.Type {
|
||||||
name = util.EscapeHTML(box.Name) + util.EscapeHTML(hPath)
|
name = util.EscapeHTML(box.Name) + util.EscapeHTML(hPath)
|
||||||
|
} else if ast.NodeAttributeView == parent.Type {
|
||||||
|
name = treenode.GetAttributeViewName(parent.AttributeViewID)
|
||||||
} else {
|
} else {
|
||||||
if "" == name {
|
if "" == name {
|
||||||
if ast.NodeListItem == parent.Type {
|
if ast.NodeListItem == parent.Type {
|
||||||
|
@ -475,6 +475,27 @@ func IsChartCodeBlockCode(code *ast.Node) bool {
|
|||||||
return render.NoHighlight(language)
|
return render.NoHighlight(language)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetAttributeViewName(avID string) (name string) {
|
||||||
|
if "" == avID {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
attrView, err := av.ParseAttributeView(avID)
|
||||||
|
if nil != err {
|
||||||
|
logging.LogErrorf("parse attribute view [%s] failed: %s", avID, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
buf := bytes.Buffer{}
|
||||||
|
for _, v := range attrView.Views {
|
||||||
|
buf.WriteString(v.Name)
|
||||||
|
buf.WriteByte(' ')
|
||||||
|
}
|
||||||
|
|
||||||
|
name = strings.TrimSpace(buf.String())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func getAttributeViewContent(avID string) (content string) {
|
func getAttributeViewContent(avID string) (content string) {
|
||||||
if "" == avID {
|
if "" == avID {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user