@matfire/satteri-photoswipe
v0.1.4
Published
A Satteri plugin that prepares images for PhotoSwipe
Readme
satteri-photoswipe
A Satteri plugin that prepares Markdown images for PhotoSwipe.
This is a Satteri-native mirror of @matfire/rehype-photoswipe: it wraps each img element in an anchor and adds data-pswp-width and data-pswp-height
attributes from probe-image-size to use them with photoswipe
Install
npm install @matfire/satteri-photoswipeUsage
import { markdownToHtml } from "satteri";
import satteriPhotoswipe from "@matfire/satteri-photoswipe";
const { html } = await markdownToHtml("", {
hastPlugins: [satteriPhotoswipe],
});V1 intentionally mirrors the upstream rehype plugin behavior. Image src values
are passed to probe-image-size as-is; relative image resolution and other
Satteri-specific options are not handled.
Development
bun run hooks:install
bun run format:check
bun run lint
bun run typecheck
bun run testLefthook runs formatting, linting, and type checks before commits, tests before pushes, and Commitlint against commit messages.
