Skip to content

Commit 5c64a64

Browse files
committed
feat: diagram with mermaid
1 parent 7258135 commit 5c64a64

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

docs/mkdocs/gitlab_pages.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
# GitLab Pages 사용법
1+
# GitLab Pages
22

3-
1. `gl-pages` branch에 해당 파일 `.gitlab-ci.yml` 으로 커밋
3+
mkdocs로 작성된 문서는 GitLab Pages로 호스팅합니다.
4+
5+
GitLab을 이용하는 이유는 다음과 같습니다.
6+
7+
1. GitHub Pages는 private repo로 하려면 Enterprise plan 필요
8+
2. GitLab Pages는 read / write 권한 및 문서 버전관리가 용이
9+
10+
GitHub repo의 main branch로 push 한 경우, GitHub CI에서 GitLab으로 push합니다. 그러면 GitLab CI가 돌며 page 호스팅을 완료합니다.
11+
12+
## mkdocs용 GitLab repo 세팅
13+
14+
1. deargen-ai 계정으로 로그인해서 repo 만들기 (예: deargen-ai/ppmi-docs)
15+
- 🚨 deargen group에 만들면 안됨! group 프로젝트는 access token 생성이 유료 계정만 가능함.
16+
2. `gl-pages` branch에 해당 파일 `.gitlab-ci.yml` 으로 커밋
417
- 출처: https://gitlab.com/pages/plain-html
518

619
```yaml
@@ -20,7 +33,8 @@
2033
이제 `public/` 폴더에 웹사이트 넣으면 페이지가 호스팅 됨.
2134
본 template은 GitHub Actions가 자동으로 GitLab으로 push하여 document webpage가 생성됨.
2235

23-
2. GitLab 프로젝트에서 `Deploy -> Pages -> Use unique domain` 체크 해제해야 URL이 깔끔하게 나옴.
24-
3. 기밀 문서가 아닌 경우, `Settings -> General -> Visibility (expand) -> Pages -> Everyone` 으로 설정하면 전체 공개.
25-
4. 프로젝트에서 `Settings -> Access Tokens -> Add new token` 에서 expiration 1년 뒤로 설정, `write repository` scope, Maintainer role 설정 후 토큰 생성
36+
3. GitLab 프로젝트에서 `Deploy -> Pages -> Use unique domain` 체크 해제해야 URL이 깔끔하게 나옴.
37+
4. 기밀 문서가 아닌 경우, `Settings -> General -> Visibility (expand) -> Pages -> Everyone` 으로 설정하면 전체 공개.
38+
5. 프로젝트에서 `Settings -> Access Tokens -> Add new token` 에서 expiration 1년 뒤로 설정, `write repository` scope, Maintainer role 설정 후 토큰 생성
2639
- Maintainer가 아닐 경우, 기본 branch는 protected branch로 설정되어 push하지 못할 수 있음. 아니면 developer로 설정 후 protected branch 해지하기.
40+
6. 프로젝트에서 `Manage -> Members -> Invite a group -> deargen`을 Guest로 추가하면 디어젠 모든 분들에게 읽기 권한이 주어짐.

docs/mkdocs/mkdocs.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88
## Project layout 및 사용법
99

10-
mkdocs.yml # The configuration file.
11-
docs/
12-
index.md # The documentation homepage.
13-
... # Other markdown pages, images and other files.
10+
```sh
11+
📄 mkdocs.yml # The configuration file.
12+
📂 docs/
13+
│ ✏️ index.md # The documentation homepage.
14+
└ ✏️ ... # Other markdown pages, images and other files.
15+
```
1416

1517
1. 마크다운 형식으로 `docs/` 폴더 내에 문서 작성.
1618
2. `mkdocs.yml` 파일의 nav: 항목을 수정해 페이지 추가.
@@ -65,4 +67,13 @@ def bubble_sort(items):
6567

6668
:octicons-heart-fill-24:{ .heart }
6769

70+
### Flow Chart with [Mermaid](https://mermaid.js.org/intro)
6871

72+
```mermaid
73+
graph LR
74+
A[Start] --> B{Error?};
75+
B -->|Yes| C[Hmm...];
76+
C --> D[Debug];
77+
D --> B;
78+
B ---->|No| E[Yay!];
79+
```

mkdocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ nav:
3939

4040
theme:
4141
name: material
42+
font:
43+
text: Noto Sans Korean
44+
code: Jetbrains Mono
4245
features:
4346
- toc.follow
4447
- navigation.top
@@ -93,6 +96,11 @@ extra:
9396
provider: mike
9497

9598
markdown_extensions:
99+
- pymdownx.superfences:
100+
custom_fences:
101+
- name: mermaid
102+
class: mermaid
103+
format: !!python/name:pymdownx.superfences.fence_code_format
96104
- pymdownx.highlight:
97105
anchor_linenums: true
98106
- pymdownx.inlinehilite

0 commit comments

Comments
 (0)