napari / napari-animation

A napari plugin for making animations
https://napari.github.io/napari-animation/
Other
74 stars 27 forks source link

Docs: give embedded videos responsive size #205

Open GenevieveBuckley opened 5 months ago

GenevieveBuckley commented 5 months ago

This nice to have to-do item came up during development of https://github.com/napari/napari-animation/pull/200

https://github.com/napari/napari-animation/pull/200#issuecomment-1914100665

Responsive (or percentage based) sizing of embedded videos. This currently isn't supported by the sphinx video plugin, so we'd have to either modify that or write our own HTML template string. (https://github.com/napari/napari-animation/pull/200#discussion_r1465848115)

https://github.com/napari/napari-animation/pull/200#discussion_r1465848115

I don't like this part. Currently it sets the width of the embedded video to 500 pixels. I'd prefer it was a percentage of the page width instead (i.e. more responsive to different screen sizes). I don't think you can do that easily with sphinxcontrib-video as it currently exists, so maybe we should replace this dependency with a template docstring of the HTML we need to embed in the RST document, so we can have more control over the output result. Docs: https://github.com/sphinx-contrib/video

psobolewskiPhD commented 5 months ago

There is an upstream PR for this: https://github.com/sphinx-contrib/video/pull/26 but alas it might be withering on the vine.