4.0.1 โ€ข Published 4 days ago

carta-md v4.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 days ago

Carta.png

Introduction

NOTE: Carta has recently been updated to v4, which features numerous major changes.

Follow the Migration Guide to update your project.

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).

Packages

PackageStatusDocs
carta-mdcarta-md/
plugin-mathplugin-math/plugins/math
plugin-codeplugin-code/plugins/code
plugin-emojiplugin-emoji/plugins/emoji
plugin-slashplugin-slash/plugins/slash
plugin-tikzplugin-tikz/plugins/tikz
plugin-attachmentplugin-attachment/plugins/attachment
plugin-anchorplugin-anchor/plugins/anchor

Community plugins

PluginDescription
carta-plugin-videoRender online videos
carta-plugin-imsizeRender images in specific sizes
carta-plugin-subscriptRender subscripts and superscripts
carta-plugin-ins-del<ins> and <del> 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:

npm i carta-md

Plugins:

npm i @cartamd/plugin-name

Basic configuration

<script lang="ts">
	import { Carta, MarkdownEditor } from 'carta-md';
	// Component default theme
	import 'carta-md/default.css';

	const carta = new Carta({
		// Remember to use a sanitizer to prevent XSS attacks
		// sanitizer: mySanitizer
	});
</script>

<MarkdownEditor {carta} />

<style>
	/* Or in global stylesheet */
	/* Set your custom monospace font */
	:global(.carta-font-code) {
		font-family: '...', monospace;
		font-size: 1.1rem;
	}
</style>

Documentation

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

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:

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

Running docs

If you want to preview the docs:

cd docs
npm run dev
4.0.1

4 days ago

4.0.0

20 days ago

3.6.1

1 month ago

3.6.0

1 month ago

3.5.0

3 months ago

3.4.0

5 months ago

3.3.0

5 months ago

3.2.0

5 months ago

2.2.1

9 months ago

2.0.3

9 months ago

2.2.0

9 months ago

2.0.2

9 months ago

2.4.1

8 months ago

2.0.5

9 months ago

2.4.0

8 months ago

2.0.4

9 months ago

2.0.7

9 months ago

2.6.0

7 months ago

2.0.6

9 months ago

2.8.0

6 months ago

2.0.8

9 months ago

2.0.1

10 months ago

2.0.0

10 months ago

3.0.0

6 months ago

2.3.0

9 months ago

2.1.1

9 months ago

2.5.0

8 months ago

2.3.1

9 months ago

2.7.0

6 months ago

2.7.2

6 months ago

2.7.1

6 months ago

2.1.0

9 months ago

3.1.3

5 months ago

3.1.2

6 months ago

3.1.1

6 months ago

3.1.0

6 months ago

1.2.0

11 months ago

1.1.9

12 months ago

1.1.8

12 months ago

1.1.7

12 months ago

1.1.6

12 months ago

1.1.5

12 months ago

1.1.4

12 months ago

1.1.3

12 months ago

1.1.12

12 months ago

1.1.11

12 months ago

1.1.10

12 months ago

1.1.13

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

0.0.1

12 months ago

1.0.0

12 months ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.6

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago