@henriburau/slides (0.2.2)
Installation
@henriburau:registry=https://gitea.henriburau.de/api/packages/ace966/npm/npm install @henriburau/slides@0.2.2"@henriburau/slides": "0.2.2"About this package
@henriburau/slides
Slidev addon with shared layouts, components and styles, plus a check for overflowing slides.
Usage
The package is published to the Gitea npm registry. Point the @henriburau
scope at it in the project's .npmrc:
@henriburau:registry=https://gitea.henriburau.de/api/packages/ace966/npm/
Install it together with Playwright, which the overflow check needs:
pnpm add @henriburau/slides
pnpm add -D playwright-chromium
Enable the addon in the headmatter of slides.md:
addons:
- '@henriburau/slides'
Overflow check
check-overflow renders every slide with all clicks revealed and lists the
slides whose content does not fit. It uses the project's own @slidev/cli
and playwright-chromium.
"scripts": {
"check-overflow": "check-overflow"
}
pnpm check-overflow [entry.md] [--scroll] [-t|--tolerance <px>] [--json]
--scroll also lists boxes that scroll vertically, such as code blocks with
maxHeight. Horizontally clipped boxes are always listed. --json prints the
result for other tools. The command exits with code 1 if any slide overflows
and with code 2 on errors.
-t, --tolerance <px> (default 0) allows a bit of overflow: slides that
overflow by at most that many px are still listed, in yellow, but do not make
the command exit with 1. --help lists all options.
The check is written in TypeScript in src/ and compiled to lib/ when the
package is packed (pnpm build does the same by hand). To try a change in a
Slidev project without publishing, run the source directly from the project
root:
node ../burauslides/src/cli.ts [entry.md]
Testing
pnpm exec playwright install chromium # once
pnpm test
test:example builds example.md with the addon, which fails if a component
or layout does not compile. Only components used in a slide are compiled, so
add every new component to example.md. Preview the deck with
pnpm exec slidev example.md.
test:check-overflow type-checks src/ and runs the tests in test/. Most of
them run the CLI against the decks in test/fixtures, whose overflows are
known. To cover a new kind of overflow, add a deck there and a test in
test/cli.test.ts that expects it.
Releasing
pnpm release
The script checks that main is clean and up to date, runs pnpm test,
bumps the version, commits and tags vX.Y.Z and offers to push. The Gitea
workflow publishes every pushed v* tag. Versions with a suffix such as
1.2.0-rc.1 are published under the next dist-tag.
Dependencies
Dependencies
| ID | Version |
|---|---|
| @iconify-json/mdi | ^1.2.3 |
| @slidev/client | ^52.11.3 |
| @vueuse/core | ^14.1.0 |
| @vueuse/integrations | ^14.1.0 |
| commander | ^15.0.0 |
| import-meta-resolve | ^4.2.0 |
| picocolors | ^1.1.1 |
| qrcode | ^1.5.4 |
Development Dependencies
| ID | Version |
|---|---|
| @slidev/cli | ^52.20.1 |
| @types/node | ^26.6.3 |
| husky | ^9.1.7 |
| playwright-chromium | ^1.63.0 |
| typescript | ^7.0.2 |
| vue | ^3.5.43 |
Peer Dependencies
| ID | Version |
|---|---|
| vue | ^3.5.43 |