MartinPacker / md2pptx

Markdown To PowerPoint converter
MIT License
222 stars 35 forks source link

Support audio / video #108

Closed MartinPacker closed 2 years ago

MartinPacker commented 2 years ago

It's not clear to me how / whether Markdown or HTML could support a direct link to audio or video. python-pptx, however, definitely can.

(Personally, I don't have a pressing need for this. But if it's easy to use I just might.)

MartinPacker commented 2 years ago

HTML 5 has <audio> and <video> elements. These are perfectly reasonable things for a user to code - even in Markdown (as it can contain HTML).

One slightly tricky thing is the layout dimensions. I think for <video> the width and height attributes could be used for the proportions, rather than being treated as actual pixel values.

MartinPacker commented 2 years ago

This is coming along but it's causing mass refactoring of the image rendering code - including the creation of a parseMedia function. This refactoring has already simplified the code and fixed a few edge cases.

MartinPacker commented 2 years ago

Pushed code that supports

MartinPacker commented 2 years ago

Pushed further code that supports retrieving video from the web.

<audio> support remains to be done, as does documentation.

MartinPacker commented 2 years ago

In HTML the <audio> element doesn't have height or width attributes. I think it should probably have a square aspect ratio. When I support it I'll code it that way.

MartinPacker commented 2 years ago

<audio> support is done. As is documentation. All on the trunk.

MartinPacker commented 2 years ago

Shipped in v3.0.