Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Mermaid (Markdown) #1091

Closed
mtompkins opened this issue Mar 3, 2016 · 49 comments
Closed

Feature request: Mermaid (Markdown) #1091

mtompkins opened this issue Mar 3, 2016 · 49 comments
Assignees
Milestone

Comments

@mtompkins
Copy link

Mermaid - with the fantastic move to MarkDown, I'd love to see this utility incorporated. I haven't seen mention of it anywhere so I'm adding it here. https://github.com/knsv/mermaid It is SO convenient especially in a FAQ system

@thorsten
Copy link
Owner

thorsten commented Mar 3, 2016

It's just a JS library as far as I see, right?

@thorsten thorsten self-assigned this Mar 3, 2016
@mtompkins
Copy link
Author

Yes, and NPM friendly which should integrate nicely (and hopefully seemlessly) for you.

@thorsten
Copy link
Owner

thorsten commented Mar 3, 2016

Should be easy to add that even to 2.9

@thorsten thorsten added this to the 2.9.0 milestone Mar 3, 2016
@mtompkins
Copy link
Author

I was thinking it should be a very quick and solid addition for phpmyfaq (and of course the user base) based on the addition of Markdown. Hopefully that proves to be the case.

thorsten added a commit that referenced this issue Mar 19, 2016
@thorsten
Copy link
Owner

Will be added in the upcoming RC2 release.

@mtompkins
Copy link
Author

Took RC2 for a spin just now - really looks polished and amazing! Congratulations!

Just a note / followup on mermaid - it doesn't seem to be incorporated in RC2. Perhaps you meant RC3?

Attached is some markdown to test mermaid to try and help.

screenshot from 2016-03-20 07-55-38
:

markdown-test.txt

@thorsten
Copy link
Owner

Hm, strange. Does it need some configuration? Just added the library

@mtompkins
Copy link
Author

Here is the relevant doc: http://knsv.github.io/mermaid/#installation

Presume you are doing:

<script src="mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>

@mtompkins
Copy link
Author

Further reading seems to indicate best way forward is a call to the API:

http://knsv.github.io/mermaid/#api-usage

@thorsten
Copy link
Owner

Okay, I forgot that :-(
Sorry, preparing a 3rd RC asap

@mtompkins
Copy link
Author

Not a problem ... that's why it's an RC!! Will test when available.

@thorsten
Copy link
Owner

Added these lines, but it still don't work...

@mtompkins
Copy link
Author

I see your approach was to enable mermaid only if markdown is active. Shall I suggest we start with enabling mermaid at all times (it works with html directly) as a place to start?

The following HTML should generate a simple diagram:

<div class="mermaid">
        graph LR
            A-->B
            B-->C
            C-->A
            D-->C
</div>

@thorsten
Copy link
Owner

Right, shouldn't have any side effects. One thing that seems to break the code is that the arrows are encoded...

@mtompkins
Copy link
Author

I've seen something similar on one of the downstream projects (arrow / symbol issue). I'll see if I can find it, test & revert.

@mtompkins
Copy link
Author

Which markdown to HTML renderer are you using?

@mtompkins
Copy link
Author

@mtompkins
Copy link
Author

OK - here's where I am and I think we should pause...there is an upstream issue.

What I've done is relocate the instantiation of mermaid from artikel.php to index.tpl on the bottom as is often used for <script> instantiation. Also as mermaid works with or without markdown (i.e. standard HTML works find to produce a graphic) I believe it should be always enabled.

Doing that minor edit I'm left with this error:

No longer working - Invalid value for <svg> attribute viewBox="0 0 -Infinity -Infinity"

Here are the relevant issues on upstream channels:

Once we see how these are resolved I'll pick it back up. Once we render the graphics correctly I'll see about the direct implementation to the markdown editor.

If you are using marked as the MD --> HTML engine we can easily handle the arrows based on the references here: #1091 (comment)

@thorsten
Copy link
Owner

Okay, I'll postpone this feature to 2.9.1. Thanks for testing and investigating!

@thorsten thorsten modified the milestones: 2.9.1, 2.9.0 Mar 20, 2016
@thorsten
Copy link
Owner

btw, we use Parsedown: http://parsedown.org/

@thorsten
Copy link
Owner

Okay, so these things are missing:

  • end user documentation
  • Mermaid in admin preview
  • editor helper plus replacing the
    wrapper with some more user friendly

@thorsten thorsten modified the milestones: 2.9.1, 2.9.0 Mar 22, 2016
@mtompkins
Copy link
Author

Please see: mermaid-js/mermaid#330 (comment)

In order to accurately answer questions the mermaid developer may ask, I think direct interaction between you and him is probably the best road forward. I'll monitor the exchange and offer any help I can.

@knsv
Copy link

knsv commented Mar 22, 2016

Hello :)

Is there a public url to the page with the missing arrows? If so I can take a look and see if I see something that could cause the problem.

@thorsten
Copy link
Owner

Hi, I could install a current snapshot somewhere.

@knsv
Copy link

knsv commented Mar 22, 2016

Sounds like a plan!

@thorsten
Copy link
Owner

Installation will be up and running the next days, sorry for the delay.

@thorsten thorsten modified the milestones: 2.9.2, 2.9.1 May 26, 2016
@thorsten
Copy link
Owner

thorsten commented Jun 3, 2016

Sorry for the delay, here's the installation:
http://jen.demo.phpmyfaq.de/

Username
admin
Password
demoadmin

@thorsten thorsten modified the milestones: 2.9.3, 2.9.2 Jun 7, 2016
@thorsten
Copy link
Owner

Any news on this?

@thorsten thorsten modified the milestones: 2.9.4, 2.9.3, 2.9.5 Jul 31, 2016
@thorsten
Copy link
Owner

thorsten commented Aug 7, 2016

Ne feedback anymore. :(

@thorsten thorsten closed this as completed Aug 7, 2016
@knsv
Copy link

knsv commented Aug 7, 2016

Sorry, on varation. Will look at this when I get back. 

Get Outlook for iOS

On Sun, Aug 7, 2016 at 7:57 PM +0200, "Thorsten Rinne" notifications@github.com wrote:

Ne feedback anymore. :(


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@thorsten thorsten reopened this Aug 7, 2016
@knsv
Copy link

knsv commented Aug 8, 2016

I have looked at this now. Before we get to mermaid I must say that phpMyFAQ is getting to be an impressive publishing system, simple, elegant and versatile. Well done!

Now to the issue at hand. I think the problem is caused by the use of a base tag in phpMyFAQ. This messes up the references to the arrow heads in the generated svg markup. Fortunately there is a configuration option for this in mermaid. If you initialize mermaid with the option arrowMarkerAbsolute set to true it should fix the arrows. Then the references in the arrows heads will be absolute based in the url in the page. This is not always what you want if you for instance want to render the svg outside of the browser but in this case it should be ok.

    var config = {
        startOnLoad:true,
        arrowMarkerAbsolute:true
    };
    mermaid.initialize(config);

Try it out and let me know how it goes!

@thorsten
Copy link
Owner

thorsten commented Aug 8, 2016

Thanks a lot, fixed for 2.9.5!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants