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

feat: mermaid markdown #208

Closed

Conversation

josephinoo
Copy link

Description

  • ...
  • ...
  • ...

Related issue(s)

Copy link

@github-actions github-actions bot left a 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.

@josephinoo josephinoo changed the title Feature/mermaid markdown feat: mermaid markdown Feb 22, 2024
@josephinoo josephinoo force-pushed the feature/mermaid-markdown branch from 925d245 to e93d2bc Compare February 22, 2024 00:16
Copy link

sonarcloud bot commented Feb 22, 2024

Quality Gate Passed Quality Gate passed

Issues
3 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

import * as fs from 'fs';
import * as yaml from 'js-yaml';

interface AsyncAPIDocument {
Copy link
Collaborator

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`;
Copy link
Collaborator

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">
Copy link
Collaborator

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..

@ivangsa
Copy link
Collaborator

ivangsa commented Feb 22, 2024

Hi @josephinoo thanks for this work!!

I'm merging this so you and @nikhilkalburgi can collaborate on this

Copy link
Collaborator

@ivangsa ivangsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not merge

@ivangsa ivangsa closed this Feb 22, 2024
@ivangsa
Copy link
Collaborator

ivangsa commented Feb 22, 2024

@josephinoo you should create the PR to the branch feature/mermaid-markdown not master

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

Successfully merging this pull request may close these issues.

2 participants