Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The `AnchorHeading` component defines headings. Specifically, `AnchorHeading` pe
3. Creates a button to copy the URL at each fragment.
4. Allows heading fragments to be defined separately from the text of the heading itself.

```mdx live
import { AnchorHeading } from "~/components";

<AnchorHeading title="How to use AnchorHeading" slug="use-anchorheading" depth={2} />
Expand All @@ -21,7 +20,6 @@ Markdown files (including partials) have this behavior by default, applied via r

To override the ID given to a heading within Markdown, add an MDX comment at the end of the line:

```mdx live
## foo {/*bar*/}
{/* HTML: <h2 id="bar">foo</h2> */}
```
Expand All @@ -30,4 +28,4 @@ To override the ID given to a heading within Markdown, add an MDX comment at the

The `AnchorHeading` component emulates the behavior of the [`rehype-slug`](https://github.com/rehypejs/rehype-slug) and the [`rehype-autolink-headings`](https://github.com/rehypejs/rehype-autolink-headings). It adds an `id` based on the output of [`github-slugger`](https://github.com/Flet/github-slugger/) to the heading, as well as adding a button to copy a link to that particular heading.

:::
:::
Loading