01 / 11
Make your first diagram
Write a few lines of text and turn them into accessible SVG for circuits or UML.
01 / Install
Compile text into SVG
Install the core package:
sh
npm install @schemd/core
Compile a bounded document:
ts
import { compileSchematic, parseSchematicFence } from '@schemd/core';
const fence = parseSchematicFence('schemd bounds="640x260" title="Sensor input"')!;
const { svg, document, metrics } = compileSchematic(source, fence);
Schemd runs on a server or during a build. It does not need a DOM, a font-loading pass, or a client-side layout library.
02 / Markdown
Keep Markdown in your app
Core does not ship a Markdown parser. Keep your parser on the server, recognize schemd fences, and send the fence body to the compiler.
sh
npm install @schemd/core
ts
import { compileSchematic, parseSchematicFence } from '@schemd/core';
function renderSchemdFence(body: string, info: string) {
const fence = parseSchematicFence(info);
if (!fence) return undefined;
return compileSchematic(body, fence).svg;
}
Use that function from Marked, markdown-it, unified, or your own build pipeline. The website uses this exact server-only boundary, so no compiler or Markdown code reaches the browser.