carta/packages/plugin-attachment
2024-05-11 02:20:51 +02:00
..
src fix: rename package name 2024-05-11 02:20:51 +02:00
static feat: add plugin-attachment 2023-10-26 19:32:50 +02:00
.gitignore feat: add plugin-attachment 2023-10-26 19:32:50 +02:00
.npmrc feat: add plugin-attachment 2023-10-26 19:32:50 +02:00
package.json fix: rename package name 2024-05-11 02:20:51 +02:00
README.md fix: rename package name 2024-05-11 02:20:51 +02:00
svelte.config.js build: update dev dependencies 2024-03-18 19:41:22 +01:00
tsconfig.json feat: add plugin-attachment 2023-10-26 19:32:50 +02:00
vite.config.ts feat: add plugin-attachment 2023-10-26 19:32:50 +02:00

Carta Attachment Plugin

This plugin adds support for attachments. Install it using:

npm i @cartamd/plugin-attachment

Setup

Styles

Import the default theme, or create you own:

import '@cartamd/plugin-attachment/default.css';

Extension

<script lang="ts">
	import { Carta, MarkdownEditor } from '@thetadev/carta-md';
	import { attachment } from '@cartamd/plugin-attachment';

	const carta = new Carta({
		extensions: [
			attachment({
				upload(file) {
					/* ... */
				}
			})
		]
	});
</script>

<MarkdownEditor {carta} />

Documentation

Checkout the docs for examples, options and more.