carta/packages/plugin-anchor
2024-03-18 19:41:22 +01:00
..
src feat(add new plugin: anchor): add new plugin: anchor 2024-01-16 23:17:32 +07: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 build: update dev dependencies 2024-03-18 19:41:22 +01:00
README.md feat(add new plugin: anchor): add new plugin: anchor 2024-01-16 23:17:32 +07: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, CartaEditor } from 'carta-md';
	import { anchor } from '@cartamd/plugin-anchor';

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

<CartaEditor {carta} />

Documentation

Checkout the docs for examples, options and more.