Skip to content

Commit 9e085ac

Browse files
committed
Refactor test
1 parent fad0b9c commit 9e085ac

13 files changed

Lines changed: 252 additions & 246 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<a href="https://discord.gg/8zjcGc7cWh">
2424
<img alt="Discord" src="https://img.shields.io/discord/1321362173619994644.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2" />
2525
</a>
26-
<a href="https://codecov.io/gh/dev-five-git/braillify" >
27-
<img src="https://codecov.io/gh/dev-five-git/braillify/graph/badge.svg?token=8I5GMB2X5B"/>
26+
<a href="https://codecov.io/gh/dev-five-git/braillify" >
27+
<img src="https://codecov.io/gh/dev-five-git/braillify/graph/badge.svg?token=8I5GMB2X5B"/>
2828
</a>
2929
<a href="https://pypi.org/project/braillify" target="_blank">
3030
<img src="https://img.shields.io/pypi/v/braillify?color=%2334D058&label=pypi%20package" alt="Package version">

apps/landing/src/app/docs/RightIndex.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Box, css, Flex, Text, VStack } from '@devup-ui/react'
33
import Link from 'next/link'
44
import { usePathname } from 'next/navigation'
5-
import { useEffect, useState } from 'react'
5+
import { useMemo } from 'react'
66

