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/adds markdown support #549

Merged

Conversation

robert-henke
Copy link
Contributor

Hi, this pull request considers the requested markdown support described in #542 . It uses ngx-markdown with enabled mermaid and prismjs support. It allows to use markdown syntax in all description fields.

Copy link

netlify bot commented Jan 18, 2024

Deploy Preview for springwolf-ui ready!

Name Link
🔨 Latest commit 2e0b8a0
🔍 Latest deploy log https://app.netlify.com/sites/springwolf-ui/deploys/65b3bd3515aa820008e74b6b
😎 Deploy Preview https://deploy-preview-549--springwolf-ui.netlify.app/springwolf-ui/asyncapi-ui
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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 Springwolf. Thanks a lot for creating your first pull request. Please check out our contributors guide and feel free to join us on discord.

@timonback
Copy link
Member

Thank you @robert-henke for this contribution!

To showcase this on our demo website, it is best to also update at least the description of the examples/kafka-example application as well. The new description could be something like the existing one, new line, ˋmarkdownˋ syntax is supported as well. (I am open for creative suggestions as well)
Possibly showcase also a line of code as you included prism?
Can you do that?

Do you know how prism compares to highlightjs, which we already use to render json?

Mermaid is a larger dependency, so I am hesitant to include it just because ngx-markdown supports it. Do you have a specific case in mind, where you want to visualize a diagram in the info section and/or the channels?

@robert-henke
Copy link
Contributor Author

robert-henke commented Jan 19, 2024

Hi @timonback I added some example texts for the description fields. Let me know if the provided examples meet your expectations.

Considering the mermaid lib: We would like to add some flow charts and / or sequence diagrams to document message flows between services. However, this is not essential for us, as we could simply include an image with the diagram. It would just be nice to have a single source of code for further adaptations of diagrams etc.

The prismjs lib is used by ngx-markdown to highlight code fragments inside code blocks. I could not find a (documented) way to use highlightjs for this purpose. That is why I included the prismjs dependency as well. The lib is used by markdown by simply adding the required language as part of a text block syntax in markdown (e.g. " ```json "). I included an example for code highlighting as well.

@timonback
Copy link
Member

Hi @robert-henke
Thanks for the input and fair enough.

Can you run the kafka example (integration) test gradle target?
You can use the asyncapi.actual.json file as a reference on how to adapt the asyncapi.json file.
Then it will be shown on this PR's preview and I will review the rendered output: https://deploy-preview-549--springwolf-ui.netlify.app/springwolf-ui/asyncapi-ui

Maybe we can also replace highlightjs with prismjs. We use highlightjs only for json rendering, I believe. I can look into it the next weeks

@robert-henke
Copy link
Contributor Author

Hi @timonback I adapted the json file as proposed, I also had to add some minor adjustments to the OpenApiGeneratorSystemTest. The kafka example test target should run without errors now. Let me know of any other required adjustments.

From my (limited) understanding of prismjs and the current use of highlightjs I could imagine that it is absolutely possible to realize those use-cases with prismjs as well.

@timonback timonback force-pushed the feat/adds-markdown-support branch from 081dff0 to 2e0b8a0 Compare January 26, 2024 14:09
@timonback
Copy link
Member

We decided to remove mermaid support as the dependency because we are unsure about the use-case. To us, it seems like that you try to document something that should be located in other tools (Confluent, Backstage, ApiHub) that gives a broad overview over all services - not a single one).

Also, the dependency is rather large and as soon as we add it, we will have to support it forever.


Still, thank you for this very nice addition and the work you have put into it. It will be part of the next release 🚀

@timonback timonback merged commit 96e3b06 into springwolf:master Jan 26, 2024
16 checks passed
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