Skip to content

Instantly share code, notes, and snippets.

@martinwoodward
Created February 11, 2022 20:34
Show Gist options
  • Save martinwoodward/8ad6296118c975510766d80310db71fd to your computer and use it in GitHub Desktop.
Save martinwoodward/8ad6296118c975510766d80310db71fd to your computer and use it in GitHub Desktop.
GitHub HTML Rendering Pipeline
```mermaid
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
    iframe->>dotcom: iframe ready
    dotcom->>iframe: set mermaid data on iframe
    iframe->>iframe: render mermaid
```
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
    iframe->>dotcom: iframe ready
    dotcom->>iframe: set mermaid data on iframe
    iframe->>iframe: render mermaid
@johnrichardrinehart
Copy link

I have the same question as @jimmcslim : Where should feedback go? Apparently <sub> and <sup> tags aren't supported like they are with GitHub-flavored Markdown: Asuperscriptsubscript.

@martinwoodward
Copy link
Author

This thread isn't being actively monitored. However being able to include code snippets from files outside the md file is def feedback we've heard before and are considering. If you'd like to contribute to mermaid.js then feel free to discuss mermaid features here: https://github.com/mermaid-js/mermaid

For general feedback on GitHub and the markdown support, probably best to go to https://github.com/github/feedback/discussions

@Alhadis
Copy link

Alhadis commented Mar 11, 2022

For those interested, this feature isn't Markdown-specific. It works in any format supported by github/markup that supports syntax highlighted code-blocks.

Basically, if it can yield <pre lang="mermaid">, it should be supported. Notably, GitHub Wikis are an exception (though this may be fixed in future).

Examples in different markup languages

AsciiDoc

[source,mermaid]
----
Add mermaid here.
----

Org-mode

#+BEGIN_SRC mermaid
Add mermaid here.
#+BEGIN_SRC

Textile

<pre lang="mermaid">
Raw HTML will do.
</pre>

WikiText (a.k.a., "MediaWiki")

NB: GitHub only supports <source> tags, which were deprecated in MediaWiki 1.16 in favour of the <syntaxhighlight> tag:

<source lang="mermaid">
Mermaid goes here.
</source>

reStructuredText

.. code:: mermaid

	flowchart LR;
		A-->B;
		B-->C;
		C-->D;
		click A callback "Tooltip for a callback"
		click B "http://www.github.com" "This is a tooltip for a link"
		click A call callback() "Tooltip for a callback"
		click B href "http://www.github.com" "This is a tooltip for a link"

@vvssttkk
Copy link

looking forward to it to add file .mmd to markdown file

@sfpuertog
Copy link

A-->B;
B-->C;
C-->D;

@manishapriya94
Copy link

Is the hyperlink solution support only for flowcharts? (Haven't been able to implement with user journey chart)

@xihajun
Copy link

xihajun commented Dec 8, 2022

Is the hyperlink solution support only for flowcharts? (Haven't been able to implement with user journey chart)

+1

@xihajun
Copy link

xihajun commented Dec 8, 2022

Looks like this works if we zoom in

graph TD;
    A[This is an <b>important</b> <a href='https://google.com'>link</a>]

@Anower77
Copy link

Excellent!

@devhindo
Copy link

bro it doesn't even render.

saying Unable to render rich display

@portothree
Copy link

What browser are you using? It renders just fine for me

@Anower77
Copy link

Anower77 commented Jun 30, 2023 via email

@portothree
Copy link

portothree commented Jun 30, 2023

chrome

Something must be blocking it from loading them, I'm using a chromium based browser and it works:
image

@devhindo
Copy link

chrome

Something must be blocking it from loading them, I'm using a chromium based browser and it works: image

It worked fine for today. Idk why maybe there was a load on the GitHub servers.

@stabenfeldt
Copy link

Is the hyperlink solution support only for flowcharts? (Haven't been able to implement with user journey chart)
+1

@kyouheicf
Copy link

Can you supoprt img tag for rendering the external image?

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