benweet / stackedit

In-browser Markdown editor
https://stackedit.io/
Apache License 2.0
21.8k stars 2.73k forks source link

composite flowchart does not render properly #1697

Closed k-byun closed 3 years ago

k-byun commented 3 years ago

Just made up the term "composite flowchart" but the mermaid code below:

graph LR
A-->B-->C

does not get drawn properly. Tried this out on Atom with success.

b4r commented 3 years ago

Which version of mermaid are you running? From https://github.com/mermaid-js/mermaid/issues/916 and https://github.com/mermaid-js/mermaid/releases/tag/8.2.6 the feature was requested and added. If you run npm update from the stackedit root does the update help fix?

k-byun commented 3 years ago

version 2.0.0 How do I run npm update from root folder? I had the StackEdit installed yesterday while I was trying it the first time on the browser.

update: using Windows machine update: mermaid on my chrome was installed by Chrome Extensions

b4r commented 3 years ago

Oh - I'm sorry - so it's the Chrome Extensions. Is the StackEdit version you're using also the Chrome Extension?

k-byun commented 3 years ago

Yes, I'm using the Chrome Extension. I didn't know if there was another way to install it - I will explore this side this afternoon. Looked like there is another way to install by using "git clone ..."

b4r commented 3 years ago

It's no problem - just leaving note here that I'll try and research the extensions (I broke my existing install of the nodejs bundle/build) but if anyone else has insight on this it would of course be appreciated.

So a brief update : mermaid@8.0.0-rc.8 seems to be the latest version that will not break stackedit. After some playing around I got it now but appears I need to update babel so I'll work on that when able. Regarding the Chrome extensions it seems they rely on using stackedit.io whenever you click the icon to pull up the editor - so my current best guess is - until newer versions of mermaid don't break stackedit - then we wont yet have the chaining graph feature.

b4r commented 3 years ago

I think I got it updated finally. Steps to reproduce updating to the latest mermaid@8.8.4 as of today in order to use the chaining graph feature.

  1. git clone https://github.com/benweet/stackedit.git
    • This makes our new repo - I would advise cloning to a new directory for testing / confirming this "fix" ...
  2. cp updated-stackedit__package.json stackedit/package.json
  3. cp updated-stackedit__.babelrc stackedit/.babelrc
  4. cd stackedit
    • We should now have the stackedit repo primed for updates.
  5. Run npm install (similar as original README.md instructed by the repo).
    • This fails for me regarding gulp build-prism so if it fails for you run npm install gulp.
    • Now run npm install again to complete.
  6. ** One last prep for mermaid@8.8.4 extracted from the tarball (see the updated package.json you'll see we're using the github tarball).
    • For this step - if you're still inside the stackedit root directory - cd node_modules/mermaid.
    • Install jison in some way. I did it thru apt install jison - lots of dependencies, then jison becomes a CLI tool.
    • Here's the trick, compile the .jison files to .js with the jison tool.
      • Here's a little help to scan through the current node_modules/mermaid directory we just cd'd to :
        #!/bin/bash
        here=`pwd`;
        find . -iname '*.jison' | while read line; do
         echo ${line%/*};
         echo $line;
         cd ${line%/*};
         #jison ${line##*/} ;
         cd $here;
        done
      • Uncomment the jison ${line##*/}; line above when ready then run the script or make it a one liner and run that way
      • The one-liner approach for more copy-paste suitability:
        here=`pwd`; find . -iname '*.jison' | while read line; do echo ${line%/*}; echo $line; cd ${line%/*}; jison ${line##*/}; cd $here; done
    • cd ../../ back to the stackedit root directory.
  7. Now finally npm start.

So far this process works for me.

updated-stackedit__package.json = https://gist.github.com/b4r/2810aa49f16a8068db385b291fcb7208 updated-stackedit__.babelrc = https://gist.github.com/b4r/3f65bc5e741650d94473d3c7251f065c

Working on the chrome extension part next.

k-byun commented 3 years ago

Looking forward for the new chrome extension. Thanks!

b4r commented 3 years ago

Repo for the chrome extension https://github.com/b4r/stackedit-chrome-extension-project

Please let me know if I missed something.

dayfuaim commented 3 years ago

I confirm it doesn't working properly: Снимок экрана от 2021-03-02 17-32-30

I use web version https://app.stackedit.io. No additional extensions.

b4r commented 3 years ago

Correct. The web version from app.stackedit.io does not seem to currently use the updated mermaid v8.2.6 version which allows chaining to work properly.

benweet commented 3 years ago

Fixed with v5.14.10.