Coder Social home page Coder Social logo

tenzir / carta Goto Github PK

View Code? Open in Web Editor NEW

This project forked from beartocode/carta

0.0 0.0 0.0 23 MB

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

Home Page: https://beartocode.github.io/carta/

License: MIT License

Shell 0.04% JavaScript 2.41% TypeScript 72.74% CSS 3.26% HTML 0.76% Svelte 20.80%

carta's Introduction

Carta.png

Carta

Modern, lightweight, powerful Markdown Editor.


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

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

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

carta's People

Contributors

beartocode avatar maisonsmd avatar dependabot[bot] avatar styxpilled avatar cdcarson avatar evwltrs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.