Skip to content
Closed
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions src/content/docs/style-guide/components/anchor-heading.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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
```mdx
import { AnchorHeading } from "~/components";

<AnchorHeading title="How to use AnchorHeading" slug="use-anchorheading" depth={2} />
Expand All @@ -21,7 +21,7 @@ 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
```mdx
## foo {/*bar*/}
{/* HTML: <h2 id="bar">foo</h2> */}
```
Expand All @@ -30,4 +30,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