Plugins

Plugins teach your Markdown new tricks.

A plugin adds something you can write on any slide: an equation, a diagram, a word-sized chart, a label, an icon, a face, a graph. Every one is on by default, and costs nothing until a slide uses it. Pills are always on. The Studio is Lattice's editor in the browser; the Playground is the try-it page on this site. Both draw everything below.

  • On by default
  • Works on any slide
  • Drawn in the deck's colors
  • The same figure in the Studio, the PDF and the HTML

The eight you write

  • Math

    Write TeX in a slide; get a sharp equation in the deck's colors.

    $\pi r^2$ · $$ E = mc^2 $$

    Use it when your slides carry formulas — a model, a proof, a rate — and a screenshot of an equation won't do.

  • Mermaid

    Type a diagram as text; get it drawn in your deck's colors.

    ```mermaid

    Use it when you explain a flow, a system or a sequence of calls, and you want the diagram to live in the same file as the slide — and change color with the theme.

  • Sparks

    A chart the size of a word, right beside the number it explains.

    `~{12 14 17 21}`

    Use it when a number on your slide has a history or a target, and a full chart would take more room than the point deserves.

  • Pills

    A label with a shape and a color, set right inside your sentence.

    `{LIVE}`

    Use it when a row, a heading or a sentence needs a status, a step, a count or a tag the reader can scan at a glance.

  • Icons

    Icons the size of a word, drawn in your theme's colors.

    `^{database, c3}`

    Use it when your slides show systems, pipelines or teams, and you want icons that match the deck instead of emoji or pasted vendor logos.

  • Avatars

    Type a name; get the same friendly portrait, every time.

    `!{Ada Okafor}`

    Use it when a team, persona or customer slide needs faces before anyone has sent headshots — or for people who are fictional by design.

  • Function plots

    Write the function; the slide draws its graph in your theme.

    ```functionplot

    Use it when you teach or explain a function — a logistic curve, a decay, a loss curve — and a pasted chart image would be the wrong font, the wrong colors and impossible to change.

  • Code

    Paste code, name the language; it's highlighted in your theme.

    ```ts

    Use it when your slides show an API call, a config file, a query or a migration, and a screenshot of an editor would be blurry, unsearchable and the wrong colors.

How a plugin works

You never install or switch anything on. You write, and the deck draws.

  1. You write the syntax

    $E = mc^2$ in a sentence, a ```mermaid block, `^{database}` in inline code. Each plugin reads its own small piece of Markdown.

  2. Lattice loads what the deck uses

    Every plugin is on by default, but its heavy parts — a diagram library, a set of drawings — load only for a deck that writes its syntax. A deck with no diagrams never downloads the diagram library.

  3. Every surface draws it

    The Studio, the Playground, the PDF and the HTML export show the same figure, in the slide's colors, light or dark. PowerPoint gets a picture of the slide.

Plugin, component or library?

Three words you'll meet on this site. They answer different questions.

What it isHow you use itFor example
A pluginSomething new you can write, on any slideWrite its syntax anywhereA ```mermaid block on an ordinary slide
A componentA layout for a whole slide<!-- _class: diagram --> at the top of a slideThe diagram slide, designed around a Mermaid block
A libraryA standalone part of Lattice you can use in your own appInstall it and call it from codeTrama, which lays out Lattice's own flowcharts

When you want more control

Most decks never need any of this. It's here for decks that travel between tools, and for teams that run Lattice themselves.

  • List the plugins a deck relies on. A plugins: [math, mermaid] line in the deck's front matter (the settings block at the top of the file) loads those plugins wherever the deck is opened, even in a setup that starts with fewer plugins on. It only ever adds; it never removes one.
  • See why each one is on. The Studio's deck settings have a Plugins tab: one row per plugin, the syntax it reads, and why it's on for this deck — by default, listed in the deck, or needed by a slide.
  • Switch one off. Whoever runs the export can turn a plugin off with --disable-plugin mermaid, except pills, which are always on. Each falls back gracefully: a diagram shows its source, math shows the TeX as text. A deck's own list can't switch it back on.

Under the hood

Two more plugins ship with Lattice. You'll see them in the Studio's Plugins tab, but you won't write them yourself.

  • Chart family The machinery behind every chart slide — bar, line, Gantt and the rest. It has no syntax of its own; a chart slide loads it. Switched off, a chart slide shows the list it was written as.
  • Anima Carries an animated scene to the scene slide, which plays it in the Studio and the HTML export while the PDF keeps a still. Its scene format is still changing, so it isn't documented here yet.

Write your own

One command writes a working plugin: a folder with a manifest, a renderer, a stylesheet, a reference page and its test cases. It passes the build and the test suite before you change a line.

lattice packages new plugin my-plugin

Today that means working in a copy of the Lattice repository: the plugin contract is still a draft, and publishing plugins on their own comes later.