Skip to content

Commit 53f7660

Browse files
Evaluate slide size and block if they grow above a certain treshold (with exemption mechanism) (#2693)
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](tests/src/slides/slide-exemptions.list.ts) that can be worked on. The slide list is always autogenerated in the CI environment. If you want to enable this for your local dev environment it has to be created manually. This avoids a time consuming local test if it is not necessary. 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.
1 parent 91f6de6 commit 53f7660

File tree

14 files changed

+131
-818
lines changed

14 files changed

+131
-818
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ jobs:
190190
working-directory: ./tests
191191
- name: Test Javascript
192192
if: matrix.language == 'en'
193-
run: npm test
193+
run: |
194+
./src/slides/create-slide.list.sh
195+
npm test
194196
env:
195197
TEST_BOOK_DIR: ../book/comprehensive-rust-${{ matrix.language }}/html
196198
working-directory: ./tests

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ crowdin.yml
3131

3232
# Python virtualenv (for mdbook-slide-evaluator local installation)
3333
.venv/
34+
35+
# tests/ framework artifacts
36+
tests/src/slide/slides/slides.list.ts

Cargo.lock

Lines changed: 0 additions & 210 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
members = [
44
"mdbook-course",
55
"mdbook-exerciser",
6-
"mdbook-slide-evaluator",
76
"src/android/testing",
87
"src/bare-metal/useful-crates/allocator-example",
98
"src/bare-metal/useful-crates/zerocopy-example",

mdbook-slide-evaluator/Cargo.toml

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)