Skip to content

Commit d6450d4

Browse files
authored
Merge pull request #125 from krsy0411/krsy0411-bug
버그 수정 & 문서 작성
2 parents 6cfabb3 + 73043c7 commit d6450d4

5 files changed

Lines changed: 86 additions & 16 deletions

File tree

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
<nav
2828
id="sidebar"
2929
style="scroll-behavior: smooth"
30-
class="dark:bg-gray-dark-100 fixed top-0 z-40 hidden h-screen w-full flex-none overflow-x-hidden overflow-y-auto bg-[#f9f9fa] text-[12px] md:sticky md:top-12 md:z-auto md:block md:h-[calc(100vh-64px)] md:w-[240px]"
30+
class="dark:bg-gray-dark-100 fixed top-0 z-40 hidden h-screen w-full flex-none overflow-x-hidden overflow-y-auto bg-[#f9f9fa] md:sticky md:top-12 md:z-auto md:block md:h-[calc(100vh-64px)] md:w-[320px]"
3131
>
3232
<div class="dark:bg-gray-dark-100 z-50 w-full p-4 md:block">
3333
<div id="nav__get-started" class="px-2 py-2 text-black">
3434
<div class="flex w-full items-center justify-between">
3535
<a
36-
class="flex items-center text-sm font-light text-black hover:text-blue-500 md:text-base dark:hover:text-blue-500"
36+
class="flex items-center font-light text-black hover:text-blue-500 md:text-base dark:hover:text-blue-500"
3737
href="#/get-started"
3838
>
3939
<span class="m-0 p-0 pr-2">
@@ -83,7 +83,7 @@
8383
<hr class="text-gray-light-200 dark:text-gray-dark-300 m-2" />
8484
<div
8585
id="nav__content"
86-
class="flex flex-col text-sm font-light text-black md:text-base"
86+
class="flex flex-col font-light text-black md:text-base"
8787
>
8888
<ul>
8989
<li
@@ -665,7 +665,7 @@
665665
id="aside-toc"
666666
class="sticky top-12 h-full min-w-80 overflow-y-auto px-2 py-4 lg:block"
667667
>
668-
<div id="toc" class="text-[16px] text-black"></div>
668+
<div id="toc" class="text-[14px] text-black font-bold"></div>
669669
</aside>
670670
</main>
671671

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Overview of the Docker workshop
2+
3+
이번 45분 워크숍에서는 도커를 시작하는 방법에 대한 단계별 지침을 제공합니다. 이번 워크숍에서는 다음 내용에 대해 알려줍니다 :
4+
5+
- 컨테이너로 이미지를 빌드하고 실행합니다.
6+
- 도커 허브를 사용하여 이미지를 공유합니다.
7+
- 데이터베이스와 함께 여러 컨테이너를 사용하여 도커 애플리케이션을 배포합니다.
8+
- 도커 컴포즈(Docker Compose)를 사용하여 애플리케이션을 실행합니다.
9+
10+
## What is a container?
11+
12+
컨테이너는 해당 호스트 머신에서 실행되는 다른 모든 프로세스와 격리된 호스트 머신에서 실행되는 샌드박스 프로세스입니다. 이러한 격리는 오랫동안 리눅스에서 사용해 온 [kernel namespaces and cgroups](https://medium.com/@saschagrunert/demystifying-containers-part-i-kernel-space-2c53d6979504) 기능을 활용합니다. 도커는 이러한 기능을 접근성 있고 사용하기 쉽게 만듭니다. 요약하자면, 컨테이너는 :
13+
14+
- 실행 가능한 이미지 인스턴스입니다. 도커 API 또는 CLI를 사용하여 컨테이너를 생성, 시작, 중지, 이동 또는 삭제할 수 있습니다.
15+
- 로컬 머신, 가상 머신에서 실행하거나 클라우드에 배포할 수 있습니다.
16+
- 휴대성이 좋습니다(아무 OS에서 실행 가능합니다).
17+
- 다른 컨테이너와 격리되고 자체 소프트웨어, 바이너리, 구성 등을 실행합니다.
18+
19+
`chroot`에 익숙하다면, 컨테이너를 `chroot`의 확장된 버전으로 생각해 보세요. 파일 시스템은 이미지에서 생성됩니다. 하지만, 컨테이너는 chroot를 사용할 때는 사용 못 하는 추가 격리 기능을 제공합니다.
20+
21+
## What is an image?
22+
23+
실행 중인 컨테이너는 격리된 파일 시스템을 사용합니다. 이미지가 이러한 격리된 파일시스템을 제공하며, 이미지는 애플리케이션 실행에 필요한 모든 것(모든 종속성, 구성, 스크립트, 바이너리 등)을 포함해야 합니다. 이미지는 환경 변수, 실행할 기본 명령어, 기타 메타데이터와 같은 컨테이너를 위한 다른 구성도 포함합니다.
24+
25+
## Next steps
26+
27+
이 섹션에서는, 컨테이너와 이미지에 대해 알아보았습니다.
28+
29+
다음 내용에서는, 간단한 애플리케이션을 컨테이너화 해보고 개념을 직접 살펴보겠습니다.
30+
31+
<button-component href="/#/get-started/workshop/02_our_app" title="Containerize an application" />

src/scripts/components/button-component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ButtonComponent extends HTMLElement {
2121

2222
this.innerHTML = `
2323
<button type="button" class="not-prose my-4">
24-
<a href="${href}" class="cursor-pointer py-2 px-4 rounded bg-[#086dd7] text-white!">
24+
<a href="${href}" class="cursor-pointer py-2 px-4 rounded bg-[#086dd7] hover:bg-[#2560ff] text-white!">
2525
${title}
2626
</a>
2727
</button>

src/scripts/components/header-component.ts

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,28 @@ class HeaderComponent extends HTMLElement {
33
super();
44
}
55

6+
setupNavigationListeners() {
7+
// URL 해시 변경 감지
8+
window.addEventListener('hashchange', () => {
9+
const currentPath = window.location.hash.replace('#', '');
10+
const navItems = this.querySelectorAll('.nav-item');
11+
12+
navItems.forEach((item) => {
13+
const itemPath = item.getAttribute('data-path');
14+
if (itemPath && currentPath.startsWith(itemPath)) {
15+
item.classList.remove('border-b-transparent');
16+
item.classList.add('border-b-white');
17+
} else {
18+
item.classList.remove('border-b-white');
19+
item.classList.add('border-b-transparent');
20+
}
21+
});
22+
});
23+
}
24+
625
connectedCallback() {
726
this.innerHTML = `
8-
<header class="w-full sticky top-0 z-20 h-12 px-6 text-white bg-[#086dd7]">
27+
<header class="w-full sticky top-0 z-20 h-16 px-6 text-white bg-[#086dd7]">
928
<div class="max-w-[1920px] mx-auto flex lg:gap-8 gap-2 h-full items-center justify-between">
1029
<div class="flex h-full items-center lg:gap-8 gap-2">
1130
<div>
@@ -18,18 +37,18 @@ class HeaderComponent extends HTMLElement {
1837
/>
1938
</a>
2039
</div>
21-
<nav class="mt-1">
40+
<nav class="mt-1 hidden md:block">
2241
<ul class="flex text-sm md:text-base lg:gap-4">
23-
<li class="border-b-4 border-transparent hover:border-white/20 cursor-pointer">
42+
<li class="nav-item border-b-4 border-transparent hover:border-white/20 cursor-pointer" data-path="/get-started">
2443
<a class="block px-2 py-1 whitespace-nowrap" href="#/get-started">Get started</a>
2544
</li>
26-
<li class="border-b-4 border-transparent hover:border-white/20 cursor-pointer">
45+
<li class="nav-item border-b-4 border-transparent hover:border-white/20 cursor-pointer" data-path="/guides">
2746
<a class="block px-2 py-1 whitespace-nowrap" href="#/guides">Guides</a>
2847
</li>
29-
<li class="border-b-4 border-transparent hover:border-white/20 cursor-pointer">
48+
<li class="nav-item border-b-4 border-transparent hover:border-white/20 cursor-pointer" data-path="/manuals">
3049
<a class="block px-2 py-1 whitespace-nowrap" href="#/manuals">Manuals</a>
3150
</li>
32-
<li class="border-b-4 border-transparent hover:border-white/20 cursor-pointer">
51+
<li class="nav-item border-b-4 border-transparent hover:border-white/20 cursor-pointer" data-path="/reference">
3352
<a class="block px-2 py-1 whitespace-nowrap" href="#/reference">Reference</a>
3453
</li>
3554
</ul>
@@ -38,6 +57,8 @@ class HeaderComponent extends HTMLElement {
3857
</div>
3958
</header>
4059
`;
60+
61+
this.setupNavigationListeners();
4162
}
4263
}
4364

src/scripts/table-contents.ts

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ export const initializeTableContents = () => {
2323
const toc = document.getElementById('toc') as HTMLElement;
2424

2525
toc.innerHTML = '';
26-
if (!content.querySelector('h1')) return;
26+
27+
const headings = content.querySelectorAll('h2, h3');
28+
if (headings.length === 0) return;
2729

2830
const tocTitle = document.createElement('p');
2931
const tocList = document.createElement('ul');
30-
const headings = content.querySelectorAll('h2, h3');
3132

32-
tocTitle.classList.add('text-black', 'font-light', 'text-2xl', 'pb-5');
33+
tocTitle.classList.add('text-black', 'font-light', 'text-lg', 'pb-5');
3334
tocTitle.textContent = 'Table of contents';
3435

3536
const headingMap: Record<string, HTMLLIElement> = {};
@@ -40,13 +41,30 @@ export const initializeTableContents = () => {
4041
'max-w-64',
4142
'font-extralight',
4243
'hover:bg-gray-300',
43-
'hover:font-light',
44+
'hover:font-semibold',
4445
'cursor-pointer',
4546
'truncate'
4647
);
4748
const link = document.createElement('a');
4849
link.classList.add('flex', 'justify-start', 'items-stretch', 'p-1');
49-
link.textContent = heading.textContent || '';
50+
51+
const headingText = heading.textContent || '';
52+
link.textContent =
53+
headingText.length > 30
54+
? headingText.substring(0, 30) + '...'
55+
: headingText;
56+
57+
// 클릭 시 해당 heading으로 스크롤 이동
58+
link.addEventListener('click', (e) => {
59+
e.preventDefault();
60+
const headingRect = heading.getBoundingClientRect();
61+
const offsetTop = window.scrollY + headingRect.top - 60; // 60px 위로 조정
62+
63+
window.scrollTo({
64+
top: offsetTop,
65+
behavior: 'smooth',
66+
});
67+
});
5068

5169
listItem.appendChild(link);
5270
tocList.appendChild(listItem);

0 commit comments

Comments
 (0)