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

Evaluate Slide size and block if they grow above a certain treshold (with exemption mechanism) #2693

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

michael-kerscher
Copy link
Collaborator

@michael-kerscher michael-kerscher commented Mar 8, 2025

This enables a test for the width and height of slides (excluding some special cases completely).
The mechanism has an exemption mechanism to temporarily exempt slides from the rules.
Even exempted slides are checked for the rule violation and once the slides are compliant they must be removed from the exemption list to avoid future regression (the check fails in the CI if compliant slides are exempted!)

This also provides a good opportunity to always have an up-to-date list of overlong slides in slide-exemptions.list.ts that can be worked on.

On the CLI it can be locally used with npm run test -- --spec=src/slide-size.test.ts (after creating the list with ./src/slides/create-slide.list.sh ../book/html/).
The CI environment specifies the env var TEST_BOOK_DIR that is used to specifiy the html directory so it can create the list of slides on-the-fly, check against hardcoded exemptions and evaluate.

This is a new solution for #1464 within the new test framework. This is related to #2234 and makes the mdbook-slide-evaluator from #2258 obsolete and should be removed as this is a not so powerful nor flexible framework.

This will render mdbook-slide-evaluator useless and it will be deprecated soon
…removed once they don't violate the rules. remove more toc and print pages
This ensures new slides are checked. Developers can create them manually.
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.

1 participant