Skip to content

Commit f0ce397

Browse files
committed
chore: add favicon
1 parent ed1a188 commit f0ce397

10 files changed

Lines changed: 52 additions & 75 deletions

src/app.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<link rel="icon" href="%sveltekit.assets%/favicon.svg" type="image/svg+xml" />
67
%sveltekit.head%
78
</head>
89
<body data-sveltekit-preload-data="hover">

src/lib/dc/export-document.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { normalizeQuoteStyle, type QuoteStyle } from "$lib/editor/quote-style";
1616
import { normalizeTutorialStepNumber } from "$lib/editor/tutorial-block";
1717
import {
1818
defaultProseFontFamily,
19-
safeDcCodeFontFamily as safeCodeFontFamily,
2019
safeDcInlineCodeFontFamily as safeInlineCodeFontFamily,
2120
safeDcProseFontFamily as safeProseFontFamily,
2221
} from "./font-stacks";

src/lib/editor/code-block-highlight.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -743,22 +743,8 @@ function scanMarkdownTokens(
743743
"keyword",
744744
tokens,
745745
);
746-
scanRegexTokens(
747-
line,
748-
lineOffset,
749-
protectedRanges,
750-
/```+[^`]*|~~~+[^~]*/g,
751-
"keyword",
752-
tokens,
753-
);
754-
scanRegexTokens(
755-
line,
756-
lineOffset,
757-
protectedRanges,
758-
/\[[^\]]+]\([^)]+\)/g,
759-
"string",
760-
tokens,
761-
);
746+
scanRegexTokens(line, lineOffset, protectedRanges, /```+[^`]*|~~~+[^~]*/g, "keyword", tokens);
747+
scanRegexTokens(line, lineOffset, protectedRanges, /\[[^\]]+]\([^)]+\)/g, "string", tokens);
762748
}
763749

