next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.38k stars 421 forks source link

Hope to integrate WaveDrom like mermaid #536

Closed POMIN-163 closed 1 year ago

POMIN-163 commented 2 years ago

Hope to integrate WaveDrom like mermaid.

when i installed next theme, i can use this to render a pie chart.

{% mermaid pie %}
"Dogs" : 386
"Cats" : 85
"Rats" : 15
{% endmermaid %}

Similarly, WaveDrom can render the wavejson to a wave picture, use https://svg.wavedrom.com to generate a svg.

such as this:

<img src="https://svg.wavedrom.com/{signal:[{name:'clk',wave:'p......'},{name:'bus',wave:'x.34.5x',data:'head body tail'},{name:'wire',wave:'0.1..0.'}]}"/>

preview:

the WaveDrom site: https://github.com/wavedrom/wavedrom I sincerely invite you to try it. It's so amazing.

welcome[bot] commented 2 years ago

Thanks for opening this issue, maintainers will get back to you as soon as possible!

stevenjoezhang commented 2 years ago

You can simply use markdown image tag, e.g.

![](https://svg.wavedrom.com/...)
r12f commented 1 year ago

I have worked on this issue and made it work, since it makes using wavedrom much easier as well as avoiding sending request to the rendering server (long payload can cause failure and has other problems). @stevenjoezhang, do you mind to help see if this makes sense? If so, I can help make more changes to doc and the plugin repo and send out the PRs.

https://github.com/r12f/hexo-theme-next/commit/476811b374849ecee1d52364407794ce3239b5d9

r12f commented 1 year ago

I cannot reactivate this issue, so please let me know, if a new issue is preferred for discussion

stevenjoezhang commented 1 year ago

@r12f pull requests are welcomed 🤩

r12f commented 1 year ago

awesome! I have made these 3 PRs here:

First time making the PR, so might miss things. Please let me know, if anything needs to be changed!

Also, please let me know how to activate this issue, or we prefer to open a new one. Will be more than happy to do it.

github-actions[bot] commented 2 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.