sphinx-contrib / plantuml

BSD 2-Clause "Simplified" License
115 stars 42 forks source link

SVG output width and height for HTML output #71

Closed ndee02 closed 1 year ago

ndee02 commented 1 year ago

Currently, the :width: and :height: properties are ignored for SVG outputs. This is a bit annoying, as for PNG, the output image is properly resized if you specify those properties. In addition, SVG offers much better options to define the display size (as the name suggests, it is a scalable vector graphic): percentages for width are a feasible option.

I had a look at the code, and for SVG, it currently just copies the calculated width and height in pixels from the SVG and puts it to the <object> tag. I suggest to substitute width and height with the properties given to the directive instead. :width: 100% would work nicely for SVGs and HTML output. An additional consideration would be to add also a :max-width: property.

It seems it would at least partially address other user's findings:

yuja commented 1 year ago

Makes sense. Apparently, this is just not implemented yet after 210a47fc9da5 and 64a571f1ed28.

ndee02 commented 1 year ago

resolved in #72