764750
function scanFunctionTokens(

src/lib/editor/sample-document.ts

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function paragraph(content: JSONContent[]): JSONContent {
1313
}
1414

1515
function summaryItem(content: JSONContent[]): JSONContent {
16-
return { type: "summaryItem", content }
16+
return { type: "summaryItem", content };
1717
}
1818

1919
function codeBlock(
@@ -56,10 +56,7 @@ function tutorialStep(number: string, title: string, content: JSONContent[]): JS
5656
return {
5757
type: "tutorialStep",
5858
attrs: { number },
59-
content: [
60-
{ type: "heading", attrs: { level: 1 }, content: [text(title)] },
61-
...content,
62-
],
59+
content: [{ type: "heading", attrs: { level: 1 }, content: [text(title)] }, ...content],
6360
};
6461
}
6562

@@ -102,12 +99,8 @@ export const sampleDocument: JSONContent = {
10299
type: "summaryBox",
103100
attrs: { label: "이 도구로 할 수 있는 것" },
104101
content: [
105-
summaryItem([
106-
text("Markdown으로 글을 작성하고 에디터에 바로 적용할 수 있다."),
107-
]),
108-
summaryItem([
109-
text("코드블록에 파일명, 언어, 강조줄, 추가줄, 삭제줄 표시를 넣을 수 있다."),
110-
]),
102+
summaryItem([text("Markdown으로 글을 작성하고 에디터에 바로 적용할 수 있다.")]),
103+
summaryItem([text("코드블록에 파일명, 언어, 강조줄, 추가줄, 삭제줄 표시를 넣을 수 있다.")]),
111104
summaryItem([
112105
text("콜아웃, 비교, 튜토리얼, 링크박스, CTA 버튼 같은 서식 블록을 쓸 수 있다."),
113106
]),
@@ -118,9 +111,7 @@ export const sampleDocument: JSONContent = {
118111
],
119112
},
120113
paragraph([
121-
text(
122-
"LLM을 써서 글을 빠르게 초안으로 만들 수도 있다. 상단 툴바의 ",
123-
),
114+
text("LLM을 써서 글을 빠르게 초안으로 만들 수도 있다. 상단 툴바의 "),
124115
codeText("LLM 가이드"),
125116
text(
126117
" 버튼을 누르면 이 도구의 Markdown 문법 설명이 클립보드에 복사된다. 이걸 ChatGPT·Claude·DeepSeek 같은 LLM에 붙여넣고 글 작성을 요청하면 된다.",
@@ -129,9 +120,7 @@ export const sampleDocument: JSONContent = {
129120
callout("tipBox", "Markdown 붙여넣기 방법", "#16a34a", [
130121
text("LLM 결과를 왼쪽 편집기에 직접 붙여넣으면 서식이 깨진다. "),
131122
codeText("Markdown"),
132-
text(
133-
" 버튼으로 입력창을 열고, 거기에 붙여넣은 뒤 ",
134-
),
123+
text(" 버튼으로 입력창을 열고, 거기에 붙여넣은 뒤 "),
135124
codeText("적용하기"),
136125
text("를 눌러야 한다."),
137126
]),
@@ -140,7 +129,9 @@ export const sampleDocument: JSONContent = {
140129
content: [
141130
comparisonColumn("기존 방식", [
142131
paragraph([
143-
text("DCInside 에디터에서 색상·폰트·표를 손으로 하나씩 맞춤. 코드는 고정폭 서식으로만 표현 가능."),
132+
text(
133+
"DCInside 에디터에서 색상·폰트·표를 손으로 하나씩 맞춤. 코드는 고정폭 서식으로만 표현 가능.",
134+
),
144135
]),
145136
]),
146137
comparisonColumn("dc-code-paste 사용", [
@@ -154,11 +145,7 @@ export const sampleDocument: JSONContent = {
154145
type: "tutorialBlock",
155146
content: [
156147
tutorialStep("01", "LLM 가이드 복사", [
157-
paragraph([
158-
text("상단 툴바 "),
159-
codeText("LLM 가이드"),
160-
text(" 버튼을 클릭한다."),
161-
]),
148+
paragraph([text("상단 툴바 "), codeText("LLM 가이드"), text(" 버튼을 클릭한다.")]),
162149
]),
163150
tutorialStep("02", "LLM에게 글 요청", [
164151
paragraph([
@@ -175,7 +162,9 @@ export const sampleDocument: JSONContent = {
175162
tutorialStep("04", "적용 및 미리보기 확인", [
176163
paragraph([
177164
codeText("적용하기"),
178-
text(" 버튼을 누르면 에디터에 내용이 반영되고, 오른쪽 미리보기에서 결과를 확인할 수 있다."),
165+
text(
166+
" 버튼을 누르면 에디터에 내용이 반영되고, 오른쪽 미리보기에서 결과를 확인할 수 있다.",
167+
),
179168
]),
180169
]),
181170
tutorialStep("05", "디씨 복사", [
@@ -218,7 +207,9 @@ export const sampleDocument: JSONContent = {
218207
:::`,
219208
),
220209
callout("warningBox", "줄 번호 범위 주의", "#d97706", [
221-
text("강조줄·추가줄·삭제줄 번호는 코드블록 실제 줄 수 안에서 지정해야 한다. 범위를 벗어나면 조용히 무시된다."),
210+
text(
211+
"강조줄·추가줄·삭제줄 번호는 코드블록 실제 줄 수 안에서 지정해야 한다. 범위를 벗어나면 조용히 무시된다.",
212+
),
222213
]),
223214
{
224215
type: "referenceList",

src/lib/highlighter/catalog.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@ type SupportedLanguage = {
55
readonly shikiLanguage?: string;
66
};
77

8-
type SupportedLanguageGroupId =
9-
| "native"
10-
| "web"
11-
| "data"
12-
| "docs"
13-
| "diff"
14-
| "script"
15-
| "general";
8+
type SupportedLanguageGroupId = "native" | "web" | "data" | "docs" | "diff" | "script" | "general";
169

1710
export const supportedLanguageGroupLabels = {
1811
native: "시스템/네이티브",

static/favicon.svg

Lines changed: 13 additions & 0 deletions
Loading

tests/unit/code-block-highlight.test.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,11 @@ describe("editor code block highlighting", () => {
6161
});
6262

6363
it("highlights common markdown and mermaid tokens", () => {
64-
const markdown = [
65-
"# 제목",
66-
"- 항목",
67-
"[문서](https://example.com)",
68-
].join("\n");
69-
const mermaid = [
70-
"graph TD",
71-
" A --> B",
72-
"%% comment",
73-
].join("\n");
64+
const markdown = ["# 제목", "- 항목", "[문서](https://example.com)"].join("\n");
65+
const mermaid = ["graph TD", " A --> B", "%% comment"].join("\n");
7466

7567
expect(tokenTexts(markdown, "keyword", "markdown")).toEqual(["#", "- "]);
76-
expect(tokenTexts(markdown, "string", "markdown")).toEqual([
77-
"[문서](https://example.com)",
78-
]);
68+
expect(tokenTexts(markdown, "string", "markdown")).toEqual(["[문서](https://example.com)"]);
7969
expect(tokenTexts(mermaid, "keyword", "mermaid")).toEqual(["graph"]);
8070
expect(tokenTexts(mermaid, "comment", "mermaid")).toEqual(["%% comment"]);
8171
});

tests/unit/code-line-range.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ describe("code line range", () => {
2323
].join("\n");
2424

2525
function lineStartOffset(line: number) {
26-
return text.split("\n").slice(0, line - 1).join("\n").length + (line > 1 ? 1 : 0);
26+
return (
27+
text
28+
.split("\n")
29+
.slice(0, line - 1)
30+
.join("\n").length + (line > 1 ? 1 : 0)
31+
);
2732
}
2833

2934
it("maps code offsets to one-based line numbers", () => {
@@ -33,11 +38,7 @@ describe("code line range", () => {
3338
});
3439

3540
it("creates an inclusive line range from a text selection", () => {
36-
const range = selectedCodeLineRangeFromOffsets(
37-
text,
38-
lineStartOffset(9),
39-
lineStartOffset(12),
40-
);
41+
const range = selectedCodeLineRangeFromOffsets(text, lineStartOffset(9), lineStartOffset(12));
4142

4243
expect(range).toEqual({ fromLine: 9, toLine: 11 });
4344
expect(range && codeLineRangeLabel(range)).toBe("9-11번 줄");

tests/unit/highlighter-catalog.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ describe("highlighter catalog", () => {
2222
const docsGroup = supportedLanguageGroups.find((group) => group.id === "docs");
2323

2424
expect(docsGroup?.label).toBe("문서/다이어그램");
25-
expect(docsGroup?.languages.map((language) => language.id)).toEqual([
26-
"markdown",
27-
"mermaid",
28-
]);
25+
expect(docsGroup?.languages.map((language) => language.id)).toEqual(["markdown", "mermaid"]);
2926
});
3027

3128
it("keeps every listed language selectable and grouped", () => {

tests/unit/sample-document.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ function collectNodeTypes(node: JSONContent, found = new Set<string>()): Set<str
3939
return found;
4040
}
4141

42-
function collectNodesByType(node: JSONContent, type: string, found: JSONContent[] = []): JSONContent[] {
42+
function collectNodesByType(
43+
node: JSONContent,
44+
type: string,
45+
found: JSONContent[] = [],
46+
): JSONContent[] {
4347
if (node.type === type) {
4448
found.push(node);
4549
}
@@ -69,7 +73,9 @@ describe("sampleDocument", () => {
6973
expect(text).toContain("적용하기를 눌러야 한다");
7074
expect(text).not.toContain("Go 반복문 정복: for 하나로 모든 루프를 제어한다");
7175
expect(text).not.toContain("Go에는 for 키워드 하나만 존재하며");
72-
expect(text).not.toContain("for range로 슬라이스를 순회할 때 반환되는 value는 요소의 복사본이다.");
76+
expect(text).not.toContain(
77+
"for range로 슬라이스를 순회할 때 반환되는 value는 요소의 복사본이다.",
78+
);
7379
});
7480

7581
it("highlights the embedded example.md block as Markdown", () => {

0 commit comments

Comments
 (0)