{"id":16039572,"url":"https://github.com/beartocode/carta","last_synced_at":"2025-05-14T14:09:59.501Z","repository":{"id":163313930,"uuid":"633412971","full_name":"BearToCode/carta","owner":"BearToCode","description":"A lightweight, fast and extensible Svelte Markdown editor and viewer.","archived":false,"fork":false,"pushed_at":"2025-05-06T17:40:05.000Z","size":26368,"stargazers_count":582,"open_issues_count":10,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-06T18:42:57.341Z","etag":null,"topics":["editor","katex","markdown","math","rehype","remark","slash-commands","syntax-highlighting","typescript","unified"],"latest_commit_sha":null,"homepage":"https://beartocode.github.io/carta/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BearToCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"beartocode","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2023-04-27T12:51:17.000Z","updated_at":"2025-05-06T17:37:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"89ce67f8-cd48-4393-84d9-5ebfe01a1fdf","html_url":"https://github.com/BearToCode/carta","commit_stats":{"total_commits":507,"total_committers":13,"mean_commits":39.0,"dds":0.09467455621301779,"last_synced_commit":"bd45020cfd4e9a8bb1c16dc50115b1bdb2d0c60d"},"previous_names":["beartocode/carta","beartocode/carta-md"],"tags_count":154,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BearToCode%2Fcarta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BearToCode%2Fcarta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BearToCode%2Fcarta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BearToCode%2Fcarta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BearToCode","download_url":"https://codeload.github.com/BearToCode/carta/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254160559,"owners_count":22024571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["editor","katex","markdown","math","rehype","remark","slash-commands","syntax-highlighting","typescript","unified"],"created_at":"2024-10-08T23:05:40.887Z","updated_at":"2025-05-14T14:09:54.492Z","avatar_url":"https://github.com/BearToCode.png","language":"TypeScript","readme":"\u003cdiv align=\"right\"\u003e\n\t\u003ca href=\"https://www.npmjs.com/package/carta-md\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/npm/v/carta-md?color=ff7cc6\u0026labelColor=171d27\u0026logo=npm\u0026logoColor=white\" alt=\"npm\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://ko-fi.com/beartocode\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/Ko--fi-FF5E5B?logo=ko-fi\u0026logoColor=white\u0026color=4dacfa\u0026labelColor=171d27\u0026label=Donate\" alt=\"bundle\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://github.com/BearToCode/carta/blob/master/LICENSE\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/github/license/BearToCode/carta?color=71d58a\u0026labelColor=171d27\u0026logo=git\u0026logoColor=white\" alt=\"license\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"http://beartocode.github.io/carta/\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/readthedocs/carta?logo=svelte\u0026color=b581fd\u0026logoColor=ffffff\u0026labelColor=171d27\" alt=\"docs\"\u003e\n\t\u003c/a\u003e\n\u003c/div\u003e\n\n[![Logo](https://i.imghippo.com/files/dM7PI1722778210.png)](https://beartocode.github.io/carta/)\n\n\u003ch1 align=\"center\"\u003e\u003cstrong\u003eCarta\u003c/strong\u003e\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003eModern, lightweight, powerful Markdown Editor.\u003c/div\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://beartocode.github.io/carta/\"\u003e📚 Documentation\u003c/a\u003e \n\u003cspan\u003e · \u003c/span\u003e\n\u003ca href=\"https://github.com/BearToCode/carta\"\u003eGitHub\u003c/a\u003e \n\u003c/div\u003e\n\n\u003cbr\u003e\n\n# Introduction\n\nCarta is a **lightweight**, **fast** and **extensible** Svelte Markdown editor and viewer. It is powered by [unified](https://github.com/unifiedjs/unified), [remark](https://github.com/remarkjs/remark) and [rehype](https://github.com/rehypejs/rehype). Check out the [examples](http://beartocode.github.io/carta/examples) to see it in action.\nDifferently from most editors, Carta does not include a code editor, but it is _just_ a textarea with syntax highlighting, shortcuts and more.\n\n## Features\n\n- 🌈 Markdown syntax highlighting ([Shiki](https://shiki.style/));\n- 🛠️ Toolbar (extensible);\n- ⌨️ Keyboard **shortcuts** (extensible);\n- 📦 Supports **[150+ plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins)** thanks to remark;\n- 🔀 Scroll sync;\n- ✅ Accessibility friendly;\n- 🖥️ **SSR** compatible;\n- ⚗️ **KaTeX** support (plugin);\n- 🔨 **Slash** commands (plugin);\n- 😄 **Emojis**, with included search (plugin);\n- ✏️ **TikZ** support (plugin);\n- 📂 **Attachment** support (plugin);\n- ⚓ **Anchor** links in headings (plugin);\n- 🌈 Code blocks **syntax highlighting** (plugin);\n- ⚙️ Embed **Components** (plugin).\n\n## Packages\n\n| Package                                                                       | Status                                                                        | Docs                                                                         |\n| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |\n| [carta-md](https://www.npmjs.com/package/carta-md)                            | ![carta-md](https://img.shields.io/npm/v/carta-md)                            | [/](https://beartocode.github.io/carta/introduction)                         |\n| [plugin-math](https://www.npmjs.com/package/@cartamd/plugin-math)             | ![plugin-math](https://img.shields.io/npm/v/@cartamd/plugin-math)             | [/plugins/math](https://beartocode.github.io/carta/plugins/math)             |\n| [plugin-code](https://www.npmjs.com/package/@cartamd/plugin-code)             | ![plugin-code](https://img.shields.io/npm/v/@cartamd/plugin-code)             | [/plugins/code](https://beartocode.github.io/carta/plugins/code)             |\n| [plugin-emoji](https://www.npmjs.com/package/@cartamd/plugin-emoji)           | ![plugin-emoji](https://img.shields.io/npm/v/@cartamd/plugin-emoji)           | [/plugins/emoji](https://beartocode.github.io/carta/plugins/emoji)           |\n| [plugin-slash](https://www.npmjs.com/package/@cartamd/plugin-slash)           | ![plugin-slash](https://img.shields.io/npm/v/@cartamd/plugin-slash)           | [/plugins/slash](https://beartocode.github.io/carta/plugins/slash)           |\n| [plugin-tikz](https://www.npmjs.com/package/@cartamd/plugin-tikz)             | ![plugin-tikz](https://img.shields.io/npm/v/@cartamd/plugin-tikz)             | [/plugins/tikz](https://beartocode.github.io/carta/plugins/tikz)             |\n| [plugin-attachment](https://www.npmjs.com/package/@cartamd/plugin-attachment) | ![plugin-attachment](https://img.shields.io/npm/v/@cartamd/plugin-attachment) | [/plugins/attachment](https://beartocode.github.io/carta/plugins/attachment) |\n| [plugin-anchor](https://www.npmjs.com/package/@cartamd/plugin-anchor)         | ![plugin-anchor](https://img.shields.io/npm/v/@cartamd/plugin-anchor)         | [/plugins/anchor](https://beartocode.github.io/carta/plugins/anchor)         |\n| [plugin-component](https://www.npmjs.com/package/@cartamd/plugin-component)   | ![plugin-component](https://img.shields.io/npm/v/@cartamd/plugin-component)   | [/plugins/component](https://beartocode.github.io/carta/plugins/component)   |\n\n## Community plugins\n\n| Plugin                                                                        | Description                        |\n| ----------------------------------------------------------------------------- | ---------------------------------- |\n| [carta-plugin-video](https://github.com/maisonsmd/carta-plugin-video)         | Render online videos               |\n| [carta-plugin-imsize](https://github.com/maisonsmd/carta-plugin-imsize)       | Render images in specific sizes    |\n| [carta-plugin-subscript](https://github.com/maisonsmd/carta-plugin-subscript) | Render subscripts and superscripts |\n| [carta-plugin-ins-del](https://github.com/maisonsmd/carta-plugin-ins-del)     | `\u003cins\u003e` and `\u003cdel\u003e` tags support   |\n\n# Getting started\n\n\u003e [!WARNING]\n\u003e Sanitization is not dealt with by Carta. You need to provide a `sanitizer` in the options.\n\u003e Common sanitizers are [isomorphic-dompurify](https://www.npmjs.com/package/isomorphic-dompurify) (suggested) and [sanitize-html](https://www.npmjs.com/package/sanitize-html).\n\u003e Checkout the documentation for an example.\n\n## Installation\n\nCore package:\n\n```\nnpm i carta-md\n```\n\nPlugins:\n\n```\nnpm i @cartamd/plugin-name\n```\n\n## Basic configuration\n\n```svelte\n\u003cscript lang=\"ts\"\u003e\n\timport { Carta, MarkdownEditor } from 'carta-md';\n\t// Component default theme\n\timport 'carta-md/default.css';\n\n\tconst carta = new Carta({\n\t\t// Remember to use a sanitizer to prevent XSS attacks\n\t\t// sanitizer: mySanitizer\n\t});\n\n\tlet value = $state('');\n\u003c/script\u003e\n\n\u003cMarkdownEditor bind:value {carta} /\u003e\n\n\u003cstyle\u003e\n\t/* Or in global stylesheet */\n\t/* Set your monospace font */\n\t/* Required to have the editor working correctly! */\n\t:global(.carta-font-code) {\n\t\tfont-family: '...', monospace;\n\t\tfont-size: 1.1rem;\n\t\tline-height: 1.1rem;\n\t\tletter-spacing: normal;\n\t}\n\u003c/style\u003e\n```\n\n## Flags\n\nYou 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.\n\n```ts\n// vite.config.js\nimport { sveltekit } from '@sveltejs/kit/vite';\n\n/** @type {import('vite').UserConfig} */\nconst config = {\n\tplugins: [sveltekit()],\n\tdefine: {\n\t\t__ENABLE_CARTA_SSR_HIGHLIGHTER__: false\n\t}\n};\nexport default config;\n```\n\n# Documentation\n\nFor the full documentation, examples, guides and more checkout the [website](https://beartocode.github.io/carta/).\n\n- [Introduction](https://beartocode.github.io/carta/introduction)\n- [Examples](https://beartocode.github.io/carta/examples)\n- [Getting Started](https://beartocode.github.io/carta/getting-started)\n- [Editing Styles](https://beartocode.github.io/carta/editing-styles)\n- Plugins:\n  - [Math](https://beartocode.github.io/carta/plugins/math)\n  - [Code](https://beartocode.github.io/carta/plugins/code)\n  - [Emoji](https://beartocode.github.io/carta/plugins/emoji)\n  - [Slash](https://beartocode.github.io/carta/plugins/slash)\n  - [TikZ](https://beartocode.github.io/carta/plugins/tikz)\n  - [Attachment](https://beartocode.github.io/carta/plugins/attachment)\n  - [Anchor](https://beartocode.github.io/carta/plugins/anchor)\n  - [Component](https://beartocode.github.io/carta/plugins/component)\n- API:\n  - [Utilities](https://beartocode.github.io/carta/api/utilities)\n  - [Core](https://beartocode.github.io/carta/api/core)\n  - [Extension](https://beartocode.github.io/carta/api/extension)\n\n# Contributing \u0026 Development\n\nEvery contribution is well accepted. If you have a feature request you can open a new issue.\n\nThis package uses a [pnpm workspace](https://pnpm.io/workspaces), so pnpm is required to download and put everything together properly.\n\n### Committing\n\nThis repository is [commitizen](https://github.com/commitizen/cz-cli) friendly. To commit use:\n\n```\nnpm run commit\n# or, if you have commitizen installed globally\ngit cz\n```\n\n### Running docs\n\nIf you want to preview the docs:\n\n```\ncd docs\nnpm run dev\n```\n","funding_links":["https://ko-fi.com/beartocode"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeartocode%2Fcarta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeartocode%2Fcarta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeartocode%2Fcarta/lists"}