Xarp

Markdown slides with visual editing and drawing.

← → to explore. E to edit. D to draw.
The section bar jumps between topics.

Start with Markdown

Source

# A useful idea

Keep the source readable.

- A question
- An example
- A conclusion

A useful idea

Keep the source readable.

  • A question
  • An example
  • A conclusion

Headings, lists, emphasis, links, and tables use Marp Markdown.

Mathematics with KaTeX

max⁡x,y≥0x+ysubject to2x+y≤6,x+2y≤6.\begin{aligned} \max_{x,y\geq 0}\quad & x+y\\ \text{subject to}\quad & 2x+y\leq 6,\\ & x+2y\leq 6. \end{aligned}

xy033(2, 2)

Aligned equations and vector figures stay crisp when enlarged.

Type across languages

English

Write what you mean.

简体中文

把想法画出来。

繁體中文

把想法畫出來。

The bundled theme carries fonts for Latin text, Simplified Chinese, and Traditional Chinese.

Build from JavaScript

import { build } from '@chaoxu/xarp';
import { editing, drawing } from '@chaoxu/xarp/plugins';

await build({
  input: 'slides.md',
  plugins: [editing(), drawing()],
});

The CLI uses the same library. Code blocks keep syntax highlighting and monospace alignment.

Use an image background

The background is an SVG asset. The words remain editable slide content.

Press E, then double-click the sentence above.

Edit

Change the words and the layout.

Change this sentence

Replace this sentence with your idea.

Press E, then double-click the sentence. Try Undo and Redo.

In local preview, save an edit and try Undo again. Save again to write the undone state.

Move the pieces

A heading

Put the subject where it belongs.

A supporting detail

Keep the detail readable.

A figure

E, then drag a box to move it or a handle to resize it. Arrow keys nudge it. Try Reset Box or Undo.

Edit the diagram's labels

QuestionExampleResult

E, then double-click “Question”. Rename it and press Enter. Undo restores the label.

Edit the Markdown too

Material Source Rendering
A claim Markdown Text
An equation LaTeX KaTeX
A diagram SVG Vectors

Local preview: E → Slide Markdown. Change a table cell, then Save Source.

Draw

Put the explanation on the slide.

Sketch a route from A to F

ABCDEF

D opens the pen. Try a color, Undo, Redo, and Clear slide.

Room for a sketch

Draw here, then revisit the previous slide. Ink stays with its slide until you reload.

Present

Control the pace and keep notes nearby.

Reveal a proof

For a,b≥0a,b\geq 0:

  • (a−b)2≥0(a-b)^2\geq 0
  • (a+b)2≥4ab(a+b)^2\geq 4ab
  • a+b2≥ab\dfrac{a+b}{2}\geq\sqrt{ab}

Advance with →. Marp reveals each step.

Present with notes

P

Presenter view

Current slide, next slide, and speaker notes.

F

Fullscreen

Use the whole screen.

The section bar stays available for jumps. E and D reopen the editing and drawing tools.

Take the whole folder

dist/
  index.html
  assets/
  _xarp/
    theme/
    plugins/

The HTML, fonts, scripts, and figures travel together.

Serve the folder to share this deck.

Shared HTML supports visual edits and Copy Edits. Run the local preview to save Markdown.

Extend

Add browser behavior with a plugin.

Change the curve

−2−1012 4321xy

y=ax2y=ax^2

0.50

Move the slider. This example plugin calculates the curve in your browser.

Plugins are files and data

export function curveDemo() {
  return {
    name: 'curve-demo',
    scripts: [new URL('./curve-demo.js', import.meta.url)],
    data: { coefficient: 0.5 },
  };
}

Add curveDemo() to plugins. Xarp copies the script into the output.

Make a deck of your own

Use this demo's source, or start from the basic example.

npm ci
npm run dev

npm run dev:quick opens the short tour, selected from this same Markdown file.

slide: welcome

This is a self-guided product demo, so short operating hints are part of the content. Every example is synthetic. In a live walkthrough, begin with the arrow keys and point to the section navigation. Source saving requires the local dev preview. Static copies offer visual changes and Copy Edits.

slide: markdown

The left column is a source specimen, and the right is its corresponding HTML content. The rest of this deck is authored in Marp Markdown with HTML where a layout or an editable object benefits from it.

slide: mathematics

The shaded feasible region is exact. Adding the constraints gives 3x + 3y <= 12, hence x + y <= 4. The point (2,2) is feasible and attains 4. The displayed alignment is retained to make the objective and constraints legible. The figure is authored SVG, not a measurement or benchmark.

slide: languages

The Chinese passages carry exact regional language tags. Both use the corresponding IBM Plex Sans regional family. These are typography specimens rather than exact translations of the English sentence. No external font service is required for this deck.

slide: code

This is executable API usage in a project with Xarp installed. Library paths resolve from cwd, which defaults to the current working directory. The code sample supplies its input explicitly. A config file is optional.

slide: background

The Marp background directive keeps the graph behind a full-width content layer, so the section bar and editing surface remain usable. The graph is an original illustration of a route, with no performance or data claim.

slide: edit

The following slides are exercises. In a local preview, Save Slide writes supported changes to the configured Markdown source. On a static copy, visual edits remain in the tab and Copy Edits can preserve the edit payload.

slide: edit-text

Use the raw HTML sentence as the primary editing target. Undo and Redo change the current slide's browser state. Saving does not erase its history, and undoing a saved edit does not write the source until another save. Static copies have no source-writing service.

slide: layout

These are raw HTML boxes, which Xarp can map back to the source. Clicking a box's background selects it. Double-clicking text edits the text instead. Shift plus an arrow makes a larger nudge. Reset Box clears supported position and size overrides, and Undo restores the prior state.

slide: svg

The labels are native SVG text elements, and Xarp uses its SVG text input when they are edited. Shape and label movement are also supported. Edges in this authored diagram are static and do not reroute automatically.

slide: source

Markdown table cells deliberately use Slide Markdown. Visual editing of their text cannot be mapped safely in this release. Local preview serves the source for the current slide. A static export does not supply source loading or source saving. The browser keeps pending changes on other slides when this one is saved.

slide: draw

Drawing is an optional plugin, separate from editing. Pressing D opens the drawing toolbar and switches out of Edit Mode. Ink is stored per slide in the current browser page session.

slide: draw-route

This is an unweighted graph, and any drawn route through its edges from A to F satisfies the exercise. Pointer input accepts a mouse, pen, or touch, though physical tablet behavior requires device testing. Clear slide affects only this slide's ink and can be undone.

slide: whiteboard

The blank space is intentional. It is an ordinary slide with the drawing plugin, not a separate whiteboard feature. Ink persists across navigation within this page, and reloading clears it.

slide: present

Xarp retains Marp's navigation, fragment, fullscreen, and presenter-view behavior. The bottom section bar comes from Xarp's sections configuration.

slide: fragments

The asterisk bullets are Marp fragments. Each step is valid for the stated nonnegative variables. Expanding the first line and adding 4ab proves the second. Taking square roots and dividing by 2 gives the third. Navigate backward to reverse the reveals.

slide: presenter

PRESENTER NOTE: You found the notes. They are authored as Markdown comments and stay out of the audience slide. Close this presenter window when finished. A browser may require permission for the popup or fullscreen request. The source comments also preserve the demo's technical qualifications without crowding the slide.

slide: portable

This deck uses only bundled runtime assets, local figures, and a local plugin. Its source links are external and require a network connection when followed. Sharing the entire built directory preserves font, image, and plugin paths. This is portable HTML, not a single self-contained HTML file. Drawing lasts for the page session in both delivery modes.

slide: extend

The following curve is a small example plugin authored for this demo. It is not a built-in Xarp plotting feature. The package handles plugin scripts and data, while ordinary browser code implements the interaction.

slide: curve

The custom plugin reads its initial coefficient from Xarp's plugin data and listens for native input events. It has no animation loop, timer, or remote service. The SVG contains the a = 0.5 curve as a static fallback. The slider also accepts keyboard arrows. This interactive state is a demo control, separate from Markdown edits and ink history.

slide: plugin-source

This is the actual plugins/curve.mjs implementation. Plugins can also supply local CSS files through styles. Assets are deduplicated by their file URL, and plugin data appears under the plugin name in the xarp-meta JSON. The demo theme imports chao-ui and adds only project layout rules.

slide: start

Run these commands from examples/showcase after obtaining the source, with Node.js 24 or 26 installed. npm run build generates the full deck and the short tour. xarp.quick.config.mjs selects explicit slide IDs, so its content is not a second authored copy. The basic example is suitable for starting an independent deck.