pictures, video and diagrams @mdsvex/plugin-embeds
Embeds
Video embeds: YouTube and Vimeo players named by their title
Install
pnpm add -D @mdsvex/plugin-embeds Turn it on
import { embeds } from '@mdsvex/plugin-embeds';
mdsvex({ plugins: [embeds()] }); What it reads
::youtube[Title](id=…)vimeo directive ::vimeo[Title](id=…)owns youtube, vimeo
An example
::vimeo[The New Vimeo Player](id=76979871)
::youtube[Title](id=...) is a lazy YouTube player from youtube-nocookie.com, which sets no cookie until the video plays, and ::vimeo[Title](id=...) a lazy Vimeo player with dnt=1. start is a time in seconds. The bracket text is the title of the frame, which is what a screen reader announces, and (title=...) sets it instead. The build warns about an embed with no id or one that is no id on its site (embed_id), and one with no title (embed_without_title). embeds({ css: false }) leaves the stylesheet out, and a youtube or vimeo from a directives module replaces the plugin's component.