thegetty / quire

A multi-package repository for the Quire multiformat publishing framework
https://quire.getty.edu/
BSD 3-Clause "New" or "Revised" License
98 stars 12 forks source link

DEV-13317: Display embedded media URLs in figure captions in print output #646

Closed anderspollack closed 1 year ago

anderspollack commented 1 year ago

This PR implements a new figure sub-component, media-embed-url which creates an embedded media player src URL and an original source URL for each media host (soundcloud, vimeo, youtube). The audio and video element.js sub-components have been refactored to use media-embed-url.

Figure captions now use media-embed-url to optionally display a link to the original source of the embedded media. This only displays when passing mediaId and mediaType kwargs to figureCaption -- the video/print.js and audio/print.js outputs use this to display media source links in print output only. I had originally tried to split figureCaption into separate print.js and html.js outputs, but since figureCaption is composed in output-specific figure components (video/print.js / video/html.js and audio/print.js / audio/html.js), it renders both print and html variants -- something to look into in the future perhaps.

Please also review corresponding style changes to display media embed links on their own line: https://github.com/thegetty/quire/pull/646