Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slideshow: update image template for managed directories #2156

Closed
wants to merge 4 commits into from

Conversation

oscarlevin
Copy link
Member

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
Copy link
Collaborator

rbeezer commented Apr 20, 2024

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
Copy link
Collaborator

rbeezer commented Apr 20, 2024

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
Copy link
Contributor

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Collaborator

rbeezer commented Apr 22, 2024

Much better! ;-)

  • Why a span and not a div? Won't the block-level div.image-box be illegal inside the inline-level span.fragment?
  • Rather than two xsl:if, I'd suggest a choose/when/otherwise.
  • Experiment for the benefit of your XSL-fu: inside the match add and (@pause = 'yes') and then have the template simply do the wrapping straight-away with no conditionals inside the body of the template. I think that test is OK inside the match (but could be mistaken, so test first).

@oscarlevin
Copy link
Member Author

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

rbeezer pushed a commit that referenced this pull request Apr 23, 2024
@rbeezer
Copy link
Collaborator

rbeezer commented Apr 23, 2024

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

@rbeezer rbeezer closed this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External images in slideshows do not consider the publication file
3 participants