diff --git a/.gitignore b/.gitignore index 63270ea877..b27d9c45c6 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,3 @@ docs/superpowers/ # Local OSSCA report outputs and reproducibility evidence /reports/ossca/ - -# Local slide deck exports (npm run slides:pdf) -/*.pdf diff --git a/CLAUDE.md b/CLAUDE.md index 60539d70c5..789e47d3cc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -12,8 +12,6 @@ npm run lint # next lint (ESLint) npm run lint:md # markdownlint-cli2 over data/**/*.md npm run validate:data # validate contribution frontmatter (scripts/validate-contributions.js) npm run sync:contributions -- --dry-run # maintainer metadata refresh preview -npm run slides:render # re-render slide deck previews (public/slides/*/preview, needs Chrome) -npm run slides:pdf # bundle each deck's preview PNGs into ./.pdf (git-ignored, needs Chrome) npm run build # static export to out/ (deploy runs via .github/workflows/deploy.yml on push to main) ``` @@ -43,14 +41,6 @@ Three data domains: Key flow: `getAllContributions()` (reads files, sorted by `date` desc) feeds `getContributorSummaries()`, `buildSearchIndex()`, and `computeStats()`. Pages are server components; `HomeView`, `ContributorsList`, `StatsView`, `ScheduleView`, etc. are client components that receive the pre-built data and do the sorting/filtering. -Slide decks are self-contained HTML at `public/slides/{slug}/index.html`, -linked from a meeting with `slides: /slides/{slug}/` and embedded by -`MeetingDetail`. A deck holds only slide markup; styles and behavior come -from `public/slides/_shared/deck.{css,js}`, whose tokens mirror -`globals.css`. After editing a -deck, run `npm run slides:render` and commit the regenerated `preview/*.png` -and `README.md` with it so reviewers can see the slides on GitHub. - Routing quirks: `/contributions` and `/guide` are Redirect stubs; the real lists live at `/patches` and `/docs`. `RootLayout` (`src/app/layout.tsx`) holds the header nav and theme bootstrap. ## Data conventions diff --git a/data/meetings/2026-10-24-showcase.md b/data/meetings/2026-10-24-showcase.md index f9460dac4a..9262ebc6d6 100644 --- a/data/meetings/2026-10-24-showcase.md +++ b/data/meetings/2026-10-24-showcase.md @@ -3,7 +3,6 @@ title: 2차 발표평가 (성과공유회) date: 2026-10-24 type: milestone location: 오프라인 -slides: /slides/2026-10-24-showcase/ --- ## 안내 diff --git a/package.json b/package.json index a3e90df508..e7852037ad 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,6 @@ "test:coverage": "jest --coverage", "validate:data": "node scripts/validate-contributions.js", "sync:contributions": "node scripts/sync-contributions.js", - "slides:render": "node scripts/render-slides.js", - "slides:pdf": "node scripts/export-slides-pdf.js", "lint:md": "markdownlint-cli2", "lint:md:fix": "markdownlint-cli2 --fix" }, diff --git a/public/slides/2026-10-24-showcase/README.md b/public/slides/2026-10-24-showcase/README.md deleted file mode 100644 index c339c1332e..0000000000 --- a/public/slides/2026-10-24-showcase/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# 2026 OSSCA Chromium 최종 발표 - - - -2026 OSSCA 2차 발표평가(성과공유회)에서 Chromium 팀이 발표하는 자료입니다. 13주간의 컨트리뷰션 과정, 주요 기여 성과, 정량적 성과, 향후 계획을 다룹니다. - -- 원본: [`index.html`](index.html) — 수정한 뒤 `npm run slides:render`로 미리보기를 다시 만듭니다. -- 미리보기: [`preview/`](preview) — 슬라이드별 PNG (`slide-01.png` ~ `slide-25.png`) -- 웹에서 보기: https://ossca-chromium.github.io/contributions/slides/2026-10-24-showcase/ diff --git a/public/slides/2026-10-24-showcase/index.html b/public/slides/2026-10-24-showcase/index.html deleted file mode 100644 index 071c3c5fe6..0000000000 --- a/public/slides/2026-10-24-showcase/index.html +++ /dev/null @@ -1,683 +0,0 @@ - - - - - - 2026 OSSCA Chromium 최종 발표 - - - - - -
- -
-

OSSCA Chromium

-

2026 오픈소스 컨트리뷰션 아카데미

-

Chromium

-

Final evaluation

-

2차 발표평가 (성과공유회) · 2026-10-24

-
- - -
-

목차

-
    -
  1. - 01 -

    프로젝트 소개 및 목표

    -

    Chromium 팀 소개와 13주의 목표

    -
  2. -
  3. - 02 -

    컨트리뷰션 과정

    -

    이슈를 찾고, 고치고, 리뷰받은 방법

    -
  4. -
  5. - 03 -

    주요 기여 성과

    -

    4개 영역별 대표 기여

    -
  6. -
  7. - 04 -

    정량적 성과

    -

    CL · Merge로 본 실제 기여량

    -
  8. -
  9. - 05 -

    향후 기여 계획

    -

    프로그램 이후의 기여 계획

    -
  10. -
  11. - 06 -

    Q & A

    -
  12. -
-
- - -
-

01

-

프로젝트 소개 및 목표

-

Chromium 팀은 무엇을 목표로 했나

- -
- - -
-

문서 링크 한 줄에서 시작해

-

Blink · V8 · DevTools까지

-

229건의 CL이 병합됐습니다

-

- 2026 OSSCA Chromium 팀 멘티 19명 · Chromium Gerrit 병합 기준 (10/10 - 조회) -

-
- - -
-

Chromium 팀 소개

-

2026 OSSCA 참여형 · 7/11 ~ 10/24

-
-
    -
  1. - 01 -

    - Chrome · Edge 등이 기반으로 하는 오픈소스 브라우저.
    - Gerrit CL → 코드 리뷰 → CQ → main 병합으로 기여합니다. -

    -
  2. -
  3. - 02 -

    - 멘토 1명 · 멘티 20명(리드 멘티 2명), 매주 토요일 오프라인 - 모임.
    - 기여 내역은 OSSCA Chromium 기여 기록 사이트에 정리했습니다. -

    -
  4. -
