bavovanachte / sphinx-wavedrom

A sphinx extension that allows including wavedrom diagrams by using its text-based representation
MIT License
32 stars 18 forks source link

Add support for the wavedrom CLI #23

Closed bradleyharden closed 3 years ago

bradleyharden commented 4 years ago

As mentioned in #22, it would be nice to have full control over the rendered image, as if it were inserted with an image directive. Unfortunately, this is not possible with wavedrom's current implementation of live-rendering. wavedrompy is a workaround, but it has become out of date. Instead, we can provide support for the wavedrom CLI. We can use it to generate images locally and insert them as we do with images from wavedrompy.

My plan is to make this completely opt-in. Users will need to install the wavedrom CLI themselves and make sure it is available on the PATH. I will add another configuration option to enable the CLI instead of the existing wavedrompy.

I already have a working prototype of this that I created for my own use. I need to clean it up, add some error checking and add the configuration variable.

bavovanachte commented 3 years ago

Hi, just checking in: did you make any progress on this? I'm trying to assess if it makes sense for me start the implementation from scratch or wait for a PR from your side. In case you're swamped at the moment, could I build upon your current work?

bradleyharden commented 3 years ago

See #27.

bavovanachte commented 3 years ago

@bradleyharden Could I ask you to test alfa release 3.0.0a1? The plugin will now default to the use of wavedrom-cli instead of wavedrompy, so shouldn't require any configuration changes on your side.

bavovanachte commented 3 years ago

@wifasoi In case this is of interest to the SpinalHDL project, could you test it as well?

bradleyharden commented 3 years ago

@bavovanachte, sure I'll try it out this weekend

bradleyharden commented 3 years ago

@bavovanachte, I had already installed sphinx-wavedrom with pip install -e, so I just updated the repository to master. Let me know if you wanted me to test installing from PyPI as well.

Everything seems to have worked just fine, without any modification on my end. I had already set wavedrom_html_jsinline = False, so I just re-ran my Sphinx build. The output looks the same.

However, note that I only have one reST file and one wavedrom image in my test repository. I didn't want to create anymore until I was more certain of how I should implement it.

bavovanachte commented 3 years ago

Thanks for checking! As your test setup is a bit limited, I'll run some more tests on different projects to verify

bavovanachte commented 3 years ago

Officially release in https://github.com/bavovanachte/sphinx-wavedrom/releases/tag/3.0.0.