-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: mermaid markdown #208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
925d245
to
e93d2bc
Compare
Quality Gate passedIssues Measures |
import * as fs from 'fs'; | ||
import * as yaml from 'js-yaml'; | ||
|
||
interface AsyncAPIDocument { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not create/maintain this interface, use @asyncapi/js-parser for this, of just use
const asyncAPIDocument: AsyncAPIDocument = yaml.load(yamlFile) as AsyncAPIDocument; | ||
let mermaidCode = `flowchart TD\n`; | ||
|
||
mermaidCode += ` subgraph "${asyncAPIDocument.info.title}"\n`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a good start but I should evolve to use some templating engine for js
I have used https://ejs.co/ for this kind of templates, but feel free to propose any other one..
<div id="asyncapi"></div> | ||
|
||
<pre class="mermaid"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this would be on a different preview-panel, started by a different command..
Good if it helps you start seeing something..
Hi @josephinoo thanks for this work!! I'm merging this so you and @nikhilkalburgi can collaborate on this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not merge
@josephinoo you should create the PR to the branch |
Description
Related issue(s)