- -
-
- - -
-

13주의 목표

-

작은 기여에서 꾸준한 기여자로

-
-
- 01 -

기여 흐름
한 바퀴 돌기

-

- 빌드 환경 구축과 문서 링크 수정으로 Gerrit · 리뷰 · CQ를 직접 경험 - (Challenges) -

-
- → -
- 02 -

동작을 바꾸는
코드 기여

-

- 버그 재현 → 수정 → 테스트 → 리뷰 반영까지 스스로 진행 (Masters) -

-
- → -
- 03 -

꾸준히 기여하는
Contributor

-

관심 컴포넌트를 정해 프로그램 이후에도 기여, Committer에 도전

-
-
-
- - -
-

02

-

컨트리뷰션 과정

-

이슈를 찾고, 고치고, 리뷰받기까지

- -
- - -
-

기여 사이클

-

모든 멘티가 반복한 흐름

-
-
- 01 -

이슈 발굴

-

TODO · WPT 실패 · deprecated API를 추적해 OSSCA 이슈로 선점

-
- → -
- 02 -

재현 · 수정 · 테스트

-

로컬에서 재현한 뒤 회귀 테스트와 함께 수정

-
- → -
- 03 -

리뷰 · CQ · 머지

-

OWNERS 리뷰와 피드백 반영, CQ 통과 후 main 병합

-
-
-
- - -
-

함께 시작한 첫 코드 기여

-

//crypto API 마이그레이션 · #282

-
-
    -
  • -

    - 리드 멘티가 crypto/sha2.h → crypto/hash.h 이슈를 공유하고, - 디렉터리별 sub-issue로 나눠 선착순 분담 -

    -
  • -
  • -

    - 수정 → 빌드 · 유닛 테스트 → CL 업로드 → 이슈 리뷰어와 디렉터리 - OWNERS의 2단계 리뷰 -

    -
  • -
- -
-
- - -
-

이슈를 찾는 세 가지 방법

-

트래커만이 아니라 코드와 테스트에서

-
-
    -
  • -
    -

    TODO · deprecated 추적

    -

    - 코드에 남은 TODO(crbug) · 만료 플래그 · 폐기 API를 스캔. 정리 - 캠페인 36건, 직접 발굴 이슈 10건으로 이어짐 -

    -
    -
  • -
  • -
    -

    WPT 실패 → Blink 구현

    -

    - wpt.fyi의 실패에서 출발해 명세 · 다른 브라우저 동작 · 테스트 - 이력을 비교하며 구현 원인을 추적 -

    -
    -
  • -
  • -
    -

    AI는 탐색, 검증은 직접

    -

    - AI로 탐색 범위를 좁히고, 코드와 테스트로 다시 확인. 활용법과 - 고민은 팀 발표 세션에서 공유 -

    -
    -
  • -
- -
-
- - -
-

함께 배우는 팀

-

매주 기여 경험과 팁을 공유한 세션

-
-
    -
  • -

    - 기여 워크플로우 8단계 정리 — 이슈 발굴부터 머지 후 마무리까지 -

    -
  • -
  • -

    - viz · WebCrypto 등 컴포넌트 발표, AI 활용법과 한계에 대한 토론 -

    -
  • -
  • Chromium 아키텍처 인터랙티브 다이어그램 12장 공유

  • -
  • -

    - 기여 기록 사이트 개선 — Abandoned 집계, Mermaid 다이어그램 - 렌더링 -

    -
  • -
  • -

    리드 멘티가 Gerrit · 리뷰 흐름이 낯선 멘티를 함께 지원

    -
  • -
- -
-
- - -
-

03

-

주요 기여 성과

-

웹 표준 · 플랫폼/엔진 · DevTools · 리팩토링

- -
- - -
-

주요 기여 성과 한눈에

-

병합 CL 229건 중 4개 핵심 영역

-
-
- 웹 표준 - 23병합 CL -

명세 · WPT를 근거로 Blink · V8 동작 수정

-

CSS · WebCrypto · 접근성 · FormData

-
-
- 플랫폼 / 엔진 - 38병합 CL -

OS · 그래픽스 · 스토리지 계층의 버그 수정

-

FSA · FilePathWatcher · viz · macOS

-
-
- DevTools - 49병합 CL -

Security 패널 Lit 전환과 테스트 구조 정비

-

Lit · unit test 전환 · TS 타입

-
-
- 리팩토링 - 78병합 CL -

만료 코드 정리와 C++ 표준 API 현대화

-

플래그 정리 · sql · C++20/23

-
-
-

- 그 외 //crypto 공동 마이그레이션 17건 · 첫 기여 문서 수정 24건 -

-
- - -
-

웹 표준 정합성

-

Blink · WPT · 명세 기반 수정 — 병합 23건

-
-
- 01 -

CSS 토크나이저 NUL 처리

-

- 2016년 최적화까지 이력을 추적해 #<NUL> · -<NUL> - 오분류를 수정, WPT 통과 (최인준) -

-
-
- 02 -

FormData · FileReader

-

- File 객체 identity와 재진입 loadend를 명세대로 수정, WPT 2건 - upstream 반영 (이승준) -

-
-
- 03 -

Accessibility

-

- role=form 갱신 · 숨겨진 caption 이름 계산 (곽정아), contextual - role · img alt는 리뷰 중 (박동한 · 송채현) -

-
-
- 04 -

WebCrypto

-

- exportKey 오류 순서와 supports()를 표준대로 수정, CryptoKey - 캐싱으로 WPT 통과 (최민섭) -

-
-
-
- - -
-

브라우저 플랫폼 · 엔진

-

OS · 그래픽스 · 스토리지 — 병합 38건

-
-
- 01 -

macOS 한글 IME + Cmd+T

-

- WebUI 팝업 child window의 단축키 전달 경로를 추적해 수정, 회귀 - 테스트 추가 (최원익) -

-
-
- 02 -

Windows 이미지 드래그

-

- 포토샵 · 그림판으로 드래그되지 않던 문제를 CF_HDROP 전달로 해결 — - 리뷰 중 (김성진) -

