mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 14:58:49 +01:00
🎨 Preview mode supports jumping through the outline panel https://github.com/siyuan-note/siyuan/issues/3059
This commit is contained in:
parent
78ff4a0963
commit
f4982d2cd6
7 changed files with 28 additions and 14 deletions
|
|
@ -318,7 +318,7 @@ func exportData(exportFolder string) (zipPath string, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func Preview(id string) string {
|
||||
func Preview(id string) (retStdHTML string, retOutline []*Path) {
|
||||
tree, _ := loadTreeByBlockID(id)
|
||||
tree = exportTree(tree, false, false, false,
|
||||
Conf.Export.BlockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
|
||||
|
|
@ -329,7 +329,13 @@ func Preview(id string) string {
|
|||
luteEngine.SetFootnotes(true)
|
||||
md := treenode.FormatNode(tree.Root, luteEngine)
|
||||
tree = parse.Parse("", []byte(md), luteEngine.ParseOptions)
|
||||
return luteEngine.ProtylePreview(tree, luteEngine.RenderOptions)
|
||||
retStdHTML = luteEngine.ProtylePreview(tree, luteEngine.RenderOptions)
|
||||
|
||||
if footnotesDefBlock := tree.Root.ChildByType(ast.NodeFootnotesDefBlock); nil != footnotesDefBlock {
|
||||
footnotesDefBlock.Unlink()
|
||||
}
|
||||
retOutline = outline(tree)
|
||||
return
|
||||
}
|
||||
|
||||
func ExportDocx(id, savePath string, removeAssets, merge bool) (err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue