Code Monkey home page Code Monkey logo

Comments (7)

bradleyharden avatar bradleyharden commented on June 2, 2024

I don't know much about HTML, but I was able to easily edit the output of Sphinx to get what I want. I only had to change the SVG height to auto and the width to a custom value. Would it be possible to set image dimensions from the reST directive for live-rendered plots? It seems like it would probably be pretty straightforward.

from sphinx-wavedrom.

bavovanachte avatar bavovanachte commented on June 2, 2024

Hi,

  • I'll try to take a look at this still this week. I'm a bit swamped at the moment though, so can't promise much. Any concrete input from your trials would be welcome (the actual html changes you made, the actual diagram if you're allowed to share it) and could speed things up.
  • As for the wavedrompy part, I'm sure @wallento would be interested in the different behaviour you noticed (maybe in an issue in the wavedrompy project, not here 😄 ) Getting the wavedrom-cli tool integrated would also be cool, but I don't see that happening short-term

from sphinx-wavedrom.

bradleyharden avatar bradleyharden commented on June 2, 2024

I did some research. It looks like it's not really possible to change the scale when live-rendering. The image tag doesn't exist until the JS runs, and Wavedrom does not have the ability to set the width or height of the output from javascript. You get what you get.

However, the wavedrom-cli is dead simple to use. I think that is the best path going forward. It's not a Python dependency, but it's not difficult to install. I appreciate what @wallento has done with wavedrompy, but I don't know that it makes sense to maintain an entirely independent rendering engine when wavedrom-cli exists. It makes the system Python-only, but it comes at the cost of a significant maintenance burden. He even mentions in the code for wavedrompy

# Originally translated to Python from original file
# Now many parts have been rewritten and diverged

We've already seen that it has become out of date as Wavedrom has evolved.

I think I can add support for the wavedrom-cli fairly easily. Would you accept a PR? I don't think we need to install it for the user though. I think we can just provide instructions on how to install it manually in the README. Do you like that approach?

from sphinx-wavedrom.

bradleyharden avatar bradleyharden commented on June 2, 2024

By the way, right now wavedrom-cli can only write to and read from files. You can't pipe data to or from it. In the first iteration of wavedrom-cli support, I would use temporary files. But I would also like to make a PR to wavedrom-cli to add support for piping. It used to support piping, but something about the interface was changed, and support was dropped. I think it will be easy to add it back though.

from sphinx-wavedrom.

bavovanachte avatar bavovanachte commented on June 2, 2024

I think I can add support for the wavedrom-cli fairly easily. Would you accept a PR?

I'd absolutely welcome such a PR.

I don't think we need to install it for the user though.

Agreed. I think we can assume that the user has installed it and the executable is in the path. We can indeed link to the installation instructions in the README

In the first iteration of wavedrom-cli support, I would use temporary file

I'm fairly sure that's also how the plantuml sphinx plugin works. Seems like a good start to me!

from sphinx-wavedrom.

bavovanachte avatar bavovanachte commented on June 2, 2024

For clarity, could you close this issue and open a separate one for the wavedrom-cli integration?

from sphinx-wavedrom.

bradleyharden avatar bradleyharden commented on June 2, 2024

Sure. See #23.

from sphinx-wavedrom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.