@svelte-put/preprocess-auto-slug
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@svelte-put/preprocess-auto-slug

npm.badge bundlephobia.badge docs.badge

Svelte preprocessor for adding id and anchor to nodes

svelte-put

This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.

Usage & Documentation

See the dedicated documentation page here.

Quick Start

<!-- input.svelte -->
<h2>Quick start</h2>
// svelte.config.js
import autoSlug from '@svelte-put/preprocess-auto-slug';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: [autoSlug()],
};

export default config;
<!-- output.html -->
<h2 id="quick-start">
  <a href="#quick-start" aria-hidden="true" tabindex="-1">#</a>
  Quick Start
</h2>

Dependencies (4)

Dev Dependencies (2)

Package Sidebar

Install

npm i @svelte-put/preprocess-auto-slug

Weekly Downloads

3

Version

2.0.0

License

MIT

Unpacked Size

16.2 kB

Total Files

8

Last publish

Collaborators

  • vnphanquang