chirun-ncl / chirun

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

PDF of slide output has a few style problems #186

Closed chrismgraham closed 1 year ago

chrismgraham commented 1 year ago

The PDF looks quite different from the slides. The main things are:

christianp commented 1 year ago

The text is indeed smaller, and I can't see why. In print preview in both Chrome and Firefox, it looks OK.

I don't think the maths is white, I think the fonts hadn't loaded at the point the PDF was saved. Last week I put in a check to wait for MathJax to finish, but clearly not a robust one!

I guess the problem with runnable code is that the custom element hasn't loaded. More stuff to wait for!

chrismgraham commented 1 year ago

That makes more sense regarding the maths!

christianp commented 1 year ago

Ahh, the code to render markdown slides to PDF is duplicated, and I didn't add the mathjax code to that!

christianp commented 1 year ago

The runnable code custom element doesn't run because the page is loaded with file://. Now, do we run pyppeteer with security off, or do we start a web server?

christianp commented 1 year ago

Turns out pyppeteer is fixed to use a really old version of Chromium which doesn't support the null coalescing operator ??, among other things. Forcing it to use the latest revision with PYPPETEER_CHROMIUM_REVISION=1181205.

You have to have that environment variable set when you run pyppeteer-install, and then whenever you run chirun. For the docker image, we'll need to take the chromium version as a build arg and then set it as an environment variable in the Dockerfile.