-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: Implemented transformer for the wavedrom library #1503
feat: Implemented transformer for the wavedrom library #1503
Conversation
✅ Deploy Preview for slidev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
165833b
to
a0ea6fb
Compare
2913e6c
to
538851c
Compare
538851c
to
04954e8
Compare
Thanks for your contribution! Can this feature be used as a standalone addon package? If not, what's the missing hook? |
I think it can be an addon, I just don't know where to find the documentation on how to use a hook. I would be very happy to convert it. |
About addon writing: https://sli.dev/addons/write-an-addon You can have setup and components folder in your addon, just like in your slides folder. |
I saw this, but is there any API documentation? |
Here we can register a markdown-it plugin for waredrom: https://sli.dev/custom/config-vite#configure-internal-plugins |
I am sorry, I still do not understand how to connect my plugin to slidev.
How to I make it initialize my plugin? This is really confusing here, an API documentation and example would be great. |
This looks very cool! But yeah I agree with @KermanX, I also think it's better to implement it as an external addon. |
There seem to be some difficulties in having a custom transformer... The priority of markdown-it plugins are too low. The preparser may help, but I don't think it is graceful enough. Maybe we need a type MarkdownTransfromer = (ctx: MarkdownTransformContext) => void
type TransformersSetup = (transformers: MarkdownTransfromer[]) => MarkdownTransfromer[] |
Sorry for the late reply. These days several refactors are done and I've tested that after #1767 got merged, this PR can be implemented as an add-on in a simple way. |
Description
This pull request implements a transformer for the wavedrom library. It allows writing waveform diagrams in the slides.
This allows writing wavefrom diagrams using the
wavedrom
transformer.Why
This is useful when creating engineering slides. Without this feature, users have to manually transform the waveform JSON into SVG files and include those.
Disadvantages
wavedrom
,onml
andjson5
dev dependenciesonml
depends on two deprecated packages