-
Notifications
You must be signed in to change notification settings - Fork 109
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
Wavedrom support #89
Comments
Looks like a perfect fit for asciidoctor and the diagram extension. I couldn't find any documentation on the CLI interface. Just as a note to self, based on the code, the way to invoke it is |
@JmyL I've made an initial attempt at integrating wavdrom support using the CLI version. On Mac OS X it doesn't work correctly yet. The command line arguments that I pass to nw.js aren't reaching the application ( I have some unfinished code lying around that used phantom.js to run javascript code. I'll have a look at using that to drive the javascript code directly rather than using the nw.js wrapper. |
Proper CLI would be: WaveDromEditor source <input file> <output type> <output file> I have some old phantomjs version of CLI tool, but I was thinking that pure nodejs CLI tool would be better. Working on it now. |
Adding the missing 'source' keyword did the trick. Thanks! |
The code is all there and the unit tests are passing. I manually inspected the PNG and SVG files that get generated during the tests and they correct to me. Once Travis gives the green light on Linux, I'll merge the feature branch and cut a new release. |
I had to disable the unit tests in the end since wavedrom can't run headless at the moment. I've merged what I have already, but using phantom.js is probably the way forward after all since that's designed to run on servers. |
Incredible! 👍 |
You're welcome. Let me know if you run into any issues with the integration. You'll probably be the first to kick the tires... |
I second that. 👍 |
@pepijnve Great job! |
@drom for the asciidoctor-diagram integration itself it doesn't really matter. It invokes wavedrom as a subprocess so it isn't dependant on the technology you're using to implement it. The consequence of using nw.js for the WaveDrom CLI is that it can't run on a headless server. This restricts where asciidoctor-diagram users can use this integration. Running it on your typical CI server for instance is not possible. There's an issue open for this in the nw.js project (nwjs/nw.js#769). I think the simplest solution for this problem is to also provide a CLI wrapper for wavedrom that uses phantom.js. phantom.js is explicitly designed to run in headless server environments. The Mermaid diagram generator has a phantom.js based CLI wrapper that provides a good example of how this can be done (see https://github.com/knsv/mermaid/blob/master/bin/mermaid.js and https://github.com/knsv/mermaid/blob/master/lib/cli.js). |
100% |
@pepijnve @mojavelinux Done! PhantomJS version of WaveDrom CLI tool is here: |
d0b09c7 makes asciidoctor-diagram look for wavedrom-cli first and falls back on wavedromeditor. Just ran the specs and seems to work as intended. I ran into one small quirk: if the output file does end with '.png' then no output is generated. This doesn't happen when generating svg files. Not a big deal; I worked around it in the code. |
It would be nice to have Wavedrom(https://github.com/drom/wavedrom) as an preprocessing extension.
It is 4 years old open-source software, It's really cool to adding waveform in documents.
It's implemented with javascript, but it also served as an executable cli version on here: https://github.com/wavedrom/wavedrom.github.io/releases
The text was updated successfully, but these errors were encountered: