Skip to content

md2hwpx: 코드 블록 syntax highlighting (syntect 통합) #651

@ryujt

Description

@ryujt

배경

md2hwpx는 코드 블록 전체를 단일 CharShape(D2Coding 9pt 검정)로 출력한다.
가독성을 높이기 위해 highlight.js 수준의 syntax highlighting을 적용한다.

목표

  • 펜스드 코드 블록의 언어 인포 스트링(js, rust 등)을 인식
  • syntect 기반 토큰 하이라이팅을 적용해 토큰별 색상이 다른 run 생성
  • 테마 선택 가능 (기본: github-light)
  • 언어 미지정/미지원 시 기존 단색 동작으로 폴백

범위 (제안)

  • 의존성: syntect (no-default-features, dump 기반)
  • 옵션: --code-theme <name> (기본 github-light), --no-highlight 플래그
  • 인라인 코드(...)는 기존 동작 유지 (하이라이팅 미적용)
  • 코드 블록 배경색/거터는 이번 범위에서 제외

비고

샘플: docker-tools/dev-shell/code.md → code.hwpx 변환 결과로 검증

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions