Plugins Find a plugin
# Find a _plugin_

Find a plugin

17 first-party plugins, by what you want to do.

Try

lay out a page Steps, tabs, disclosures and figures around what you wrote.

Callouts @mdsvex/plugin-callouts Callouts: note, tip, important, warning and caution, with a default or custom title :::note :::warning[Title] owns note, tip, important, warning, caution
Elements @mdsvex/plugin-elements Directives over html elements: details, accordions, keys, ruby, badges, marks, insertions and abbreviations :::details[Summary] :kbd[Ctrl] :badge[new](tone=tip) :abbr[PFM](title=…) owns details, accordion, kbd, ruby, badge, mark, ins, abbr also mark up text
Steps @mdsvex/plugin-steps Numbered steps, each heading inside a steps directive starts one :::steps :::step[Title] owns steps, step
Tabs @mdsvex/plugin-tabs Tabs and code groups, each heading or code fence inside a tabs directive is a tab :::tabs :::tabs(group=pm) owns tabs, tab also show code

mark up text Keys, badges, marks, abbreviations and emoji inside a sentence.

Emoji @mdsvex/plugin-emoji Emoji shortcodes, :tada: becomes the emoji, with an optional accessible label :tada: reads text as it is written

show code Code blocks with a copy button, and code groups.

Code blocks @mdsvex/plugin-code-blocks Code blocks with a copy button that announces the result, the title and the caption ```js title="a.js" replaces <pre>

pictures, video and diagrams Captions, players, and diagrams drawn from text.

Diagrams @mdsvex/plugin-diagram Diagrams: mermaid fences drawn at build time by pele, or in the browser by mermaid ```mermaid owns diagramclaims mermaid fences with pele or mermaid, optional peers also show code
Embeds @mdsvex/plugin-embeds Video embeds: YouTube and Vimeo players named by their title ::youtube[Title](id=…) ::vimeo[Title](id=…) owns youtube, vimeo
Figures @mdsvex/plugin-figures Figures: a figure directive around an image or anything else, with its caption :::figure[Caption] owns figure needs unwrap_images also cite and cross-reference

help readers find their way Links on headings and a table of contents.

Anchors @mdsvex/plugin-anchors Heading anchors, a link on every heading that has an id ## Heading acts on headings needs heading_ids
Table of contents @mdsvex/plugin-toc Table of contents, the headings of a document as data and a component that lists them ::toc[On this page] ## Heading owns tocacts on headingsreads the whole document needs heading_ids also know each page

cite and cross-reference A bibliography, and numbered figures, tables and equations.

Citations @mdsvex/plugin-citations Citations, :cite[key] from a CSL JSON bibliography and a ::bibliography that lists what a document cites :cite[key] ::bibliography owns cite, bibliographyreads the whole document waits, as it reads the bibliography the frontmatter names
Numbering @mdsvex/plugin-numbering Numbering, numbered figures, tables, equations and sections, and :ref[fig:x] references that read as the number :ref[sec:id] owns ref, tableacts on code blocks, headingsreads figure from another pluginreads the whole document needs heading_ids

know each page Facts about a document for a layout or a list of posts.

Page data @mdsvex/plugin-page-data Page data, the reading time, excerpt, inferred title, edit url and last modified date of a document <!-- more --> # Title reads the whole document

catch broken things Warnings, or a failed build, before a reader finds them.

Nothing fits?

Write your own

A plugin is a function that returns a bundle: the directives it owns, the components that render them, and handlers that reshape what the parser read. It adds no syntax: everything here works through directives, fences and the nodes the parser already reads.

  1. 1 Bundles
  2. 2 Parse plugins
  3. 3 Deferred work
  4. 4 Plugin data

The first-party plugins are packages of their own, named @mdsvex/plugin-*. Each exports a function, and what it returns goes in the plugins option, in the order they should run:

import { mdsvex } from 'mdsvex';
import { toc } from '@mdsvex/plugin-toc';
import { tabs } from '@mdsvex/plugin-tabs';

mdsvex({
	heading_ids: true,
	plugins: [tabs(), toc()]
});

Every plugin here is read from its package: its name, what it owns and acts on, and its options with their docs. Every output is the plugin's own compile, run when the site is built, and an edited example compiles in your browser with the same plugin.

mdsvex, markdown with Svelte in it. MIT licence.