Skip to content

Commit 9ded5f7

Browse files
Frameworks (#642)
* feat: add framework content handling and refactor tab components * refactor: update import paths for Markdown and CodeBlock components * fix: update hash prop in Breadcrumbs and Toc components for correct linking * refactor: simplify props handling in rehypeCallouts and enhance pre.shiki styling * refactor: simplify props handling in rehypeCallouts and enhance pre.shiki styling * refactor: optimize pre styles by consolidating CSS properties and adjusting line height * ci: apply automated fixes * refactor: update import paths for Markdown and CodeBlock components * fix: add height and sizes attributes to image components for better responsiveness * fix: add height and sizes attributes to image components for better responsiveness * refactor: update import path for MarkdownContent component * import paths * markdown components that were hidden from git for some reason??? * ci: apply automated fixes * markdown components that were hidden from git for some reason??? * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 1429bcb commit 9ded5f7

33 files changed

+658
-480
lines changed

src/components/Breadcrumbs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function Breadcrumbs({
5959
<DropdownItem key={`breadcrumb-toc-${heading.id}`} asChild>
6060
<Link
6161
to="."
62-
hash={`#${heading.id}`}
62+
hash={heading.id}
6363
style={{
6464
paddingLeft: `${(heading.level - 2) * 0.5 + 0.5}rem`,
6565
}}

src/components/CodeExampleCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState } from 'react'
22
import { Card } from '~/components/Card'
3-
import { CodeBlock } from '~/components/CodeBlock'
3+
import { CodeBlock } from '~/components/markdown'
44
import { FrameworkIconTabs } from '~/components/FrameworkIconTabs'
55
import type { Framework } from '~/libraries'
66

src/components/CodeExplorer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { CodeBlock } from '~/components/CodeBlock'
2+
import { CodeBlock } from '~/components/markdown'
33
import { FileExplorer } from './FileExplorer'
44
import { InteractiveSandbox } from './InteractiveSandbox'
55
import { CodeExplorerTopBar } from './CodeExplorerTopBar'

src/components/Doc.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { GamHeader } from './Gam'
77
import { Toc } from './Toc'
88
import { renderMarkdown } from '~/utils/markdown'
99
import { DocBreadcrumb } from './DocBreadcrumb'
10-
import { MarkdownContent } from './MarkdownContent'
10+
import { MarkdownContent } from '~/components/markdown'
1111
import type { ConfigSchema } from '~/utils/config'
1212

1313
type DocProps = {

src/components/FeedEntry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { format, formatDistanceToNow } from '~/utils/dates'
2-
import { Markdown } from '~/components/Markdown'
2+
import { Markdown } from '~/components/markdown'
33
import { libraries } from '~/libraries'
44
import { partners } from '~/utils/partners'
55
import { twMerge } from 'tailwind-merge'

src/components/FeedEntryTimeline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import { format, formatDistanceToNow } from '~/utils/dates'
3-
import { Markdown } from '~/components/Markdown'
3+
import { Markdown } from '~/components/markdown'
44
import { Card } from '~/components/Card'
55
import { libraries } from '~/libraries'
66
import { partners } from '~/utils/partners'

src/components/Markdown.tsx

Lines changed: 0 additions & 284 deletions
This file was deleted.

src/components/SimpleMarkdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react'
2-
import { MarkdownLink } from '~/components/MarkdownLink'
2+
import { MarkdownLink } from '~/components/markdown'
33
import type { HTMLProps } from 'react'
44
import parse, {
55
attributesToProps,

src/components/Toc.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ type TocProps = {
2020
activeHeadings: Array<string>
2121
}
2222

23-
export function Toc({
24-
headings,
25-
colorFrom,
26-
colorTo,
27-
textColor,
28-
activeHeadings,
29-
}: TocProps) {
23+
export function Toc({ headings, textColor, activeHeadings }: TocProps) {
3024
return (
3125
<nav className="flex flex-col sticky top-[var(--navbar-height)] max-h-[calc(100dvh-var(--navbar-height))] overflow-hidden">
3226
<div className="py-1">
@@ -47,7 +41,7 @@ export function Toc({
4741
<Link
4842
to="."
4943
title={heading.id}
50-
hash={`#${heading.id}`}
44+
hash={heading.id}
5145
aria-current={activeHeadings.includes(heading.id) && 'location'}
5246
className={twMerge(
5347
'block py-1 pl-2 border-l-2 rounded-r transition-colors duration-200 opacity-60 hover:opacity-100 hover:bg-gray-500/10',

src/components/admin/FeedEntryEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react'
22
import { useState } from 'react'
33
import { useQuery } from '@tanstack/react-query'
44
import { FeedEntry } from '~/components/FeedEntry'
5-
import { Markdown } from '~/components/Markdown'
5+
import { Markdown } from '~/components/markdown'
66
import { libraries } from '~/libraries'
77
import { partners } from '~/utils/partners'
88
import { currentUserQueryOptions } from '~/queries/auth'

0 commit comments

Comments
 (0)