Skip to content

Add in-subslide function#229

Open
alexarice wants to merge 3 commits intopolylux-typ:mainfrom
alexarice:main
Open

Add in-subslide function#229
alexarice wants to merge 3 commits intopolylux-typ:mainfrom
alexarice:main

Conversation

@alexarice
Copy link

Fixes #228.

Adds an in-subslide function as discussed in #228 for programmatically checking whether you are in a certain subslide. Also refactors _conditional_display to use this function.

I wasn't sure if there's a test suite I can run to check this doesn't break anything, or if I need to update documentation somewhere, but happy to do this if pointed in the right direction.

@alexarice
Copy link
Author

It seems this has broken something when I check it locally, will try to investigate

@alexarice
Copy link
Author

Ok, I think i understand slightly more about context now. It shouldn't be possible to update the repetitions in in-subslide, as I believe you need some content to "link" the counter update to. I've reverted this part of the change.

Comment on lines 106 to 112
let vs = if reserve-space and handout-mode.at(here()) {
(:)
} else {
visible-subslides
}
repetitions.update(rep => calc.max(rep, _last-required-subslide(vs)))
if _check-visible(subslide.at(here()).first(), vs) {
repetitions.update(rep => calc.max(rep, _last-required-subslide(visible-subslides)))
if in-subslide(vs) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are now ignoring the handout mode case. We need to use vs instead of visible-subslides.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, this must have seeped in as I was trying to move things between this function and in-subslide

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.

Feature request: contextual boolean for checking subslide

2 participants