Evaluate Slide size and block if they grow above a certain treshold (with exemption mechanism) #2693
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.