77
function IndexMenu({
88
children,
@@ -41,14 +41,12 @@ function IndexMenu({
4141
export function RightIndex() {
4242
const pathname = usePathname()
4343
const editUrl = `https://github.com/dev-five-git/braillify/tree/main/apps/landing/src/app/docs${pathname.split('docs')[1]}/page.mdx`
44-
const [menus, setMenus] = useState<
45-
{
46-
text: string
47-
sub?: boolean
48-
onClick?: () => void
49-
}[]
50-
>([])
51-
useEffect(() => {
44+
return <RightIndexInner key={pathname} editUrl={editUrl} />
45+
}
46+
47+
function RightIndexInner({ editUrl }: { editUrl: string }) {
48+
const menus = useMemo(() => {
49+
if (typeof document === 'undefined') return []
5250
const elements = document.querySelectorAll(
5351
'.markdown-body h1, .markdown-body h2',
5452
)
@@ -64,8 +62,8 @@ export function RightIndex() {
6462
},
6563
})
6664
}
67-
setMenus(menus)
68-
}, [pathname])
65+
return menus
66+
}, [])
6967

7068
return (
7169
<VStack gap="16px" p="20px 16px" w="200px">

apps/landing/src/app/docs/api/page.mdx

Lines changed: 150 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2,108 +2,174 @@ export const metadata = {
22
title: 'API',
33
alternates: {
44
canonical: '/docs/api',
5-
}
5+
},
66
}
77

88
# API
9-
<br/>
9+
10+
<br />
1011

1112
Braillify 는 Node.js(Wasm for Web) 와 Python 그리고 Rust를 지원합니다.
1213

1314
모든 함수는 표현 방식만 다를 뿐 사용법과 함수명은 같습니다.
1415

15-
16-
<table style={{
17-
width: '100%',
18-
borderCollapse: 'collapse',
19-
margin: '20px 0'
20-
}}>
16+
<table
17+
style={{
18+
width: '100%',
19+
borderCollapse: 'collapse',
20+
margin: '20px 0',
21+
}}
22+
>
2123
<thead>
2224
<tr>
23-
<th style={{
24-
padding: '12px',
25-
textAlign: 'left',
26-
borderBottom: '2px solid #ddd',
27-
backgroundColor: 'var(--containerBackground)',
28-
color: 'var(--text)'
29-
}}>Node.js 함수</th>
30-
<th style={{
31-
padding: '12px',
32-
textAlign: 'left',
33-
borderBottom: '2px solid #ddd',
34-
backgroundColor: 'var(--containerBackground)',
35-
color: 'var(--text)'
36-
}}>Python 함수</th>
37-
<th style={{
38-
padding: '12px',
39-
textAlign: 'left',
40-
borderBottom: '2px solid #ddd',
41-
backgroundColor: 'var(--containerBackground)',
42-
color: 'var(--text)'
43-
}}>Rust 함수</th>
44-
<th style={{
45-
padding: '12px',
46-
textAlign: 'left',
47-
borderBottom: '2px solid #ddd',
48-
backgroundColor: 'var(--containerBackground)',
49-
color: 'var(--text)'
50-
}}>설명</th>
25+
<th
26+
style={{
27+
padding: '12px',
28+
textAlign: 'left',
29+
borderBottom: '2px solid #ddd',
30+
backgroundColor: 'var(--containerBackground)',
31+
color: 'var(--text)',
32+
}}
33+
>
34+
Node.js 함수
35+
</th>
36+
<th
37+
style={{
38+
padding: '12px',
39+
textAlign: 'left',
40+
borderBottom: '2px solid #ddd',
41+
backgroundColor: 'var(--containerBackground)',
42+
color: 'var(--text)',
43+
}}
44+
>
45+
Python 함수
46+
</th>
47+
<th
48+
style={{
49+
padding: '12px',
50+
textAlign: 'left',
51+
borderBottom: '2px solid #ddd',
52+
backgroundColor: 'var(--containerBackground)',
53+
color: 'var(--text)',
54+
}}
55+
>
56+
Rust 함수
57+
</th>
58+
<th
59+
style={{
60+
padding: '12px',
61+
textAlign: 'left',
62+
borderBottom: '2px solid #ddd',
63+
backgroundColor: 'var(--containerBackground)',
64+
color: 'var(--text)',
65+
}}
66+
>
67+
설명
68+
</th>
5169
</tr>
5270
</thead>
5371
<tbody>
5472
<tr>
55-
<td style={{
56-
padding: '12px',
57-
borderBottom: '1px solid #ddd'
58-
}}>encode</td>
59-
<td style={{
60-
padding: '12px',
61-
borderBottom: '1px solid #ddd'
62-
}}>encode</td>
63-
<td style={{
64-
padding: '12px',
65-
borderBottom: '1px solid #ddd'
66-
}}>encode</td>
67-
<td style={{
68-
padding: '12px',
69-
borderBottom: '1px solid #ddd'
70-
}}>문자열을 바이너리로 변환합니다.</td>
73+
<td
74+
style={{
75+
padding: '12px',
76+
borderBottom: '1px solid #ddd',
77+
}}
78+
>
79+
encode
80+
</td>
81+
<td
82+
style={{
83+
padding: '12px',
84+
borderBottom: '1px solid #ddd',
85+
}}
86+
>
87+
encode
88+
</td>
89+
<td
90+
style={{
91+
padding: '12px',
92+
borderBottom: '1px solid #ddd',
93+
}}
94+
>
95+
encode
96+
</td>
97+
<td
98+
style={{
99+
padding: '12px',
100+
borderBottom: '1px solid #ddd',
101+
}}
102+
>
103+
문자열을 바이너리로 변환합니다.
104+
</td>
71105
</tr>
72106
<tr>
73-
<td style={{
74-
padding: '12px',
75-
borderBottom: '1px solid #ddd'
76-
}}>translateToUnicode</td>
77-
<td style={{
78-
padding: '12px',
79-
borderBottom: '1px solid #ddd'
80-
}}>translate_to_unicode</td>
81-
<td style={{
82-
padding: '12px',
83-
borderBottom: '1px solid #ddd'
84-
}}>encode_to_unicode</td>
85-
<td style={{
86-
padding: '12px',
87-
borderBottom: '1px solid #ddd'
88-
}}>문자열을 유니코드 점자로 변환합니다.</td>
107+
<td
108+
style={{
109+
padding: '12px',
110+
borderBottom: '1px solid #ddd',
111+
}}
112+
>
113+
translateToUnicode
114+
</td>
115+
<td
116+
style={{
117+
padding: '12px',
118+
borderBottom: '1px solid #ddd',
119+
}}
120+
>
121+
translate_to_unicode
122+
</td>
123+
<td
124+
style={{
125+
padding: '12px',
126+
borderBottom: '1px solid #ddd',
127+
}}
128+
>
129+
encode_to_unicode
130+
</td>
131+
<td
132+
style={{
133+
padding: '12px',
134+
borderBottom: '1px solid #ddd',
135+
}}
136+
>
137+
문자열을 유니코드 점자로 변환합니다.
138+
</td>
89139
</tr>
90140
<tr>
91-
<td style={{
92-
padding: '12px',
93-
borderBottom: '1px solid #ddd'
94-
}}>translateToBrailleFont</td>
95-
<td style={{
96-
padding: '12px',
97-
borderBottom: '1px solid #ddd'
98-
}}>translate_to_braille_font</td>
99-
<td style={{
100-
padding: '12px',
101-
borderBottom: '1px solid #ddd'
102-
}}>encode_to_braille_font</td>
103-
<td style={{
104-
padding: '12px',
105-
borderBottom: '1px solid #ddd'
106-
}}>문자열을 점자 폰트로 변환합니다.</td>
141+
<td
142+
style={{
143+
padding: '12px',
144+
borderBottom: '1px solid #ddd',
145+
}}
146+
>
147+
translateToBrailleFont
148+
</td>
149+
<td
150+
style={{
151+
padding: '12px',
152+
borderBottom: '1px solid #ddd',
153+
}}
154+
>
155+
translate_to_braille_font
156+
</td>
157+
<td
158+
style={{
159+
padding: '12px',
160+
borderBottom: '1px solid #ddd',
161+
}}
162+
>
163+
encode_to_braille_font
164+
</td>
165+
<td
166+
style={{
167+
padding: '12px',
168+
borderBottom: '1px solid #ddd',
169+
}}
170+
>
171+
문자열을 점자 폰트로 변환합니다.
172+
</td>
107173
</tr>
108174
</tbody>
109175
</table>

0 commit comments

Comments
 (0)