Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@
## 2024-08-16 - ๋ช…ํ™•ํ•œ ํŽ˜์ด์ง€ ์ปจํ…์ŠคํŠธ๋ฅผ ์œ„ํ•œ ๋ฌธ์„œ ์ œ๋ชฉ(Title) ๊ฐœ์„ 
**Learning:** ํŒŒ์ผ ์„œ๋ฒ„ ํƒ์ƒ‰ ์‹œ `<title>` ์š”์†Œ์— ๋‹จ์ˆœํžˆ ๋””๋ ‰ํ† ๋ฆฌ ์ด๋ฆ„๋งŒ ์ œ๊ณตํ•˜๋ฉด, ์‚ฌ์šฉ์ž๊ฐ€ ์—ฌ๋Ÿฌ ํƒญ์„ ์—ด์–ด๋‘์—ˆ๊ฑฐ๋‚˜ ํ™”๋ฉด ํŒ๋…๊ธฐ๋ฅผ ํ†ตํ•ด ์ฐฝ์„ ์ „ํ™˜ํ•  ๋•Œ ํ•ด๋‹น ํŽ˜์ด์ง€๊ฐ€ '๋””๋ ‰ํ† ๋ฆฌ ๋ชฉ๋ก'์ž„์„ ์ฆ‰์‹œ ์ธ์ง€ํ•˜๊ธฐ ์–ด๋ ค์›Œ ์ ‘๊ทผ์„ฑ ๋ฐ ์‚ฌ์šฉ์„ฑ์ด ์ €ํ•˜๋ฉ๋‹ˆ๋‹ค.
**Action:** ํ•ญ์ƒ `<title>` ์š”์†Œ์— ํŽ˜์ด์ง€์˜ ๋ชฉ์ ์„ ๋ช…ํ™•ํžˆ ์•Œ ์ˆ˜ ์žˆ๋Š” ์ ‘๋ฏธ์‚ฌ(์˜ˆ: " - ๋””๋ ‰ํ† ๋ฆฌ ๋ชฉ๋ก")๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ, ๋ธŒ๋ผ์šฐ์ € ํƒญ ์ด๋ฆ„๋งŒ์œผ๋กœ๋„ ์ปจํ…์ŠคํŠธ๋ฅผ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜์‹ญ์‹œ์˜ค.

## 2024-08-20 - Bidirectional(BiDi) ํ…์ŠคํŠธ ์ง€์› ๊ฐœ์„ 
**ํ•™์Šต:** ์•„๋ž์–ด๋‚˜ ํžˆ๋ธŒ๋ฆฌ์–ด์™€ ๊ฐ™์€ Right-To-Left(RTL) ํ…์ŠคํŠธ๊ฐ€ ํŒŒ์ผ/๋””๋ ‰ํ† ๋ฆฌ ์ด๋ฆ„์— ํฌํ•จ๋  ๊ฒฝ์šฐ, ๋ช…์‹œ์ ์ธ ๋ฐฉํ–ฅ์„ฑ(Directionality) ์ง€์ •์ด ์—†์œผ๋ฉด Left-To-Right(LTR) ๋ ˆ์ด์•„์›ƒ ๋‚ด์—์„œ ํ…์ŠคํŠธ๊ฐ€ ๊นจ์ง€๊ฑฐ๋‚˜ ์ž˜๋ชป ๋ Œ๋”๋ง๋˜์–ด ์ ‘๊ทผ์„ฑ ๋ฐ ๊ฐ€๋…์„ฑ์„ ํฌ๊ฒŒ ์ €ํ•ดํ•ฉ๋‹ˆ๋‹ค.
**์กฐ์น˜:** ํ…์ŠคํŠธ๋ฅผ ํฌํ•จํ•˜๋Š” ์š”์†Œ(์˜ˆ: `<h1>`, ํŒŒ์ผ ์ด๋ฆ„์„ ๊ฐ์‹ธ๋Š” `<span>`)์— ํ•ญ์ƒ `dir="auto"` ์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜์—ฌ, ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์ฝ˜ํ…์ธ  ์ž์ฒด์˜ ํ…์ŠคํŠธ ๋ฐฉํ–ฅ์„ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๊ฐ์ง€ํ•˜๊ณ  ๋ Œ๋”๋งํ•  ์ˆ˜ ์žˆ๋„๋ก ๋ณด์žฅํ•˜์‹ญ์‹œ์˜ค.
6 changes: 3 additions & 3 deletions src/main/kotlin/html4tree/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ fun process_dir(curr_dir: File, excludeSet: Set<String>? = null, dirFiles: Array
</head>
<body>
<main>
<h1>${directoryName.escapeHtml()}</h1>
<h1 dir="auto">${directoryName.escapeHtml()}</h1>
<nav aria-label="๋””๋ ‰ํ† ๋ฆฌ ๋ชฉ๋ก">
<ul role="list">
<li><a class="dir-link" href="./.." aria-label="์ƒ์œ„ ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™" title="์ƒ์œ„ ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™"><span class="icon" aria-hidden="true">&#x21B0;</span> <span>..</span></a></li>
<li><a class="dir-link" href="./.." aria-label="์ƒ์œ„ ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™" title="์ƒ์œ„ ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™"><span class="icon" aria-hidden="true">&#x21B0;</span> <span dir="auto">..</span></a></li>
"""

val index_middle = fun():String{
Expand Down Expand Up @@ -448,7 +448,7 @@ fun process_dir(curr_dir: File, excludeSet: Set<String>? = null, dirFiles: Array
val encodedHref = if (isLinkedDirectory) { "./${fileName.urlEncodePath()}/" } else { "./${fileName.urlEncodePath()}" }
val ariaLabel = "${fileName} ${if (isLinkedDirectory) { "๋””๋ ‰ํ† ๋ฆฌ" } else { "ํŒŒ์ผ" }}".escapeHtml()
val icon = if (isLinkedDirectory) { "&#128193;" } else { "&#128196;" }
l.append(""" <li><a class="dir-link" href="${encodedHref}" aria-label="${ariaLabel}" title="${ariaLabel}"><span class="icon" aria-hidden="true">${icon}</span> <span>${fileName.escapeHtml()}</span></a></li>""")
l.append(""" <li><a class="dir-link" href="${encodedHref}" aria-label="${ariaLabel}" title="${ariaLabel}"><span class="icon" aria-hidden="true">${icon}</span> <span dir="auto">${fileName.escapeHtml()}</span></a></li>""")
Comment thread
coderabbitai[bot] marked this conversation as resolved.
l.append('\n')
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/html4tree/GeneratedIndexReadabilityTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class GeneratedIndexReadabilityTest {
)

val generatedHtml = generatedHtml()
val parentIndex = generatedHtml.indexOf("<span>..</span>")
val parentIndex = generatedHtml.indexOf("<span dir=\"auto\">..</span>")
val firstIndex = generatedHtml.indexOf("alpha.txt")
val middleIndex = generatedHtml.indexOf("middle.txt")
val lastIndex = generatedHtml.indexOf("zulu.txt")
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/html4tree/MainTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ class MainTest {
assertTrue(indexHtml.exists())
val content = indexHtml.readText()
assertTrue(content.contains("<title>Root - ๋””๋ ‰ํ† ๋ฆฌ ๋ชฉ๋ก</title>"))
assertTrue(content.contains("<h1>Root</h1>"))
assertTrue(content.contains("<h1 dir=\"auto\">Root</h1>"))
}

}
Loading