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

Add support for Markdown output #84

Closed
aayushmau5 opened this issue Feb 11, 2022 · 5 comments · Fixed by #90
Closed

Add support for Markdown output #84

aayushmau5 opened this issue Feb 11, 2022 · 5 comments · Fixed by #90
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers released

Comments

@aayushmau5
Copy link
Member

This library currently supports JSON, & YAML output.
We need to support Markdown output as well.

Check #75

Suggested solution:

Headings are names of changes, and then under each heading I guess you get a table of changes? could be nicely handled with IonicaBizau/json2md, so you just first slightly modify the default JSON output that you get as input for Markdown, and then run it through json2md to get markdown. No complicated Markdown templating needed, you only need to add some props to JSON

The format of md output

Subject to change, but my initial thoughts are as follows:

  • If user request a breaking, non-breaking or unclassified changes:

Breaking Changes

Action Path Before After isArrayIndex
remove /servers/google {} false
add /server/google/protocol http false
edit /server/google/something/1 some value new value true
  • If user requests all changes

All changes

Type Action Path Before After isArrayIndex
breaking remove /servers/google {} false
non-breaking add /server/google/protocol http false
unclassified edit /server/google/something/1 some value new value true

If you have other suggestions, drop them below :)

@shivensinha4
Copy link
Contributor

I'd love to work on this! Following up on our slack discussion, the structure of a Markdown diff will be similar to this, as it's hard to display large objects in the after and before columns of the table in a lucid format. The type of the data inside the dropdowns can be configured to be either JSON or YAML using the markdownSubtype option.

The WIP can be found at https://github.com/shivensinha4/diff, and I'll create a PR once the subtype option is added :)

@aayushmau5
Copy link
Member Author

@shivensinha4 Looking forward to the PR 🙂

@derberg
Copy link
Member

derberg commented Mar 17, 2022

@shivensinha4 how is it going, do you need some help?

@shivensinha4
Copy link
Contributor

Sorry for the delay! Got caught up in some stuff. I'm done with most of the code, will look for and make any documentation edits soon : )

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants