carta/packages/plugin-anchor
2024-05-11 02:20:51 +02:00
..
src fix: rename package name 2024-05-11 02:20:51 +02:00
static feat(add new plugin: anchor): add new plugin: anchor 2024-01-16 23:17:32 +07:00
.gitignore feat(add new plugin: anchor): add new plugin: anchor 2024-01-16 23:17:32 +07: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 new plugin: anchor): add new plugin: anchor 2024-01-16 23:17:32 +07:00
vite.config.ts feat(add new plugin: anchor): add new plugin: anchor 2024-01-16 23:17:32 +07:00

Carta Anchor Plugin

This plugin adds id attributes and permalinks to headings. Install it using:

npm i @cartamd/plugin-anchor

Setup

Styles

Import the default theme, or create you own:

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

Extension

<script>
	import { Carta, MarkdownEditor } from '@thetadev/carta-md';
	import { anchor } from '@cartamd/plugin-anchor';

	const carta = new Carta({
		extensions: [anchor()]
	});
</script>

<MarkdownEditor {carta} />

Documentation

Checkout the docs for examples, options and more.