-
-
- 03 -

viz 렌더링 파이프라인

-

- 미사용 surfaceless · DXGI 플래그 정리, swap 실패 시 overlay 버그 - 수정은 리뷰 중 (김범수) -

-
-
- 04 -

파일 시스템 · Storage

-

- FSA 쓰기 오류(ENOSPC) 전파, OPFS 비ASCII 이름, inotify 변경 알림 - 개선 (이승준) -

-
-
-
- - -
-

DevTools · 디버깅 도구

-

프런트엔드부터 V8까지 — 병합 49건

-
-
- 01 -

Security 패널 Lit 전환

-

- SecurityOriginView 7개 영역을 선언형으로 전환하고 연계 테스트까지 - 정비, 23건 병합 (박호정) -

-
-
- 02 -

3개 저장소를 잇는 수정

-

- V8 · Chromium · DevTools에 걸쳐 페이지 이동 후에도 skipAllPauses - 설정 유지 (윤지윤) -

-
-
- 03 -

Application · 툴바 버그

-

- 사이트 데이터 삭제 시 OPFS 누락, 툴바 정규식 토글 상태 불일치 수정 - (이지현 · 권세빈) -

-
-
- 04 -

타입 안정성

-

- @ts-expect-error를 걷어내며 숨어 있던 nullable 반환 타입을 찾아 - 수정 (권세빈 · 정수영) -

-
-
-
- - -
-

리팩토링 · 코드 정리

-

만료 코드 정리 · C++ 현대화 · 테스트 — 병합 78건

-
-
- 01 -

정리 캠페인 36건

-

- 만료 플래그 · 킬스위치 · 히스토그램을 스크립트로 찾아 OWNERS - 단위로 나눠 제출 (조성곤) -

-
-
- 02 -

DB 트랜잭션 안정화

-

- QuotaDatabase를 sql::Transaction으로 전환해 DB 손상 복구의 전제 - 조건 해결 (조성곤) -

-
-
- 03 -

C++20/23 · 미디어 현대화

-

- starts_with · contains · std::numbers 적용, BitReader의 span 전환 - (최문기 · 정수영) -

-
-
- 04 -

sql 시간 접근자 통일

-

- 기능마다 손으로 쓰던 시각 변환을 공용 API로 영역별 CL 시리즈로 - 옮김 (조성곤) -

-
-
-
- - -
-

04

-

정량적 성과

-

Chromium Gerrit 병합 CL 기준 · 10/10 조회

- -
- - -
-

숫자로 본 13주

-

Chromium Gerrit 병합 기준

-
-
-
병합된 CL
-
229
-
-
-
기여한 멘티
-
19명
-
-
-
업로드한 CL
-
309
-
-
-
기여한 저장소
-
5개
-
-
-
-

- 멘티 19명이 올린 CL 중 main에 병합된 것을 Gerrit에서 직접 - 조회했습니다 (10/10 기준). -

-

- 영역 분류는 CL 제목 · 프로젝트 기준이며 프로그램 시작 전 첫 기여도 - 포함했습니다. -

-
-
- - -
-

멘티별 병합 CL

-

19명 · Gerrit 병합 기준 (10/10 조회)

-
-
55조성곤
-
53박호정
-
35이승준
-
14최문기
-
12최원익
-
10권세빈
-
7최민섭
-
5윤지윤
-
5정수영
-
5최인준
-
4김범수
-
4이혜원
-
3김성진
-
3박동한
-
3송채현
-
3최정겸
-
3곽정아
-
3이지현
-
2정지우
-
-
- - -
-

기간별 · 기타 성과

-

Challenges 4주 vs Masters 9주

-
-
- - - - - - - - - - - - - - - - - - - - -
기간업로드병합
Challenges4839
Masters261190
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
항목건수
WPT upstream 반영3건
KhronosGroup/WebGL PR1건
ChromeStatus 기능 등록2건
tryjob 권한 획득2명
팀 내 기여 발표 세션매주
-
-
-
-

Masters 기간 병합 CL이 Challenges의 약 5배.

-

Challenges에는 프로그램 시작 전 첫 기여 포함.

-
-
- - -
-

05

-

향후 기여 계획

-

프로그램이 끝나도 기여는 계속됩니다

- -
- - -
-

향후 기여 계획

-

각자의 영역에서, 그리고 함께

-
-
- 01 -

진행 중인 CL 마무리

-

리뷰 중인 CL의 피드백을 반영해 머지까지 끝까지 완주

-
-
- 02 -

관심 영역 심화

-

- Accessibility · DevTools · media/audio · viz · storage 등 각자 - 고른 컴포넌트에서 꾸준히 -

-
-
- 03 -

Committer 도전

-

- 여러 멘티가 1~2년 안에 Chromium Committer가 되는 것을 목표로 설정 -

-
-
- 04 -

함께 계속

-

- 팀 스터디를 이어가고, 다음 OSSCA에서는 리드 멘티로 경험을 돌려주기 -

-
-
-
- - -
-

06

-

Q & A

-

궁금한 점을 편하게 질문해 주세요

- -
- - -
-

발표를 들어주셔서

-

감사합니다 :)

