jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
192 stars 62 forks source link

Add support for audio admonition and embedded player #690

Open psychemedia opened 11 months ago

psychemedia commented 11 months ago

Video elements can be added via the {figure} admonition, (presumably based on suffix or mime-type detection, but there somewhere? I'm not sure what video filetypes are supported as well as mp4?) but support is not currently available for addiing audio files.

It would be useful to have an admonition similar in structure to the figure admonition ({audio}) for adding embedded <audio> player elements as well as "captions", a description etc. (Ideally, the admonition should accept a path to a local file or a URL to an audio file.)

It would also be handy to be able to optionally link to a transcript file; this would also be useful for video.

I also wonder how easy it is to add an "alias" for an admonition. Eg being able to use {video} as an alias for {figure} when referring to video assets?

welcome[bot] commented 11 months ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

rowanc1 commented 10 months ago

Love this idea. Expanding to a specific {video} or {audio} directive would allow us to add a few more options as well, e.g. #532.

psychemedia commented 10 months ago

I have a related Sphinx extension here — https://github.com/innovationOUtside/sphinxcontrib-ou-xml-tags/blob/main/sphinxcontrib/audio.py — for an ou_audio tag; but native support would be useful.