Cool idea: https://shkspr.mobi/blog/2021/02/minimum-viable-tweet-to-svg-2/
However, I couldn’t make it work well enough for me. This is a log of my experiments. The writing is not polished and there very well may be mistakes.
Later, I found https://tweet.cluster.fun, which is a Go implementation of edent’s original idea. To make this work, they have to calculate the SVG height. ulated height is then hard-coded in the resulting SVG file. In theory, I could do something similar in Python, but I haven’t tried yet.
- First attempt: Generating SVG files
- Second attempt: Calculating the size in JavaScript
- Third attempt: bounding rects, bboxes, …
To try:
-
https://stackoverflow.com/questions/47461260/why-does-getcomputedstyle-appear-to-be-the-only-commonly-used-method-to-retur the
height
CSS property does not include the padding or the border unless you’ve gotbox-sizing: border-box;
set. I tried this after the second attempt above with at least one thing. What I tried didn’t work. (Problem is there are so many different things, so I’m not sure if there is some other way to do it that would work.) -
This did not work for me at all https://www.dyn-web.com/tutorials/iframes/height/