Philip-Scott / Notes-up

Markdown notes editor & manager
GNU General Public License v2.0
624 stars 47 forks source link

Recommend having a look at Mermaid #224

Closed mtompkins closed 6 years ago

mtompkins commented 6 years ago

Very nice app. You may want to incorporate this: https://mermaidjs.github.io/

Good luck!

Philip-Scott commented 6 years ago

I feel that the use cases for having this in Notes-Up is very small, but it might be a great opportunity for someone to make this as an external application :) Plus, you can always import images.

Closing and marking as out of scope

aljelly commented 6 years ago

Actually, you can use it already. Example (remove the space in the code tag):

# Graph test
My graph:

```mermaid
    graph LR
        A[this works]-->B[hello]
`` `
  ^ remove space

<script src=https://unpkg.com/mermaid@7.1.2/dist/mermaid.min.js></script>
<style>.mermaid {background-color:inherit;border:none;border-radius:0;padding:inherit;margin:inherit;font-family:"Open Sans";}</style>

Results in: image

You can also apply it to every page if you want, though it's a bit hacky.

Go to Preferences > Viewer and add this to the style modifications:

.mermaid {
    background-color: inherit;
    border: none;
    border-radius: 0;
    padding: inherit;
    margin: inherit;
    font-family: "Open Sans";
}
</style>
<script src=https://unpkg.com/mermaid@7.1.2/dist/mermaid.min.js></script>

Now you can remove the <script> and <style> code at the bottom of the example above and mermaid will work on all pages. It looks tidier when editing the note too.

fbruetting commented 6 years ago

Doesn’t work for me. Could this be due to Flatpak portal blocking interwebz access?

aljelly commented 6 years ago

I got it working with Flatpak. Flatpak blocks internet access by default, so the easy way to fix it is to add --share=network to the exec arguments, like flatpak run --share=network com.github.philip_scott.notes-up.