diff
diff copied to clipboard
Support different types of output
Reason/Context
- Why we need this improvement? Since, this library currently supports showing diff in a JSON format. I think it would be good to have more different ways of showing the output. For example, we can show the output in YAML, HTML or Markdown format.
- How will this change help? This library will have more ways of showing the output, and since, this library will be integrated into AsyncAPI CLI and playground, we will have the ability to show different type of output on those platforms as well.
- What is the motivation? Extend this library :)
Description
-
Detailed description: Current JSON format only goes so far, we need to provide more ways to show the diff. For starters, we can show the output in HTML as well as Markdown format. And then, as need arises, we can focus on having other different types of output as well(like YAML, etc.)
-
How could it be implemented/designed? The implementation is not really clear right now(I'll be working on that now), but since the diff generates JSON output, we need to convert this JSON output into HTML, Markdown. As for how this HTML, Markdown format will look like, we need to have a detailed discussion on that as well. I'll be working on an initial draft for the output, and from there we can flesh out the design.
adding YAML will be easiest, so I guess focus on this one first
for HTML best would be to engage with @magicmatatjahu and @mcturco as it would be nice to generate something that could be easily reused in Studio
form Markdown, I think this one is less complicated, headings are names of changes, and then under each heading I guess you get a table of changes? could be nicely handled with https://github.com/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
Sounds like a plan :D I will start working on YAML output first, and then for HTML, I will make a separate issue to discuss the format and stuff.
For YAML, I guess I can use some JSON to YAML library :thinking:
For YAML, I guess I can use some JSON to YAML library
definitely
YAML done!
Next up, markdown.
@derberg Regarding https://github.com/asyncapi/website/pull/599
You said:
If you maintain one of AsyncAPI tools, please come up with at least one issue that is easy to fix in a month without having a good knowledge of AsyncAPI.
Perhaps we can do Markdown output or HTML output as an issue. What do you think?
Definitely. Can be both but as 2 separate issues
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
Status update: currently adding support for markdown output from diff in CLI. After that, I'll start working on HTML output for this library :)
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart: