jacobinwwey_obsidian-NotEMD/scripts/lib
Jacobinwwey eb777ef93e fix(slide-export): cross-page mermaid/heading integrity, MP4 order+clarity, Windows probe
Slide export improvements across all 6 formats (HTML standalone, HTML
server-script, PDF, PNG, PPTX, MP4):

Cross-page split integrity:
- isTopLevelListItem now anchors to column 0 only, so indented nested
  children (e.g. - Responsibility: under - Module:) stay attached to
  their parent block instead of being orphaned as top-level items on the
  next slide. Regression test added.

PDF/PNG Mermaid blank pages:
- Slidev one-piece export only waits on one shared #mermaid-rendering-container,
  so late Mermaid blocks capture blank. Append --per-slide to PDF/PNG CLI
  invocations so each slide gets its own Mermaid container-wait cycle.
  Keep --wait-until networkidle --wait 3000 as belt-and-suspenders.
  PDF p3 content went 0.00% -> 2.64%.

MP4 slide ordering:
- Replace shell glob (*.png, lexicographic: 1,10,11,...,2) with a
  numerically-sorted concat-demuxer list fed to ffmpeg with explicit
  per-frame durations. Slides encode in deck order regardless of
  zero-padding width or --with-clicks suffix.

Image clarity setting (>=300 ppi default):
- Add slideExportImageClarity setting (standard/high/ultra, default ultra
  = scale 3 ~432 ppi) wired into Slidev --scale on PNG export; MP4
  inherits via PNG sequence. Settings UI dropdown in EN + ZH.
- Add -vf pad=ceil(iw/2)*2:ceil(ih/2)*2 to ffmpeg args so libx264/yuv420p
  encodes odd-height frames (scale 3 -> 2940x1653 -> 1654 padded).

Windows spawn EINVAL on environment probe:
- execFileAsync sets shell:true + windowsHide:true on win32 only so Node
  resolves PATHEXT for .cmd/.bat/.exe shims (npx.cmd, slidev.cmd, ffmpeg).
  macOS/Linux keep direct exec (shell:false), unchanged.
- resolvePlaywrightBrowsersPath covers AppData/Roaming/ms-playwright and
  PLAYWRIGHT_BROWSERS_PATH env var.

Mermaid pre-fit in standalone HTML:
- Inject mermaidPostFitScript into standalone HTML via main.ts export path.
- Add mermaidFitScript.ts, mermaidPostFitScript.txt, assets.d.ts.
- esbuild .txt loader, jest txt transform.

Tests: 1557 pass (1 pre-existing mainlineProgressAuditContract GEO drift
unrelated). tsc clean. Built main.js verified in live Obsidian.
2026-07-01 10:26:57 -05:00
..
esbuild-bundle-config.js fix(slide-export): cross-page mermaid/heading integrity, MP4 order+clarity, Windows probe 2026-07-01 10:26:57 -05:00
llm-provider-diagnostic.js feat: ship 1.7.9 long-request diagnostics and cross-provider streaming fallback 2026-03-30 03:23:16 -05:00
maintainer-cli-operation-help.js test(local-kb): execute repo-owned research docs through fixtures 2026-06-09 10:45:41 -05:00
package-manager-runtime.js fix(ci): harden repo-saga package-manager fallback probing 2026-05-08 04:40:55 -05:00
packaging-contract.js test(packaging): centralize render-host reference contract 2026-06-06 08:33:17 -05:00
pptx-visual-diff.js test: report pptx advisory metric and layer contracts 2026-06-22 04:20:09 -05:00
repo-saga-contributor-normalization.js feat(mainline): complete bounded backup recovery 2026-05-25 03:57:12 -05:00
repo-saga-execution-lock.js feat(mainline): recover bounded backup-branch slices 2026-05-25 03:02:41 -05:00