mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 12:52:47 -07:00
feat: add id to documentation headings
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
import { Title } from '@mantine/core'
|
||||
import type { HTMLAttributes } from 'react'
|
||||
import { useRef, type HTMLAttributes } from 'react'
|
||||
|
||||
export default function MdxH2(
|
||||
props: HTMLAttributes<HTMLHeadingElement>,
|
||||
): JSX.Element {
|
||||
return <Title {...props} mt={20} order={2} />
|
||||
return (
|
||||
<Title
|
||||
{...props}
|
||||
mt={20}
|
||||
order={2}
|
||||
id={String(props.children ?? '')
|
||||
.toLowerCase()
|
||||
.replaceAll(' ', '-')}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,5 +4,13 @@ import type { HTMLAttributes } from 'react'
|
||||
export default function MdxTitle(
|
||||
props: HTMLAttributes<HTMLHeadingElement>,
|
||||
): JSX.Element {
|
||||
return <Title {...props} order={1} />
|
||||
return (
|
||||
<Title
|
||||
{...props}
|
||||
order={1}
|
||||
id={String(props.children ?? '')
|
||||
.toLowerCase()
|
||||
.replaceAll(' ', '-')}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ The `tuono` project can mostly be split by the following sub-domains:
|
||||
- The documentation website (which is written with tuono 🚀)
|
||||
|
||||
To check what are the knowledge requirement for each domain check the
|
||||
[requirements](/documentation/contributing?#requirements) section below.
|
||||
[requirements](#requirements) section below.
|
||||
|
||||
Currently I'm keeping a private dashboard to prioritize new features and bug fixes but if you
|
||||
want to propose something please open a new issue on github or reach me using
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"lib": ["ES2021", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user