The published deck was a hand-written carousel of exported PNGs: the words of every
slide were an IMAGE of words. Nothing indexed them, no glossary tooltip could reach
them, no screen reader read them, and the page drifted from the source the moment a
slide changed.
The deck is NOT re-parsed. Slidev's markdown is not standard markdown, and its meaning
does not live in the markdown anyway — it lives in a compiled bundle of UnoCSS
utilities, theme rules and <style scoped> blocks. Re-implementing that is
re-implementing a renderer, in any language. So Slidev renders (its own /print route,
the one `slidev export` drives) and we capture what it produced: the DOM, and the CSS
the browser actually applied.
Measured on the served page: 0 → 2152 indexable words, 16/16 slides reachable, 0
third-party origins added, 0 broken references.
Twelve traps, none of which raised an error:
· The CSS must be asked of the BROWSER (17 stylesheets; index.html links 2).
· Collapsing :root/html/body imports the SPA's viewport cage — it clipped the deck
at 900px and swallowed 14 of 16 slides, silently.
· UnoCSS's preflight, scoped, kills the glossary underline it was supposed to enable.
· :not() inherits its argument's specificity — the boundary guard grew with every
exemption until it reverted the slide scaling. :not(:where(…)) contributes zero.
· scale(calc(100cqw / 980)) is invalid CSS and is dropped in silence; on a phone the
box was 328px while the content stayed 980px and two thirds of every slide was cut.
· The site's markdown renderer destroys an inline <script>: curly quotes, injected
<p>, &&. CSS and JS go to external files — correctness, not optimisation.
· The 980x552 frame CUT 12 of 16 slides (Slidev cuts them too; nobody had seen it,
because the slides were PNGs of themselves).
· transform: translateY(0) — an IDENTITY transform — makes <main> the containing
block for position:fixed, and the zoom modal landed at top = -221px.
Two views over one DOM (slider default, stacked reads with Ctrl+F), an index derived
from each slide's own H1, a sticky rail, zoom, and Slidev's own copy buttons revived —
they shipped in the captured DOM at 0x0, unclickable by any human.
Twelve gates (A–L), and IN THE CHAIN: `just decks` in sync-full, `decks-check` in
`check` (on disk), `decks-served` in `check-live` (the page). A generator outside the
chain is a generator that does not run.
23 lines
1.2 KiB
JavaScript
23 lines
1.2 KiB
JavaScript
// Shared path + dependency resolution for the deck projection.
|
|
//
|
|
// postcss and playwright-chromium are devDependencies of outreach/presentation/ (they
|
|
// are Slidev's neighbours, and Slidev is what we drive). Resolve them from there
|
|
// explicitly: pnpm is strict, so nothing is hoisted to a top-level node_modules.
|
|
import { createRequire } from 'node:module'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { dirname, resolve } from 'node:path'
|
|
|
|
const HERE = dirname(fileURLToPath(import.meta.url)) // outreach/scripts/decks/lib
|
|
|
|
export const OUTREACH = resolve(HERE, '../../..') // outreach/
|
|
export const PRESENTATION = resolve(OUTREACH, 'presentation')
|
|
export const SITE = resolve(OUTREACH, 'site/site') // content/ + public/ live here
|
|
export const DIST = resolve(PRESENTATION, 'dist')
|
|
|
|
const require_ = createRequire(resolve(PRESENTATION, 'package.json'))
|
|
export const postcss = require_('postcss')
|
|
export const { chromium } = require_('playwright-chromium')
|
|
|
|
export const publicBase = (id) => `/images/decks/${id}`
|
|
export const publicDir = (id) => resolve(SITE, `public/images/decks/${id}`)
|
|
export const contentFile = (lang, id) => resolve(SITE, `content/resources/${lang}/decks/${id}.md`)
|