Closed ffeppon closed 3 years ago
Thanks,
I will check why checks failed asap and merge things.
Some quick answers:
But have a way to manage the spacing in "auto" mode could be a great thing, if the empty text does the trick for the moment it's great, but I will think of adding a "spacer" element.
I'm also planning to introduce the same kind of box model like the one of css (with padding, margin and border)
fix a bug (not sure this was a bug?) with y-positioning. Before, doing text('Test',y=0.5) was not placing the text at the middle of the slide.
It was not a bug, but rather an historical thing as we start with all sizes relative to the width of the presentation. But it was planned to move to the "height" of the slide for y position given in percentage. So I will merge your change and add a warning for old presentation if they want to revert to the old way with:
DEFAULT_Y['unit']
= 'width'
at the beginning of their presentation.
Dear Hugo
Your correction does not work because self.width.value is set by default to the document width at lines 155-156
if self.width is None:
self.width = document._slides[gcs()].curwidth
That is why I was relying on "self.args" instead of self.width. Maybe this part requires a bit of cleaning then ?
Thanks
Ok, maybe we could say that:
When no height and no width are given take the current width for this image (which is the width of the current group where your adding your image), so when self.width and self.height are None.
We could change lines 155 - 156 to:
if self.width is None and self.height is None:
self.width = document._slides[gcs()].curwidth
Then on the render method keep testing on self.width.value and self.height.value (the .value comes from the register method which re-assign the self.width and self.height variables to a Length object via the the update_size method, not very clever but I will change that in the future to make things a bit less confusing).
Does it works on your side with those changes ?
We should also change around line 345
else:
out_img = resize_raster_image(tmp_img, max_width=self.positionner.width.value)
to
else:
out_img = resize_raster_image(tmp_img, max_width=figure_width)
Best. Hugo.
Dear Hugo,
Here are the changes I am proposing :
Thanks any way for this library. This is the first thing a bit serious I find to write HTML5 slides without knowing anything from HTML5, but only a bit of beamer knowledge. I find that the writing of the library is rather well-organized and well-understood. I was able to understand and implement these changes after a few hours discovering the package. I might contribute if I need extra things. A thing which also would be nice would be letting the user the possibility to have graphics (images, videos) to be included through relative links and not in a gigantic html. Because the browser might take time to load all the videos at once.
Best Florian