mirror of
https://litchi.icu/ngc2207/judge.git
synced 2025-05-18 22:37:11 +00:00
feat(playground): enhance Markdown component with improved styling and example formatting
This commit is contained in:
parent
1ae17e699b
commit
ededbe8f1b
@ -1,13 +1,14 @@
|
|||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import { MDXRemote } from "next-mdx-remote/rsc";
|
import { MDXRemote } from "next-mdx-remote/rsc";
|
||||||
import "github-markdown-css/github-markdown-dark.css";
|
import "github-markdown-css/github-markdown-dark.css";
|
||||||
|
import "../components/style/markdown.css";
|
||||||
|
|
||||||
export default function Markdown() {
|
export default function Markdown() {
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<>Loading...</>}>
|
<Suspense fallback={<>Loading...</>}>
|
||||||
<div className="h-full w-full p-8 markdown-body">
|
<div className="h-full w-full p-8 markdown-body">
|
||||||
<MDXRemote
|
<MDXRemote
|
||||||
source={`# 两数之和
|
source={`# 1. 两数之和
|
||||||
|
|
||||||
## 📝 问题描述
|
## 📝 问题描述
|
||||||
|
|
||||||
@ -19,12 +20,13 @@ export default function Markdown() {
|
|||||||
|
|
||||||
## 💡 示例
|
## 💡 示例
|
||||||
|
|
||||||
\`\`\`
|
### 示例 1:
|
||||||
输入:nums = [2, 7, 11, 15], target = 9
|
|
||||||
输出:[0, 1]
|
|
||||||
解释:因为 nums[0] + nums[1] == 9 ,返回 [0, 1]。
|
|
||||||
\`\`\`
|
|
||||||
|
|
||||||
|
> 输入:nums = [2,7,11,15], target = 9
|
||||||
|
>
|
||||||
|
> 输出:[0,1]
|
||||||
|
>
|
||||||
|
> 解释:因为 nums[0] + nums[1] == 9 ,返回 [0, 1] 。
|
||||||
`}
|
`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
4
src/app/playground/components/style/markdown.css
Normal file
4
src/app/playground/components/style/markdown.css
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.markdown-body {
|
||||||
|
background-color: #282c34;
|
||||||
|
border: #3e4452;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user