PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
254 stars 202 forks source link

slideshow: update image template for managed directories #2156

Closed oscarlevin closed 1 week ago

oscarlevin commented 2 weeks ago

Replaced the simple image template with a tweaked override of the html non-sidebyside image container. Now images in reveal.js slideshows will behave just like html images, except if they are bare images they can have a @pause.

In particular, this will respect managed directories. Closes #2155 .

rbeezer commented 2 weeks ago

Long post just now on -dev responding to general strategies in play here.

Without any testing, a question. How do the images behave with an image-box, etc. The sort-of automatic scaling that RevealJS does always gives me fits when I use a presentation. I can usually manage decorative images (e.g. a textbook cover), but other times I need to use my browser's zoom-in or zoom-out to temporarily get a single slide usable. Any observations?

rbeezer commented 2 weeks ago

Shoulda also said. Thanks for hopping on this one. I was going to address the managed directories (and not much more!), so thanks for being more comprehensive. ;-)

kcrisman commented 2 weeks ago

Without any testing, a question. How do the images behave with an image-box, etc. The sort-of automatic scaling that RevealJS does always gives me fits when I use a presentation. I can usually manage decorative images (e.g. a textbook cover), but other times I need to use my browser's zoom-in or zoom-out to temporarily get a single slide usable. Any observations?

Can you give an explicit example of that (if you happen to have one on the web, this is a request not a demand)? I've not had that problem, but perhaps my custom code dealing with sizing meant I accidentally avoided that problem.

oscarlevin commented 2 weeks ago

I did very little use testing, only made sure that the htm was doing better. This all came about because I wanted to put a qr code in my presentation yesterday and realized that it was always getting blown up too big, no matter what width I was adding.

I agree the auto resizing is annoying. I need to zoom out on the title page often, and then zoom back in when there is an image, since that is the best way to make the image smaller, when the text gets larger.

oscarlevin commented 2 weeks ago

Second attempt, using a modal template to set the @class on the img as either image-box or fragment in the reveal.js conversion. I'm not sure which is better; both approaches work as intended.

No need for any sidebyside modifications, as the reveal.js conversion already handled that correctly.

oscarlevin commented 2 weeks ago

Third time's the charm I think. Using <xsl:apply-imports> makes it easy to wrap any image that has a pause attribute with a span with @class="fragment" and then include the image template from pretext-html.

rbeezer commented 2 weeks ago

Much better! ;-)

oscarlevin commented 1 week ago

Ah, that's much cleaner. Should be ready for squashing.

rbeezer commented 1 week ago

Looking good. Thanks for working through this one. The addition of an extra div made this a lot cleaner. I hope the XSL-fu has increased.

While I'm at it see: #2159