Skip to content

Commit d95f8b5

Browse files
committed
コードブロックのフォントや見た目をエディター・ターミナルに合わせる
1 parent 9916d88 commit d95f8b5

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

app/[docs_id]/markdown.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import Markdown, { Components } from "react-markdown";
22
import remarkGfm from "remark-gfm";
3-
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
3+
import SyntaxHighlighter from "react-syntax-highlighter";
44
import { PythonEmbeddedTerminal } from "../terminal/python/embedded";
55
import { Heading } from "./section";
66
import { AceLang, EditorComponent } from "../terminal/editor";
77
import { ExecFile, ExecLang } from "../terminal/exec";
8+
import { tomorrow } from "react-syntax-highlighter/dist/esm/styles/hljs";
89

910
export function StyledMarkdown({ content }: { content: string }) {
1011
return (
@@ -138,8 +139,8 @@ const components: Components = {
138139
<SyntaxHighlighter
139140
language={match[1]}
140141
PreTag="div"
141-
className="border border-base-300 mx-2 my-2 rounded-lg text-sm! m-2! p-4!"
142-
// style={todo dark theme?}
142+
className="border border-base-content/50 mx-2 my-2 rounded-lg text-sm p-4!"
143+
style={tomorrow} // todo dark theme (editor.tsx で指定したのと同じテーマを選ぶようにすること)
143144
{...props}
144145
>
145146
{String(props.children || "").replace(/\n$/, "")}
@@ -150,8 +151,8 @@ const components: Components = {
150151
return (
151152
<SyntaxHighlighter
152153
PreTag="div"
153-
className="border border-base-300 mx-2 my-2 rounded-lg text-sm! m-2! p-4!"
154-
// style={todo dark theme?}
154+
className="border border-base-content/50 mx-2 my-2 rounded-lg text-sm p-4!"
155+
style={tomorrow} // todo dark theme
155156
{...props}
156157
>
157158
{String(props.children || "").replace(/\n$/, "")}

app/terminal/editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function EditorComponent(props: EditorProps) {
8787
<AceEditor
8888
name={`ace-editor-${props.filename}`}
8989
mode={props.language}
90-
theme="tomorrow" // TODO dark theme
90+
theme="tomorrow" // TODO dark theme (twilightがいいんじゃないかと勝手に思っている)
9191
tabSize={props.tabSize}
9292
width="100%"
9393
height={

0 commit comments

Comments
 (0)