Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

carta

> 开发工具
Open source

A lightweight, fast and extensible Svelte Markdown editor and viewer.

763 stars0 likes0 views
WebsiteGitHub

About

A lightweight, fast and extensible Svelte Markdown editor and viewer.

Carta

Introduction

Carta is a lightweight, fast and extensible Svelte Markdown editor and viewer. It is powered by unified, remark and rehype. Check out the examples to see it in action. Differently from most editors, Carta does not include a code editor, but it is just a textarea with syntax highlighting, shortcuts and more.

Features

  • Markdown syntax highlighting (Shiki);
  • ️ Toolbar (extensible);
  • ⌨️ Keyboard shortcuts (extensible);
  • Supports 150+ plugins thanks to remark;
  • Scroll sync;
  • ✅ Accessibility friendly;
  • ️ SSR compatible;
  • ⚗️ KaTeX support (plugin);
  • Slash commands (plugin);
  • Emojis, with included search (plugin);
  • ✏️ TikZ support (plugin);
  • Attachment support (plugin);
  • ⚓ Anchor links in headings (plugin);
  • Code blocks syntax highlighting (plugin);
  • ⚙️ Embed Components (plugin).

Packages

Package Status Docs
carta-md /
plugin-math /plugins/math
plugin-code /plugins/code
plugin-emoji /plugins/emoji
plugin-slash /plugins/slash
plugin-tikz /plugins/tikz
plugin-attachment /plugins/attachment
plugin-anchor /plugins/anchor
plugin-component /plugins/component

Community plugins

Plugin Description
carta-plugin-video Render online videos
carta-plugin-imsize Render images in specific sizes
carta-plugin-subscript Render subscripts and superscripts
carta-plugin-ins-del and tags support

Getting started

[!WARNING] Sanitization is not dealt with by Carta. You need to provide a sanitizer in the options. Common sanitizers are isomorphic-dompurify (suggested) and sanitize-html. Checkout the documentation for an example.

Installation

Core package:

bash
npm i carta-md

Plugins:

bash
npm i @cartamd/plugin-name

Basic configuration

svelte

Flags

You can reduce the server-side bundle by using the following vite config. This will remove shiki from the bundle. It may cause issues if you try to use plugin-code on the server, as the highlighter is no longer present there.

typescript
// vite.config.js
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
	plugins: [sveltekit()],
	define: {
		__ENABLE_CARTA_SSR_HIGHLIGHTER__: false
	}
};
export default config;

Documentation

For the full documentation, examples, guides and more checkout the website.

  • Introduction
  • Examples
  • Getting Started
  • Editing Styles
  • Plugins:
    • Math
    • Code
    • Emoji
    • Slash
    • TikZ
    • Attachment
    • Anchor
    • Component
  • API:
    • Utilities
    • Core
    • Extension

Contributing & Development

Every contribution is well accepted. If you have a feature request you can open a new issue.

This package uses a pnpm workspace, so pnpm is required to download and put everything together properly.

Committing

This repository is commitizen friendly. To commit use:

bash
npm run commit
# or, if you have commitizen installed globally
git cz

Running docs

If you want to preview the docs:

bash
cd docs
npm run dev

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScripteditorkatexmarkdownmath

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具