This commit is contained in:
parent
844d31754d
commit
36870785bc
35 changed files with 1344 additions and 1330 deletions
|
@ -1,23 +1,23 @@
|
|||
---
|
||||
import { ScrollArea } from '@/components/ui/scroll-area'
|
||||
import { cn } from '@/lib/utils'
|
||||
import type { MarkdownHeading } from 'astro'
|
||||
import { Icon } from 'astro-icon/components'
|
||||
import { ScrollArea } from "@/components/ui/scroll-area";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { MarkdownHeading } from "astro";
|
||||
import { Icon } from "astro-icon/components";
|
||||
|
||||
type Props = {
|
||||
headings: MarkdownHeading[]
|
||||
}
|
||||
headings: MarkdownHeading[];
|
||||
};
|
||||
|
||||
const { headings } = Astro.props
|
||||
const { headings } = Astro.props;
|
||||
|
||||
function getHeadingMargin(depth: number): string {
|
||||
const margins: Record<number, string> = {
|
||||
3: 'ml-4',
|
||||
4: 'ml-8',
|
||||
5: 'ml-12',
|
||||
6: 'ml-16',
|
||||
}
|
||||
return margins[depth] || ''
|
||||
const margins: Record<number, string> = {
|
||||
3: "ml-4",
|
||||
4: "ml-8",
|
||||
5: "ml-12",
|
||||
6: "ml-16",
|
||||
};
|
||||
return margins[depth] || "";
|
||||
}
|
||||
---
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue