Skip to content

Commit

Permalink
chore: update docs example
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincharity committed Feb 3, 2024
1 parent 9bce9e9 commit 947fe1c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@

## Motivation

I needed an easy way for users to jump to the top of the page or the bottom.
Allow users to easily scroll to the top or bottom of a page by adding links to the top and bottom of the page.

## Install

```
npm i -D @benjc/rehype-scroll-to-top
```

## Sample
## Usage

```typescript
import rehype from "rehype";
import rehypeParse from 'rehype-parse';
import rehypeScrollToTop from "@benjc/rehype-scroll-to-top";
import { unified } from 'unified';

unified()
.use(rehypeParse, {fragment: true})
.use(rehypeScrollToTop)
.process('<h1>Title</h1><p>Content</p>')
```

### Input

Expand Down

0 comments on commit 947fe1c

Please sign in to comment.