carta/packages/plugin-attachment
2024-04-12 08:29:41 +02:00
..
src chore: migrate plugin-attachment 2024-04-12 08:29:41 +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 build: move plugins peer-deps to v4 2024-04-12 08:24:46 +02:00
README.md refactor: remove verbose prefixes 2024-04-12 08:24:37 +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 '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.