diff --git a/frontend/src/components/docs/CodeBlock.tsx b/frontend/src/components/docs/CodeBlock.tsx index 402dc8a..92d3658 100644 --- a/frontend/src/components/docs/CodeBlock.tsx +++ b/frontend/src/components/docs/CodeBlock.tsx @@ -30,16 +30,18 @@ export function CodeBlock({ children, className, title }: CodeBlockProps) { }; return ( -
+
{title && ( -
+
{title}
)}
           {copied ? (
             
           ) : (
-            
+            
           )}
         
       
diff --git a/frontend/src/components/docs/MarkdownContent.tsx b/frontend/src/components/docs/MarkdownContent.tsx index 6441aeb..8b3db7b 100644 --- a/frontend/src/components/docs/MarkdownContent.tsx +++ b/frontend/src/components/docs/MarkdownContent.tsx @@ -15,6 +15,18 @@ import rehypeAutolinkHeadings from 'rehype-autolink-headings'; import { CodeBlock } from './CodeBlock'; import { cn } from '@/lib/utils'; import 'highlight.js/styles/atom-one-dark.css'; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from '@/components/ui/table'; +import { Separator } from '@/components/ui/separator'; +import { Alert, AlertDescription } from '@/components/ui/alert'; +import { Badge } from '@/components/ui/badge'; +import { Info } from 'lucide-react'; interface MarkdownContentProps { content: string; @@ -23,19 +35,35 @@ interface MarkdownContentProps { export function MarkdownContent({ content, className }: MarkdownContentProps) { return ( -
+
(

{children} @@ -43,7 +71,7 @@ export function MarkdownContent({ content, className }: MarkdownContentProps) { ), h2: ({ children, ...props }) => (

{children} @@ -51,7 +79,7 @@ export function MarkdownContent({ content, className }: MarkdownContentProps) { ), h3: ({ children, ...props }) => (

{children} @@ -59,12 +87,28 @@ export function MarkdownContent({ content, className }: MarkdownContentProps) { ), h4: ({ children, ...props }) => (

{children}

), + h5: ({ children, ...props }) => ( +
+ {children} +
+ ), + h6: ({ children, ...props }) => ( +
+ {children} +
+ ), // Paragraphs and text - improved readability p: ({ children, ...props }) => ( @@ -84,15 +128,32 @@ export function MarkdownContent({ content, className }: MarkdownContentProps) { ), // Links - more prominent with better hover state - a: ({ children, href, ...props }) => ( - - {children} - - ), + a: ({ children, href, className, ...props }) => { + // Check if this is an anchor link generated by rehype-autolink-headings + const isAnchor = className?.includes('subtle-anchor'); + + if (isAnchor) { + return ( + + {children} + + ); + } + + return ( + + {children} + + ); + }, // Lists - improved spacing and hierarchy ul: ({ children, ...props }) => ( @@ -127,12 +188,12 @@ export function MarkdownContent({ content, className }: MarkdownContentProps) { }) => { if (inline) { return ( - {children} - + ); } return ( @@ -143,58 +204,42 @@ export function MarkdownContent({ content, className }: MarkdownContentProps) { }, pre: ({ children, ...props }) => {children}, - // Blockquotes - enhanced callout styling - blockquote: ({ children, ...props }) => ( -
- {children} -
+ // Blockquotes - enhanced callout styling using Alert + blockquote: ({ children }) => ( + + + + {children} + + ), // Tables - improved styling with better borders and hover states table: ({ children, ...props }) => (
- - {children} -
+ {children}
), thead: ({ children, ...props }) => ( - + {children} - - ), - tbody: ({ children, ...props }) => ( - - {children} - - ), - tr: ({ children, ...props }) => ( - - {children} - + ), + tbody: ({ children, ...props }) => {children}, + tr: ({ children, ...props }) => {children}, th: ({ children, ...props }) => ( - + {children} - + ), td: ({ children, ...props }) => ( - + {children} - + ), // Horizontal rule - more prominent - hr: ({ ...props }) =>
, + hr: ({ ...props }) => , // Images - optimized with Next.js Image component img: ({ src, alt }) => {