-
-
- - diff --git a/public/slides/2026-10-24-showcase/preview/slide-01.png b/public/slides/2026-10-24-showcase/preview/slide-01.png deleted file mode 100644 index b2ddd9315f..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-01.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-02.png b/public/slides/2026-10-24-showcase/preview/slide-02.png deleted file mode 100644 index 7b166f27a6..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-02.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-03.png b/public/slides/2026-10-24-showcase/preview/slide-03.png deleted file mode 100644 index c4007ec381..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-03.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-04.png b/public/slides/2026-10-24-showcase/preview/slide-04.png deleted file mode 100644 index 7e0bf8a0d1..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-04.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-05.png b/public/slides/2026-10-24-showcase/preview/slide-05.png deleted file mode 100644 index 0884fae172..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-05.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-06.png b/public/slides/2026-10-24-showcase/preview/slide-06.png deleted file mode 100644 index 1cda319755..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-06.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-07.png b/public/slides/2026-10-24-showcase/preview/slide-07.png deleted file mode 100644 index 1ea3d84f7d..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-07.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-08.png b/public/slides/2026-10-24-showcase/preview/slide-08.png deleted file mode 100644 index 65c1c47338..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-08.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-09.png b/public/slides/2026-10-24-showcase/preview/slide-09.png deleted file mode 100644 index 355a295004..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-09.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-10.png b/public/slides/2026-10-24-showcase/preview/slide-10.png deleted file mode 100644 index 3c535fb9f9..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-10.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-11.png b/public/slides/2026-10-24-showcase/preview/slide-11.png deleted file mode 100644 index 126ad09ae1..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-11.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-12.png b/public/slides/2026-10-24-showcase/preview/slide-12.png deleted file mode 100644 index 442d349af7..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-12.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-13.png b/public/slides/2026-10-24-showcase/preview/slide-13.png deleted file mode 100644 index 19fa34239a..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-13.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-14.png b/public/slides/2026-10-24-showcase/preview/slide-14.png deleted file mode 100644 index 9de8048b1b..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-14.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-15.png b/public/slides/2026-10-24-showcase/preview/slide-15.png deleted file mode 100644 index 7de35c2507..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-15.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-16.png b/public/slides/2026-10-24-showcase/preview/slide-16.png deleted file mode 100644 index 45a1e3ad1a..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-16.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-17.png b/public/slides/2026-10-24-showcase/preview/slide-17.png deleted file mode 100644 index 11a0cf7e2a..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-17.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-18.png b/public/slides/2026-10-24-showcase/preview/slide-18.png deleted file mode 100644 index 1a30aec3ad..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-18.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-19.png b/public/slides/2026-10-24-showcase/preview/slide-19.png deleted file mode 100644 index f5c13eeb96..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-19.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-20.png b/public/slides/2026-10-24-showcase/preview/slide-20.png deleted file mode 100644 index 928dd60efc..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-20.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-21.png b/public/slides/2026-10-24-showcase/preview/slide-21.png deleted file mode 100644 index 6aa81cbd34..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-21.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-22.png b/public/slides/2026-10-24-showcase/preview/slide-22.png deleted file mode 100644 index 64a6c9a63d..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-22.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-23.png b/public/slides/2026-10-24-showcase/preview/slide-23.png deleted file mode 100644 index dda4a89887..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-23.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-24.png b/public/slides/2026-10-24-showcase/preview/slide-24.png deleted file mode 100644 index 10fb1bed5f..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-24.png and /dev/null differ diff --git a/public/slides/2026-10-24-showcase/preview/slide-25.png b/public/slides/2026-10-24-showcase/preview/slide-25.png deleted file mode 100644 index fc126ab0e0..0000000000 Binary files a/public/slides/2026-10-24-showcase/preview/slide-25.png and /dev/null differ diff --git a/public/slides/_shared/deck.css b/public/slides/_shared/deck.css deleted file mode 100644 index af662bf091..0000000000 --- a/public/slides/_shared/deck.css +++ /dev/null @@ -1,684 +0,0 @@ -/* Shared styles for the HTML slide decks under public/slides/. - Tokens mirror src/app/globals.css so the decks match the site theme. */ -:root { - --color-primary: #0b57d0; - --color-on-primary: #ffffff; - --color-primary-container: #e8f0fe; - --color-background: #ffffff; - --color-on-surface: #202124; - --color-on-surface-variant: #5f6368; - --chart-bar: #4285f4; - --mesh-base: #f8f9fa; - --mesh-blue: rgba(66, 133, 244, 0.16); - --mesh-green: rgba(52, 168, 83, 0.14); - --mesh-yellow: rgba(251, 188, 4, 0.14); - --mesh-red: rgba(234, 67, 53, 0.1); - --gradient-from: #1767d1; - --gradient-to: #679ef5; - --c1: #1967d2; - --c2: #1a73e8; - --c3: #669df6; - --c4: #aecbfa; - --m1: #f7f9fc; - --m2: #eef2fa; - --mline: #dde3ec; -} -.dark { - --color-primary: #8ab4f8; - --color-on-primary: #202124; - --color-primary-container: #28374e; - --color-background: #202124; - --color-on-surface: #e8eaed; - --color-on-surface-variant: #9aa0a6; - --chart-bar: #8ab4f8; - --mesh-base: #292a2d; - --mesh-blue: rgba(138, 180, 248, 0.14); - --mesh-green: rgba(129, 201, 149, 0.12); - --mesh-yellow: rgba(253, 214, 99, 0.1); - --mesh-red: rgba(242, 139, 130, 0.08); - --gradient-from: #8ab4f8; - --gradient-to: #c6dafc; - --c1: #aecbfa; - --c2: #669df6; - --c3: #1a73e8; - --c4: #1967d2; - --m1: #282a2d; - --m2: #303134; - --mline: #3c4043; -} - -* { - box-sizing: border-box; - margin: 0; - padding: 0; -} -html, -body { - height: 100%; -} -body { - background: var(--color-background); - color: var(--color-on-surface); - font-family: - Roboto, - "Noto Sans KR", - system-ui, - -apple-system, - "Apple SD Gothic Neo", - "Malgun Gothic", - sans-serif; - overflow: hidden; -} - -/* Slides are laid out on a fixed 1280x720 stage and scaled to the viewport. */ -.stage { - position: absolute; - left: 50%; - top: 50%; - width: 1280px; - height: 720px; - transform: translate(-50%, -50%) scale(var(--scale, 1)); -} -.slide { - position: absolute; - inset: 0; - display: none; - flex-direction: column; - padding: 68px 88px 84px; - background: var(--color-background); - word-break: keep-all; - overflow-wrap: anywhere; -} -.slide.active { - display: flex; -} -.slide::before { - content: ""; - position: absolute; - inset: 0 0 auto 0; - height: 6px; - background: linear-gradient( - 90deg, - var(--c1) 0 25%, - var(--c2) 25% 50%, - var(--c3) 50% 75%, - var(--c4) 75% 100% - ); -} -.center { - justify-content: center; -} -.mesh { - --mark-moat: var(--mesh-base); - background-color: var(--mesh-base); - background-image: - radial-gradient(55% 85% at 10% 0%, var(--mesh-blue), transparent 62%), - radial-gradient(50% 75% at 90% 8%, var(--mesh-green), transparent 60%), - radial-gradient(45% 70% at 78% 95%, var(--mesh-yellow), transparent 62%), - radial-gradient(40% 65% at 15% 100%, var(--mesh-red), transparent 65%); -} - -/* CSS-only Chromium mark, same construction as src/components/ChromiumMark.tsx. */ -.mark { - --size: 24px; - position: relative; - display: inline-block; - flex: none; - width: var(--size); - height: var(--size); - border-radius: 50%; - background: conic-gradient( - from -90deg, - var(--c1) 0 33.34%, - var(--c3) 33.34% 66.67%, - var(--c4) 66.67% 100% - ); -} -.mark::after { - content: ""; - position: absolute; - inset: calc(var(--size) * 5.5 / 24); - border-radius: 50%; - background: var(--c2); - box-shadow: 0 0 0 calc(var(--size) * 2.5 / 24) - var(--mark-moat, var(--color-background)); -} -.brand { - display: flex; - align-items: center; - gap: 10px; - font-weight: 500; -} -.foot { - position: absolute; - left: 88px; - right: 88px; - bottom: 26px; - display: flex; - align-items: center; - justify-content: space-between; - border-top: 1px solid var(--mline); - padding-top: 14px; - font-size: 15px; - color: var(--color-on-surface-variant); - font-variant-numeric: tabular-nums; -} -.foot .mark { - --size: 18px; -} - -h1, -h2, -h3 { - letter-spacing: -0.02em; - line-height: 1.2; -} -h2 { - font-size: 42px; - font-weight: 700; -} -h3 { - font-size: 25px; - font-weight: 600; -} -.sub { - margin-top: 10px; - font-size: 21px; - color: var(--color-on-surface-variant); -} -.muted { - color: var(--color-on-surface-variant); -} -.num { - font-size: 30px; - font-weight: 700; - line-height: 1.1; - color: var(--color-primary); - font-variant-numeric: tabular-nums; -} -.chip { - display: inline-block; - border-radius: 9999px; - padding: 6px 16px; - background: var(--color-primary-container); - color: var(--color-primary); - font-size: 17px; - font-weight: 500; -} -.chip.solid { - background: var(--color-primary); - color: var(--color-on-primary); - font-weight: 700; -} - -/* Cover and closing */ -.cover .brand { - position: absolute; - left: 88px; - top: 56px; - font-size: 22px; -} -.cover .brand .mark { - --size: 32px; -} -.cover h1 { - margin-top: 20px; - font-size: 140px; - font-weight: 700; - line-height: 1.1; - background-image: linear-gradient( - 90deg, - var(--gradient-from), - var(--gradient-to) - ); - -webkit-background-clip: text; - background-clip: text; - color: transparent; - width: fit-content; -} -.cover .tagline { - margin-top: 8px; - font-size: 30px; - color: var(--color-on-surface-variant); -} -.cover .event { - position: absolute; - left: 88px; - bottom: 52px; - font-size: 19px; - color: var(--color-on-surface-variant); -} -.closing .lead { - font-size: 40px; - font-weight: 500; - color: var(--color-on-surface-variant); -} -.closing h1 { - margin-top: 12px; - font-size: 112px; - font-weight: 700; -} - -/* Section divider */ -.section .num { - font-size: 150px; - line-height: 1; -} -.section h2 { - margin-top: 20px; - font-size: 60px; -} -.section .sub { - margin-top: 16px; - font-size: 25px; -} -.section > .mark { - --size: 300px; - position: absolute; - right: 110px; - top: 50%; - margin-top: -150px; -} - -/* Agenda */ -.agenda { - flex-direction: row; - align-items: center; - gap: 72px; -} -.agenda h2 { - flex: none; - width: 260px; - font-size: 64px; -} -.agenda ol { - flex: 1; - list-style: none; -} -.agenda li { - display: grid; - grid-template-columns: 64px auto 1fr; - align-items: baseline; - column-gap: 8px; - padding: 18px 0; - border-bottom: 1px solid var(--mline); -} -.agenda li:last-child { - border-bottom: 0; -} -.agenda li p { - justify-self: end; - font-size: 18px; - color: var(--color-on-surface-variant); -} -.agenda h3 { - font-size: 27px; -} - -/* Statement */ -.statement p.big { - font-size: 58px; - font-weight: 700; - line-height: 1.32; - letter-spacing: -0.02em; -} -.statement em { - font-style: normal; - color: var(--color-primary); -} -.statement .caption { - margin-top: 40px; - font-size: 21px; - color: var(--color-on-surface-variant); -} - -/* Main column + side panel */ -.split { - display: grid; - grid-template-columns: 1fr 380px; - gap: 56px; - align-items: start; - margin-top: 44px; -} -.items { - list-style: none; - display: grid; - gap: 30px; -} -.items li { - display: grid; - grid-template-columns: 56px 1fr; - align-items: start; -} -.items p { - font-size: 21px; - line-height: 1.6; -} -.items h3 + p { - margin-top: 8px; - font-size: 19px; - color: var(--color-on-surface-variant); -} -.items.dots { - gap: 22px; -} -.items.dots li { - grid-template-columns: 30px 1fr; -} -.items.dots li::before { - content: ""; - width: 10px; - height: 10px; - margin-top: 12px; - border-radius: 50%; - background: var(--c2); -} -.panel { - border: 1px solid var(--mline); - border-radius: 28px; - background: var(--m1); - padding: 10px 32px; -} -.panel > h3 { - padding: 18px 0 6px; - font-size: 19px; - color: var(--color-on-surface-variant); -} -.panel > div { - padding: 18px 0; - border-bottom: 1px solid var(--mline); -} -.panel > div:last-child { - border-bottom: 0; -} -.panel b { - display: block; - font-size: 46px; - font-weight: 700; - line-height: 1.15; - color: var(--color-primary); - font-variant-numeric: tabular-nums; -} -.panel span { - font-size: 17px; - color: var(--color-on-surface-variant); -} -.panel strong { - display: block; - font-size: 19px; - font-weight: 600; -} - -/* Three steps */ -.steps { - display: grid; - grid-template-columns: 1fr auto 1fr auto 1fr; - align-items: stretch; - gap: 18px; - margin-top: 52px; -} -.steps > div { - border: 1px solid var(--mline); - border-radius: 28px; - background: var(--m1); - padding: 32px; -} -.steps > span { - align-self: center; - font-size: 34px; - color: var(--color-on-surface-variant); -} -.steps h3 { - margin-top: 22px; - font-size: 28px; - line-height: 1.3; -} -.steps p { - margin-top: 14px; - font-size: 20px; - line-height: 1.6; - color: var(--color-on-surface-variant); -} - -/* Stat cards */ -.cards { - display: grid; - grid-template-columns: repeat(4, 1fr); - gap: 20px; - margin-top: 40px; -} -.cards > div { - display: flex; - flex-direction: column; - border: 1px solid var(--mline); - border-radius: 28px; - background: var(--m1); - padding: 26px; -} -.cards .chip { - align-self: flex-start; -} -.cards b { - margin-top: 18px; - font-size: 76px; - font-weight: 700; - line-height: 1.1; - font-variant-numeric: tabular-nums; -} -.cards b small { - margin-left: 8px; - font-size: 18px; - font-weight: 500; - color: var(--color-on-surface-variant); -} -.cards p { - margin-top: 12px; - font-size: 19px; - line-height: 1.5; -} -.cards p.tags { - margin-top: auto; - padding-top: 14px; - font-size: 15px; - color: var(--color-on-surface-variant); -} -.footnote { - margin-top: 24px; - font-size: 18px; - color: var(--color-on-surface-variant); -} - -/* 2x2 numbered grid */ -.grid2 { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 40px 64px; - margin-top: 48px; -} -.grid2 > div { - display: grid; - grid-template-columns: 56px 1fr; - align-items: baseline; -} -.grid2 p { - grid-column: 2; - margin-top: 10px; - font-size: 20px; - line-height: 1.6; - color: var(--color-on-surface-variant); -} - -/* Summary metrics (same shape as SummaryMetrics.tsx) */ -.metrics { - display: grid; - grid-template-columns: repeat(4, 1fr); - gap: 1px; - overflow: hidden; - margin-top: 44px; - border: 1px solid var(--mline); - border-radius: 24px; - background: var(--mline); -} -.metrics > div { - background: var(--m1); - padding: 30px; -} -.metrics dt { - display: flex; - align-items: center; - gap: 10px; - font-size: 18px; - color: var(--color-on-surface-variant); -} -.metrics dt::before { - content: ""; - width: 10px; - height: 10px; - border-radius: 50%; - background: var(--c1); - box-shadow: 0 0 0 1px var(--c1); -} -.metrics > div:nth-child(2) dt::before { - background: var(--c2); -} -.metrics > div:nth-child(3) dt::before { - background: var(--c3); -} -.metrics > div:nth-child(4) dt::before { - background: var(--c4); -} -.metrics dd { - margin-top: 14px; - font-size: 76px; - font-weight: 700; - line-height: 1.1; - letter-spacing: -0.02em; - font-variant-numeric: tabular-nums; -} -.notes { - margin-top: 36px; - display: grid; - gap: 8px; - font-size: 20px; - line-height: 1.6; - color: var(--color-on-surface-variant); -} - -/* Bar chart: deck.js adds an per bar, scaled to the largest value (--ratio 0..1). */ -.bars { - display: grid; - grid-auto-flow: column; - grid-auto-columns: 1fr; - align-items: end; - margin-top: 44px; -} -.bars > div { - display: flex; - flex-direction: column; - align-items: center; -} -.bars b { - font-size: 18px; - font-weight: 700; - font-variant-numeric: tabular-nums; -} -.bars i { - width: 62%; - height: calc(var(--ratio) * 300px); - margin-top: 6px; - border-radius: 8px 8px 0 0; - background: var(--chart-bar); -} -.bars span { - width: 100%; - padding-top: 12px; - border-top: 1px solid var(--mline); - text-align: center; - font-size: 15px; - color: var(--color-on-surface-variant); -} - -/* Tables */ -.tables { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 32px; - align-items: start; - margin-top: 40px; -} -.tables > div { - overflow: hidden; - border: 1px solid var(--mline); - border-radius: 20px; -} -table { - width: 100%; - border-collapse: collapse; -} -th { - background: var(--m2); - padding: 12px 24px; - text-align: left; - font-size: 15px; - font-weight: 600; - color: var(--color-on-surface-variant); -} -td { - border-top: 1px solid var(--mline); - padding: 15px 24px; - font-size: 21px; -} -th:not(:first-child), -td:not(:first-child) { - text-align: right; - font-variant-numeric: tabular-nums; -} -td:not(:first-child) { - font-weight: 600; -} - -.progress { - position: fixed; - left: 0; - bottom: 0; - height: 3px; - background: var(--color-primary); - transition: width 0.25s ease; -} - -/* Printing (browser "Save as PDF") puts every slide on its own page. */ -@page { - size: 1280px 720px; - margin: 0; -} -@media print { - html, - body { - height: auto; - overflow: visible; - } - /* Keep card, chip and bar backgrounds even when the print dialog drops them. */ - html { - -webkit-print-color-adjust: exact; - print-color-adjust: exact; - } - /* Gradient-clipped text breaks in some PDF viewers; print it in solid blue. */ - .cover h1 { - background-image: none; - color: var(--gradient-from); - } - .stage { - position: static; - transform: none; - height: auto; - } - .slide { - position: relative; - display: flex; - height: 720px; - break-after: page; - } - .progress { - display: none; - } -} diff --git a/public/slides/_shared/deck.js b/public/slides/_shared/deck.js deleted file mode 100644 index ae84da9a20..0000000000 --- a/public/slides/_shared/deck.js +++ /dev/null @@ -1,97 +0,0 @@ -// Shared engine for the HTML slide decks under public/slides/. A deck is a -// .stage of .slide sections; this file adds theming, scaling and navigation. - -// Follow the site theme (same localStorage key); ?theme=light|dark overrides it. -// Runs from so the right theme is applied before first paint. -(function () { - try { - var forced = new URLSearchParams(location.search).get('theme'); - var theme = forced || localStorage.getItem('theme'); - var dark = theme ? theme === 'dark' : matchMedia('(prefers-color-scheme: dark)').matches; - if (dark) document.documentElement.classList.add('dark'); - } catch { - // localStorage can be blocked; fall back to the light theme. - } -})(); - -document.addEventListener('DOMContentLoaded', () => { - const WIDTH = 1280; - const HEIGHT = 720; - const stage = document.querySelector('.stage'); - const slides = [...document.querySelectorAll('.slide')]; - const progress = document.createElement('div'); - const pad = (n) => String(n).padStart(2, '0'); - let index = 0; - - progress.className = 'progress'; - document.body.appendChild(progress); - - // Every slide except .bare ones (cover, closing) gets the brand + page footer. - slides.forEach((slide, n) => { - if (slide.classList.contains('bare')) return; - const foot = document.createElement('footer'); - foot.className = 'foot'; - foot.innerHTML = - 'OSSCA Chromium' + - '' + pad(n + 1) + ' / ' + pad(slides.length) + ''; - slide.appendChild(foot); - }); - - // Bar charts only list valuelabel; draw each bar - // relative to the chart's largest value. - document.querySelectorAll('.bars').forEach((chart) => { - const values = [...chart.querySelectorAll('b')]; - const max = Math.max(...values.map((v) => Number(v.textContent))); - values.forEach((value) => { - const bar = document.createElement('i'); - bar.style.setProperty('--ratio', Number(value.textContent) / max); - value.after(bar); - }); - }); - - // Slides are laid out at 1280x720 and scaled to fit the viewport. - function fit() { - stage.style.setProperty('--scale', Math.min(innerWidth / WIDTH, innerHeight / HEIGHT)); - } - - function show(i) { - index = Math.max(0, Math.min(slides.length - 1, i)); - slides.forEach((s, n) => s.classList.toggle('active', n === index)); - progress.style.width = ((index + 1) / slides.length) * 100 + '%'; - // Keep the slide number in the URL so a slide can be linked and reloaded. - try { - history.replaceState(null, '', '#' + (index + 1)); - } catch { - // Some embedders forbid history changes; navigation still works. - } - } - - function fromHash() { - const n = parseInt(location.hash.slice(1), 10); - show(Number.isNaN(n) ? 0 : n - 1); - } - - document.addEventListener('keydown', (e) => { - if (e.key === 'ArrowRight' || e.key === ' ' || e.key === 'PageDown') show(index + 1); - if (e.key === 'ArrowLeft' || e.key === 'PageUp') show(index - 1); - if (e.key === 'Home') show(0); - if (e.key === 'End') show(slides.length - 1); - if (e.key === 'f') { - if (document.fullscreenElement) document.exitFullscreen(); - else document.documentElement.requestFullscreen().catch(() => {}); - } - }); - // Click right half → next, left half → previous. - document.addEventListener('click', (e) => { - show(e.clientX > innerWidth / 2 ? index + 1 : index - 1); - }); - addEventListener('hashchange', fromHash); - addEventListener('resize', fit); - // When embedded in the site, follow its theme toggle live. - addEventListener('storage', (e) => { - if (e.key === 'theme') document.documentElement.classList.toggle('dark', e.newValue === 'dark'); - }); - - fit(); - fromHash(); -}); diff --git a/scripts/export-slides-pdf.js b/scripts/export-slides-pdf.js deleted file mode 100644 index 98fe34b488..0000000000 --- a/scripts/export-slides-pdf.js +++ /dev/null @@ -1,71 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -const { pathToFileURL } = require('url'); -const { - SLIDES_DIR, - WIDTH, - HEIGHT, - findChrome, - runChrome, - withProfile, - deckHtmlPath, - deckSlugs, - readDeck, -} = require('./render-slides'); - -// PNG를 한 쪽에 한 장씩 깔아 놓은 인쇄용 HTML. -function buildSheet(pngPaths) { - const pages = pngPaths.map((png) => ``).join(''); - return ( - '${pages}` - ); -} - -// 덱의 preview/*.png를 묶어 현재 디렉터리에 .pdf를 만든다(커밋하지 않는 공유용). -// 덱을 다시 렌더하지 않으므로 PDF는 리뷰한 미리보기와 똑같다. -function exportPdf(chrome, slug) { - const previewDir = path.join(SLIDES_DIR, slug, 'preview'); - const pngs = fs.existsSync(previewDir) - ? fs.readdirSync(previewDir).filter((name) => name.endsWith('.png')).sort() - : []; - const { count } = readDeck(fs.readFileSync(deckHtmlPath(slug), 'utf8')); - if (pngs.length === 0 || pngs.length !== count) { - throw new Error( - `${slug}: 미리보기 ${pngs.length}장, 슬라이드 ${count}장입니다. 먼저 npm run slides:render 를 실행하세요.` - ); - } - - const out = path.resolve(`${slug}.pdf`); - withProfile((profileDir) => { - const sheet = path.join(profileDir, 'sheet.html'); - fs.writeFileSync(sheet, buildSheet(pngs.map((name) => path.join(previewDir, name)))); - runChrome(chrome, profileDir, ['--no-pdf-header-footer', `--print-to-pdf=${out}`, pathToFileURL(sheet).href]); - }); - if (!fs.existsSync(out)) throw new Error(`${slug}: PDF를 만들지 못했습니다.`); - console.log(`${slug}: ${pngs.length} pages → ${path.relative(process.cwd(), out)}`); -} - -// 사용법: export-slides-pdf.js [slug...] — slug가 없으면 모든 덱을 내보낸다. -function main() { - const slugs = deckSlugs(process.argv.slice(2)); - if (slugs.length === 0) { - console.log('public/slides 아래에 덱이 없습니다.'); - return; - } - const chrome = findChrome(); - for (const slug of slugs) exportPdf(chrome, slug); -} - -if (require.main === module) { - try { - main(); - } catch (err) { - console.error(err.message); - process.exit(1); - } -} - -module.exports = { buildSheet }; diff --git a/scripts/render-slides.js b/scripts/render-slides.js deleted file mode 100644 index 78e673c05e..0000000000 --- a/scripts/render-slides.js +++ /dev/null @@ -1,144 +0,0 @@ -const fs = require('fs'); -const os = require('os'); -const path = require('path'); -const { execFileSync } = require('child_process'); -const { pathToFileURL } = require('url'); - -const SLIDES_DIR = path.join(__dirname, '..', 'public', 'slides'); -const SITE_URL = 'https://ossca-chromium.github.io/contributions/slides'; -const WIDTH = 1280; -const HEIGHT = 720; -// 미리보기는 2배(2560x1440)로 찍는다. export-slides-pdf.js가 이 PNG를 그대로 PDF에 넣는다. -const SCALE = 2; - -const CHROME_CANDIDATES = [ - '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', - '/Applications/Chromium.app/Contents/MacOS/Chromium', - '/usr/bin/google-chrome', - '/usr/bin/chromium', - '/usr/bin/chromium-browser', -]; - -// CHROME_PATH가 있으면 그것을, 없으면 알려진 설치 경로에서 Chrome을 찾는다. -function findChrome() { - const chrome = process.env.CHROME_PATH || CHROME_CANDIDATES.find((p) => fs.existsSync(p)); - if (!chrome) { - throw new Error('Chrome을 찾지 못했습니다. CHROME_PATH로 실행 파일 경로를 지정하세요.'); - } - return chrome; -} - -// 덱 HTML에서 슬라이드 수, 제목, 한 줄 소개()를 읽는다. -function readDeck(html) { - const count = (html.match(/]*\bclass="slide\b/g) || []).length; - const title = (/([^<]*)<\/title>/.exec(html) || [])[1] || '발표 자료'; - const description = (/<meta\s+name="description"\s+content="([^"]*)"/.exec(html) || [])[1] || ''; - return { count, title: title.trim(), description: description.trim() }; -} - -function previewName(n) { - return `slide-${String(n).padStart(2, '0')}.png`; -} - -// GitHub에서 덱 디렉터리를 열었을 때 보이는 안내문을 만든다. -function buildReadme(slug, { count, title, description }) { - const lines = [ - `# ${title}`, - '', - '<!-- npm run slides:render 가 생성한 파일입니다. 직접 수정하지 마세요. -->', - '', - ...(description ? [description, ''] : []), - '- 원본: [`index.html`](index.html) — 수정한 뒤 `npm run slides:render`로 미리보기를 다시 만듭니다.', - `- 미리보기: [\`preview/\`](preview) — 슬라이드별 PNG (\`${previewName(1)}\` ~ \`${previewName(count)}\`)`, - `- 웹에서 보기: ${SITE_URL}/${slug}/`, - ]; - return `${lines.join('\n')}\n`; -} - -// headless Chrome을 한 번 실행한다. 실행 중인 Chrome 프로필과 충돌하지 않도록 임시 프로필을 쓴다. -function runChrome(chrome, profileDir, args) { - execFileSync(chrome, ['--headless=new', `--user-data-dir=${profileDir}`, ...args], { stdio: 'ignore' }); -} - -function withProfile(run) { - const profileDir = fs.mkdtempSync(path.join(os.tmpdir(), 'render-slides-')); - try { - run(profileDir); - } finally { - fs.rmSync(profileDir, { recursive: true, force: true }); - } -} - -function deckHtmlPath(slug) { - return path.join(SLIDES_DIR, slug, 'index.html'); -} - -// 요청한 slug들, 없으면 public/slides 아래의 모든 덱. -function deckSlugs(requested) { - if (requested.length) return requested; - return fs.readdirSync(SLIDES_DIR).filter((name) => fs.existsSync(deckHtmlPath(name))); -} - -// 덱의 슬라이드를 한 장씩 preview/에 PNG로 찍고 README를 다시 만든다. -function renderDeck(chrome, slug) { - const deckDir = path.join(SLIDES_DIR, slug); - const deck = readDeck(fs.readFileSync(deckHtmlPath(slug), 'utf8')); - if (deck.count === 0) throw new Error(`${slug}: <section class="slide">가 없습니다.`); - - // 슬라이드 수가 줄었을 때 예전 PNG가 남지 않도록 비우고 다시 만든다. - const previewDir = path.join(deckDir, 'preview'); - fs.rmSync(previewDir, { recursive: true, force: true }); - fs.mkdirSync(previewDir, { recursive: true }); - - withProfile((profileDir) => { - const deckUrl = pathToFileURL(deckHtmlPath(slug)).href; - for (let n = 1; n <= deck.count; n++) { - const out = path.join(previewDir, previewName(n)); - runChrome(chrome, profileDir, [ - '--hide-scrollbars', - `--force-device-scale-factor=${SCALE}`, - `--window-size=${WIDTH},${HEIGHT}`, - `--screenshot=${out}`, - `${deckUrl}?theme=light#${n}`, - ]); - if (!fs.existsSync(out)) throw new Error(`${slug}: ${n}번 슬라이드를 렌더하지 못했습니다.`); - } - }); - - fs.writeFileSync(path.join(deckDir, 'README.md'), buildReadme(slug, deck)); - console.log(`${slug}: ${deck.count} slides → ${path.relative(process.cwd(), previewDir)}`); -} - -// 사용법: render-slides.js [slug...] — slug가 없으면 모든 덱을 렌더한다. -function main() { - const slugs = deckSlugs(process.argv.slice(2)); - if (slugs.length === 0) { - console.log('public/slides 아래에 덱이 없습니다.'); - return; - } - const chrome = findChrome(); - for (const slug of slugs) renderDeck(chrome, slug); -} - -if (require.main === module) { - try { - main(); - } catch (err) { - console.error(err.message); - process.exit(1); - } -} - -module.exports = { - SLIDES_DIR, - WIDTH, - HEIGHT, - findChrome, - runChrome, - withProfile, - deckHtmlPath, - deckSlugs, - readDeck, - buildReadme, - previewName, -};