From: Agathe P. <mic...@mi...> - 2022-05-03 14:23:27
|
Hi, 29/04/2022 10:54, Guenter Milde : >> However, according to the documentation [1], this should export a >> <video> tag instead of a <img> tag given that the file extension is ".mp4". > It seems that Pelican (at least with your configuration) uses the > traditional HTML4 writer for HTML export. > > Only the `HTML5 writer`_ supports video. Finding out how/whether Pelican > can be configured to use the HTML5 writer is left as an exercise for the > reader. > I was able to configure pelican to use html5_polyglot using rst_with_html5 Pelican plugin [1]. As I dig further and further into html5_polyglot, I am sad to see that <video> has no first class support in reStructuredText. I did a local patch to add more attributes to the renderer, then another patch for allowing alternative source format, but I think that a new video class should be added instead of hacking the image class so deeply. This has been done in a plugin for sphinx [2]: full support of a distinct video node that can support extra attributes. One quirk of using "classes" for detecting {loop,controls,autoplay} is that the video keeps the "loop" CSS style class, which seems not useful and can conflict with CSS classes. I was not able to see prior discussion for proper video support in docutils using a search engine. Please enlighten my light if anything seems wrong with this proposal. I can volonteer to implement this feature and document it for docutils. I think it would be better than the current two alternatives: using out-of-tree plugins or hacking image nodes. Bests, Agata [1] https://github.com/bekcpear/pelican-rst_with_html5 [2] https://github.com/sphinx-contrib/video/blob/master/sphinxcontrib/video.py |