diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 031e31a..446875c 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -73,7 +73,7 @@ function App() { } /> } /> } /> - // error handling page + {/* error handling page */} {errorRoutes.map(({ path, code, title, description }) => ( = ({ const mergedImageProps = { ...defaultImageProps, ...imageProps }; const { align, ...styleProps } = mergedImageProps; const theme = useTheme(); + const syntaxTheme = theme.palette.mode === "dark" ? oneDark : oneLight; return ( = ({ ); }, + code: ({ node: _node, className, children, ...props }) => { + const langMatch = /language-(\w+)/.exec(className ?? ""); + const code = String(children).replace(/\n$/, ""); + const isBlock = !!langMatch || code.includes("\n"); + + if (isBlock) { + return ( + + {code} + + ); + } + + return ( + + {children} + + ); + }, }} > {content} diff --git a/frontend/src/pages/home/Home.tsx b/frontend/src/pages/home/Home.tsx index 81f3880..4e1939f 100644 --- a/frontend/src/pages/home/Home.tsx +++ b/frontend/src/pages/home/Home.tsx @@ -1,6 +1,14 @@ -import { Box, Button, Typography } from "@mui/material"; +import { + Box, + Button, + Dialog, + DialogActions, + DialogContent, + DialogTitle, + Typography, +} from "@mui/material"; import Grid from "@mui/material/Grid"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { useSearchParams } from "react-router-dom"; import { fetchLeaderboardSummaries } from "../../api/api"; import { fetcherApiCallback } from "../../lib/hooks/useApi"; @@ -8,7 +16,8 @@ import { ErrorAlert } from "../../components/alert/ErrorAlert"; import LeaderboardTile from "./components/LeaderboardTile"; import Loading from "../../components/common/loading"; import { ConstrainedContainer } from "../../components/app-layout/ConstrainedContainer"; -import ArrowOutwardIcon from "@mui/icons-material/ArrowOutward"; +import MarkdownRenderer from "../../components/markdown-renderer/MarkdownRenderer"; +import quickStartMarkdown from "./quick-start.md?raw"; interface TopUser { rank: number; @@ -32,6 +41,7 @@ interface LeaderboardSummaries { export default function Home() { const [searchParams] = useSearchParams(); + const [isQuickStartOpen, setIsQuickStartOpen] = useState(false); const useV1 = searchParams.has("v1_query"); const { data, loading, error, errorStatus, call } = fetcherApiCallback< @@ -63,10 +73,7 @@ export default function Home() { + setIsQuickStartOpen(false)} + maxWidth="md" + fullWidth + > + Submit Your First Kernel + + + + + + + + {leaderboards.length > 0 ? ( {leaderboards.map((leaderboard) => ( diff --git a/frontend/src/pages/home/quick-start.md b/frontend/src/pages/home/quick-start.md new file mode 100644 index 0000000..a918061 --- /dev/null +++ b/frontend/src/pages/home/quick-start.md @@ -0,0 +1,25 @@ +## 1) Install `popcorn-cli` + +```bash +curl -fsSL https://raw.githubusercontent.com/gpu-mode/popcorn-cli/main/install.sh | bash +``` + +## 2) Register your account + +```bash +popcorn-cli register discord +``` + +## 3) Download a starter kernel + +```bash +wget https://raw.githubusercontent.com/gpu-mode/reference-kernels/refs/heads/main/problems/pmpp_v2/grayscale_py/submission.py +``` + +## 4) Submit to leaderboard + +```bash +popcorn-cli submit --gpu A100 --leaderboard grayscale_v2 --mode leaderboard submission.py +``` + +For a full overview of the commands, check out the [popcorn-cli repo](https://github.com/gpu-mode/popcorn-cli).