chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
29 stars 4 forks source link

Embedded items in markdown should have a nicer PDF output #78

Open georgestagg opened 3 years ago

georgestagg commented 3 years ago

E.g. Added videos with e.g. looks nice in HTML, but the PDF version does not.

christianp commented 1 year ago

This markdown page:

THis is some text.

<embed-numbas data-url="https://numbas.mathcentre.ac.uk/exam/1973/numbas-website-demo/embed/"></embed-numbas>

THis is more text.

<youtube-embed data-id="EdyociU35u8"></youtube-embed>

Final text!

looks like this in HTML:

image

and looks like this in PDF:

Screenshot 2023-09-15 at 13-14-32 untitled_chapter pdf

The embedded Numbas test doesn't show up at all - I think it didn't wait for the custom element to finish loading before rendering the PDF. The YouTube embed shows a black screen with a play button, and no title. I'm not sure if there's anything we can do to make that better - there must be a reason YouTube doesn't show the title and cover image.

christianp commented 1 year ago

It looks like the YouTube player deliberately sticks that black box over the interface in print media. Maybe they don't want the UI controls to be printed, and haven't bothered implementing a good print alternative?