zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

can add a mind map feature? #3103

Closed jan-bar closed 5 months ago

jan-bar commented 2 years ago

Describe feature

Since I'm not familiar with js, I found a mind map project and used trilium to configure a read-only mind map note.

This library supports editing nodes, but I feel that I need to use the front-end and back-end api functions of trilium, which I am not familiar with, so I hope the official add the function of mind map notes.

image

Here are my exported notes:mind.zip

The official css needs to annotate this configuration before it can be displayed to trilium normally

image

By reading the wiki need to add #appCss tag for css

image

The reason why it is read-only is because I have written data here.

image

image

image

Now I convert xmind to the required json format data in the following way, and get a read-only mind map note in the above way. go run main.go -s my.xmind -d my.json

package main

import (
    "flag"
    "os"

    "github.com/jan-bar/xmind"
)

func main() {
    xm := flag.String("s", "", "src xmind file")
    js := flag.String("d", "", "dst json file")
    flag.Parse()

    st, err := xmind.LoadFile(*xm)
    if err != nil {
        panic(err)
    }

    var data []byte
    err = xmind.SaveCustom(st.Topics[0], "id", "topic", "parentid", "isroot,1", &data, xmind.CustomIncrId())
    if err != nil {
        panic(err)
    }

    err = os.WriteFile(*js, data, os.ModePerm)
    if err != nil {
        panic(err)
    }
}

Additional Information

I switched from other note-taking software to trilium, because the previous note-taking software has a mind map function, so I am not used to it, but the trilium function is very useful, especially script notes, but my JavaScript learning is not very deep, I hope the author can refer to , add mind map notes, thank you very much.

sigaloid commented 2 years ago

Something like this is already similar with Mermaid graphs: https://github.com/zadam/trilium/pull/2187

Have you tried implementing a mind map within a Mermaid graph?

jan-bar commented 2 years ago

@sigaloid This is indeed a solution, but it cannot be edited in a faster way on the node. I feel like I can write a way to convert from Xmind to Mermaid graphs.

banjuer commented 7 months ago

@jan-bar hi bro, are there trilium plugins available

jan-bar commented 7 months ago

@jan-bar hi bro, are there trilium plugins available

No, you can refer to the project above and the plan I gave. I don’t know much about JavaScript.

banjuer commented 6 months ago

@jan-bar hi bro, i found one, try this: https://github.com/waterovo/trilium-jsmind awesome

jan-bar commented 6 months ago

@jan-bar hi bro, i found one, try this: https://github.com/waterovo/trilium-jsmind awesome

Thanks for the recommendation, it looks good

meichthys commented 5 months ago

Trilium has entered maintenance mode. Future enhancements will be addressed in TrilumNext: https://github.com/TriliumNext/Notes/issues/132