carta/packages/plugin-anchor
maisonsmd 2884ceeff1 feat(add new plugin: anchor): add new plugin: anchor
Add ability to render anchor links after headings
2024-01-16 23:17:32 +07: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 feat(add new plugin: anchor): add new plugin: anchor 2024-01-16 23:17:32 +07:00
README.md feat(add new plugin: anchor): add new plugin: anchor 2024-01-16 23:17:32 +07:00
svelte.config.js feat(add new plugin: anchor): add new plugin: anchor 2024-01-16 23:17:32 +07: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.