-
Notifications
You must be signed in to change notification settings - Fork 438
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 wavedrom support. #655
Conversation
Thanks so much for opening your first PR here! |
Pull Request Test Coverage Report for Build 5054503871
💛 - Coveralls |
_vendors.yml
Outdated
@@ -172,3 +172,13 @@ creative_commons: | |||
version: 2020.11.3 | |||
dir: assets/license_badges | |||
alias: creativecommons-vocabulary | |||
wavedrom: | |||
name: 'wavedrom' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove single quotes in this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. removed.
_vendors.yml
Outdated
name: 'wavedrom' | ||
version: 3.2.0 | ||
file: skins/default.min.js | ||
integrity: sha512-SDH/iWIRSg0ujndO7Np7wyJF/zs8JHp4tHKU4VJuraJ3ASd2sVorT/3uA2xnHthywvei4/fJYz8Lsbr1SChYBQ== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_vendors.yml
Outdated
wavedrom_skin: | ||
name: 'wavedrom' | ||
version: 3.2.0 | ||
file: skins/default.min.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skins/default.min.js
does not exist in its npm version. You need to change it to skins/default.js
and re-calculate its integrity value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. moved to default.js now.
NexT.utils.getScript(CONFIG.wavedrom.js, { | ||
condition: window.WaveDrom | ||
}).then(() => { | ||
NexT.utils.getScript(CONFIG.wavedrom_skin.js).then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Condition for CONFIG.wavedrom_skin.js
is window.WaveSkin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Didn't add it since it is in the then block. It is fixed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
demo page is also updated now: https://r12f.com/posts/use-wavedrom-in-hexo/
Thanks for your contribution 🎉 |
Congrats on merging your first pull request here! 🎉 How awesome! |
Woot! Thank you so much for helping me and review!!! 🎉🎉🎉 |
PR Checklist
PR Type
What is the current behavior?
Currently next theme doesn't have wavedrom tag support, and we will have to use markdown image tag to send to wavedrom rendering server to generate the graph. However, this approach can be slow. And if the code is long, the request will fail. Hence, it is better to add wavedrom code block rendering support within the theme.
Issue resolved: Rendering wavedrom code block.
What is the new behavior?
After the change, we can directly add wavedrom code and render it as graph.
How to use?
In NexT
_config.yml
:Then write code like below: