Skip to content

Commit f38d7b7

Browse files
serithemageclaude
andcommitted
refactor: hwp2markdown에서 hwp2md로 프로젝트 이름 변경
Breaking Change: 프로젝트 및 바이너리 이름 변경 - Go 모듈: github.com/roboco-io/hwp2md - CLI 바이너리: hwp2md - 설정 디렉토리: ~/.hwp2md 변경 내용: - go.mod 모듈 이름 변경 - cmd/hwp2markdown → cmd/hwp2md 디렉토리 이동 - 모든 Go 파일 import 경로 업데이트 - Makefile, .goreleaser.yml 업데이트 - README.md, docs/ 문서 업데이트 - 테스트 파일 바이너리 참조 업데이트 - CLAUDE.md 프로젝트 컨텍스트 추가 Closes #17 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a6c1556 commit f38d7b7

35 files changed

Lines changed: 281 additions & 191 deletions

.goreleaser.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
version: 2
22

3-
project_name: hwp2markdown
3+
project_name: hwp2md
44

55
before:
66
hooks:
77
- go mod tidy
88
- go generate ./...
99

1010
builds:
11-
- id: hwp2markdown
12-
main: ./cmd/hwp2markdown
13-
binary: hwp2markdown
11+
- id: hwp2md
12+
main: ./cmd/hwp2md
13+
binary: hwp2md
1414
env:
1515
- CGO_ENABLED=0
1616
goos:
@@ -67,12 +67,12 @@ changelog:
6767
release:
6868
github:
6969
owner: roboco-io
70-
name: hwp2markdown
70+
name: hwp2md
7171
draft: false
7272
prerelease: auto
7373
mode: replace
7474
header: |
75-
## hwp2markdown {{ .Version }}
75+
## hwp2md {{ .Version }}
7676
7777
HWP(한글 워드프로세서) 문서를 Markdown으로 변환하는 CLI 도구입니다.
7878
@@ -83,7 +83,7 @@ release:
8383
8484
#### Go 설치
8585
```bash
86-
go install github.com/roboco-io/hwp2markdown/cmd/hwp2markdown@{{ .Version }}
86+
go install github.com/roboco-io/hwp2md/cmd/hwp2md@{{ .Version }}
8787
```
8888
8989
### 주요 기능
@@ -95,15 +95,15 @@ release:
9595
9696
---
9797
98-
**Full Changelog**: https://github.com/roboco-io/hwp2markdown/compare/{{ .PreviousTag }}...{{ .Tag }}
98+
**Full Changelog**: https://github.com/roboco-io/hwp2md/compare/{{ .PreviousTag }}...{{ .Tag }}
9999
100-
자세한 변경 내역은 [CHANGELOG.md](https://github.com/roboco-io/hwp2markdown/blob/main/CHANGELOG.md)를 참조하세요.
100+
자세한 변경 내역은 [CHANGELOG.md](https://github.com/roboco-io/hwp2md/blob/main/CHANGELOG.md)를 참조하세요.
101101
102102
# Homebrew (향후 지원 예정)
103103
# brews:
104104
# - repository:
105105
# owner: roboco-io
106106
# name: homebrew-tap
107-
# homepage: https://github.com/roboco-io/hwp2markdown
107+
# homepage: https://github.com/roboco-io/hwp2md
108108
# description: HWP to Markdown converter CLI tool
109109
# license: MIT

CHANGELOG.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@
77

88
## [Unreleased]
99

10+
## [0.3.0] - 2026-01-10
11+
12+
### 변경
13+
- **Breaking Change**: 프로젝트 이름 변경 `hwp2markdown``hwp2md`
14+
- Go 모듈: `github.com/roboco-io/hwp2md`
15+
- CLI 바이너리: `hwp2md`
16+
- GitHub 저장소: `roboco-io/hwp2md`
17+
18+
### 마이그레이션 안내
19+
```bash
20+
# 기존 설치 제거
21+
go clean -i github.com/roboco-io/hwp2markdown/cmd/hwp2markdown
22+
23+
# 새 버전 설치
24+
go install github.com/roboco-io/hwp2md/cmd/hwp2md@latest
25+
```
26+
1027
## [0.2.2] - 2025-01-10
1128

1229
### 변경
@@ -46,7 +63,7 @@
4663
## [0.1.0] - 2024-01-10
4764

4865
### 추가
49-
- hwp2markdown CLI 도구 초기 릴리즈
66+
- hwp2md CLI 도구 초기 릴리즈
5067
- 2단계 파이프라인 아키텍처:
5168
- Stage 1: 중간 표현(IR)을 사용한 HWPX 파서
5269
- Stage 2: LLM 기반 Markdown 포맷팅 (선택적)
@@ -78,8 +95,9 @@
7895
- 모듈형 LLM 프로바이더 아키텍처
7996
- 종합적인 테스트 커버리지
8097

81-
[Unreleased]: https://github.com/roboco-io/hwp2markdown/compare/v0.2.2...HEAD
82-
[0.2.2]: https://github.com/roboco-io/hwp2markdown/compare/v0.2.1...v0.2.2
83-
[0.2.1]: https://github.com/roboco-io/hwp2markdown/compare/v0.2.0...v0.2.1
84-
[0.2.0]: https://github.com/roboco-io/hwp2markdown/compare/v0.1.0...v0.2.0
85-
[0.1.0]: https://github.com/roboco-io/hwp2markdown/releases/tag/v0.1.0
98+
[Unreleased]: https://github.com/roboco-io/hwp2md/compare/v0.3.0...HEAD
99+
[0.3.0]: https://github.com/roboco-io/hwp2md/compare/v0.2.2...v0.3.0
100+
[0.2.2]: https://github.com/roboco-io/hwp2md/compare/v0.2.1...v0.2.2
101+
[0.2.1]: https://github.com/roboco-io/hwp2md/compare/v0.2.0...v0.2.1
102+
[0.2.0]: https://github.com/roboco-io/hwp2md/compare/v0.1.0...v0.2.0
103+
[0.1.0]: https://github.com/roboco-io/hwp2md/releases/tag/v0.1.0

CLAUDE.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Build & Test Commands
6+
7+
```bash
8+
make build # Build binary to bin/hwp2md
9+
make test # Run all tests with race detection and coverage
10+
make lint # Run golangci-lint
11+
make fmt # Format code
12+
make tidy # Run go mod tidy
13+
14+
# Run a single test
15+
go test -v -run TestName ./internal/parser/hwpx/
16+
17+
# E2E tests
18+
make test-e2e
19+
```
20+
21+
## Architecture
22+
23+
hwp2md uses a **2-stage pipeline** to convert HWP/HWPX documents to Markdown:
24+
25+
```
26+
HWP/HWPX → Stage 1 (Parser) → IR → Stage 2 (LLM, optional) → Markdown
27+
```
28+
29+
### Stage 1: Parser (`internal/parser/`)
30+
- **HWPX Parser** (`hwpx/parser.go`): Native XML-based parser for HWPX format (default)
31+
- **Upstage Parser** (`upstage/upstage.go`): Optional external API parser, outputs `RawMarkdown` directly (bypasses IR conversion)
32+
33+
### IR - Intermediate Representation (`internal/ir/`)
34+
- `Document`: Root container with `Metadata`, `Content` (blocks), and optional `RawMarkdown`
35+
- Block types: `Paragraph`, `Table`, `Image`, `List`
36+
- Upstage parser stores markdown directly in `doc.RawMarkdown`, skipping block-level IR
37+
38+
### Stage 2: LLM Providers (`internal/llm/`)
39+
- Common interface: `Provider` with `Format(ctx, doc, opts)` method
40+
- Providers: `anthropic/`, `openai/`, `gemini/`, `upstage/`, `ollama/`
41+
- Model name auto-detection: `claude-*` → Anthropic, `gpt-*` → OpenAI, etc.
42+
43+
### CLI (`internal/cli/`)
44+
- Entry point: `cmd/hwp2md/main.go`
45+
- Commands: `convert` (default), `extract`, `config`, `providers`
46+
- `convert.go`: Main conversion logic, parser selection, LLM formatting
47+
48+
## Key Files
49+
50+
| File | Purpose |
51+
|------|---------|
52+
| `internal/cli/convert.go` | Main conversion pipeline, parser/LLM orchestration |
53+
| `internal/parser/hwpx/parser.go` | HWPX XML parsing, table/cell span handling |
54+
| `internal/ir/ir.go` | IR document structure definitions |
55+
| `internal/llm/provider.go` | LLM provider interface |
56+
| `internal/llm/prompt.go` | System prompts for LLM formatting |
57+
58+
## Environment Variables
59+
60+
| Variable | Purpose |
61+
|----------|---------|
62+
| `HWP2MD_PARSER` | Parser selection: `native` (default), `upstage` |
63+
| `HWP2MD_LLM` | Enable Stage 2: `true` |
64+
| `HWP2MD_MODEL` | Model name (auto-detects provider) |
65+
| `HWP2MD_BASE_URL` | Private API endpoint (Bedrock, Azure, local) |
66+
| `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GOOGLE_API_KEY`, `UPSTAGE_API_KEY` | Provider API keys |
67+
68+
## Conventions
69+
70+
- Korean is the primary language for CLI messages, comments, and documentation
71+
- Cell merge handling: rowspan → ``, colspan → empty cell
72+
- Special whitespace elements (`<hp:fwSpace/>`, `<hp:hwSpace/>`) → regular space

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
44
LDFLAGS := -ldflags="-s -w -X main.version=$(VERSION)"
5-
BINARY := hwp2markdown
5+
BINARY := hwp2md
66

77
build:
8-
go build $(LDFLAGS) -o bin/$(BINARY) ./cmd/hwp2markdown
8+
go build $(LDFLAGS) -o bin/$(BINARY) ./cmd/hwp2md
99

1010
test:
1111
go test -v -race -cover ./...
@@ -27,10 +27,10 @@ hooks:
2727

2828
release: clean
2929
mkdir -p dist
30-
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o dist/$(BINARY)-windows-x64.exe ./cmd/hwp2markdown
31-
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o dist/$(BINARY)-macos-x64 ./cmd/hwp2markdown
32-
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o dist/$(BINARY)-macos-arm64 ./cmd/hwp2markdown
33-
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o dist/$(BINARY)-linux-x64 ./cmd/hwp2markdown
30+
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o dist/$(BINARY)-windows-x64.exe ./cmd/hwp2md
31+
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o dist/$(BINARY)-macos-x64 ./cmd/hwp2md
32+
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o dist/$(BINARY)-macos-arm64 ./cmd/hwp2md
33+
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o dist/$(BINARY)-linux-x64 ./cmd/hwp2md
3434

3535
run: build
3636
./bin/$(BINARY) $(ARGS)

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# hwp2markdown
1+
# hwp2md
22

33
[![Go Version](https://img.shields.io/badge/Go-1.24+-00ADD8?style=flat&logo=go)](https://go.dev/)
44
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5-
[![Build](https://github.com/roboco-io/hwp2markdown/actions/workflows/test.yml/badge.svg)](https://github.com/roboco-io/hwp2markdown/actions/workflows/test.yml)
6-
[![Go Report Card](https://goreportcard.com/badge/github.com/roboco-io/hwp2markdown)](https://goreportcard.com/report/github.com/roboco-io/hwp2markdown)
5+
[![Build](https://github.com/roboco-io/hwp2md/actions/workflows/test.yml/badge.svg)](https://github.com/roboco-io/hwp2md/actions/workflows/test.yml)
6+
[![Go Report Card](https://goreportcard.com/badge/github.com/roboco-io/hwp2md)](https://goreportcard.com/report/github.com/roboco-io/hwp2md)
77

88
HWP(한글 워드프로세서) 문서를 Markdown으로 변환하는 CLI 도구
99

@@ -61,34 +61,34 @@ Stage 1만으로도 기본적인 변환이 가능하지만, 복잡한 레이아
6161
### Go 설치 (권장)
6262

6363
```bash
64-
go install github.com/roboco-io/hwp2markdown/cmd/hwp2markdown@latest
64+
go install github.com/roboco-io/hwp2md/cmd/hwp2md@latest
6565
```
6666

6767
### 바이너리 다운로드
6868

69-
[GitHub Releases](https://github.com/roboco-io/hwp2markdown/releases)에서 플랫폼별 바이너리를 다운로드할 수 있습니다.
69+
[GitHub Releases](https://github.com/roboco-io/hwp2md/releases)에서 플랫폼별 바이너리를 다운로드할 수 있습니다.
7070

7171
| 플랫폼 | 아키텍처 | 파일 |
7272
|--------|----------|------|
73-
| Windows | x64 | `hwp2markdown_*_windows_amd64.zip` |
74-
| macOS | Intel | `hwp2markdown_*_darwin_amd64.tar.gz` |
75-
| macOS | Apple Silicon | `hwp2markdown_*_darwin_arm64.tar.gz` |
76-
| Linux | x64 | `hwp2markdown_*_linux_amd64.tar.gz` |
73+
| Windows | x64 | `hwp2md_*_windows_amd64.zip` |
74+
| macOS | Intel | `hwp2md_*_darwin_amd64.tar.gz` |
75+
| macOS | Apple Silicon | `hwp2md_*_darwin_arm64.tar.gz` |
76+
| Linux | x64 | `hwp2md_*_linux_amd64.tar.gz` |
7777

7878
## 사용법
7979

8080
### 기본 변환 (Stage 1만)
8181

8282
```bash
8383
# HWPX 파일을 Markdown으로 변환
84-
hwp2markdown document.hwpx -o output.md
84+
hwp2md document.hwpx -o output.md
8585

8686
# 표준 출력으로 변환
87-
hwp2markdown document.hwpx
87+
hwp2md document.hwpx
8888
```
8989

9090
> **Note**: `convert` 명령어는 기본 명령이므로 생략할 수 있습니다.
91-
> `hwp2markdown document.hwpx``hwp2markdown convert document.hwpx`는 동일합니다.
91+
> `hwp2md document.hwpx``hwp2md convert document.hwpx`는 동일합니다.
9292
9393
### Upstage Document Parse 사용 (Stage 1 - 선택적)
9494

@@ -97,11 +97,11 @@ hwp2markdown document.hwpx
9797
```bash
9898
# Upstage Document Parse 사용
9999
export UPSTAGE_API_KEY="your-api-key"
100-
hwp2markdown document.hwpx --parser upstage
100+
hwp2md document.hwpx --parser upstage
101101

102102
# 환경변수로 설정
103103
export HWP2MD_PARSER="upstage"
104-
hwp2markdown document.hwpx
104+
hwp2md document.hwpx
105105
```
106106

107107
> **Note**: Upstage Document Parse는 API 키가 필요하며 사용량에 따라 비용이 발생합니다. 대부분의 HWPX 문서는 내장 파서로 충분히 변환됩니다.
@@ -113,32 +113,32 @@ LLM을 사용하면 더 자연스럽고 읽기 쉬운 Markdown을 생성할 수
113113
```bash
114114
# Anthropic Claude 사용 (기본)
115115
export ANTHROPIC_API_KEY="your-api-key"
116-
hwp2markdown convert document.hwpx --llm
116+
hwp2md convert document.hwpx --llm
117117

118118
# OpenAI GPT 사용
119119
export OPENAI_API_KEY="your-api-key"
120-
hwp2markdown convert document.hwpx --llm --provider openai
120+
hwp2md convert document.hwpx --llm --provider openai
121121

122122
# Google Gemini 사용
123123
export GOOGLE_API_KEY="your-api-key"
124-
hwp2markdown convert document.hwpx --llm --provider gemini
124+
hwp2md convert document.hwpx --llm --provider gemini
125125

126126
# Upstage Solar 사용
127127
export UPSTAGE_API_KEY="your-api-key"
128-
hwp2markdown convert document.hwpx --llm --provider upstage
128+
hwp2md convert document.hwpx --llm --provider upstage
129129

130130
# Ollama 사용 (로컬)
131-
hwp2markdown convert document.hwpx --llm --provider ollama --model llama3.2
131+
hwp2md convert document.hwpx --llm --provider ollama --model llama3.2
132132
```
133133

134134
### IR 추출
135135

136136
```bash
137137
# JSON 형식으로 IR 추출
138-
hwp2markdown extract document.hwpx -o output.json
138+
hwp2md extract document.hwpx -o output.json
139139

140140
# 텍스트 형식으로 추출
141-
hwp2markdown extract document.hwpx --format text
141+
hwp2md extract document.hwpx --format text
142142
```
143143

144144
### 환경 변수
@@ -168,13 +168,13 @@ AWS Bedrock, Azure OpenAI, 로컬 서버 등 프라이빗 엔드포인트를 사
168168

169169
```bash
170170
# AWS Bedrock
171-
hwp2markdown convert document.hwpx --llm --model claude-3-sonnet --base-url https://bedrock-runtime.us-east-1.amazonaws.com
171+
hwp2md convert document.hwpx --llm --model claude-3-sonnet --base-url https://bedrock-runtime.us-east-1.amazonaws.com
172172

173173
# Azure OpenAI
174-
hwp2markdown convert document.hwpx --llm --model gpt-4 --base-url https://your-resource.openai.azure.com
174+
hwp2md convert document.hwpx --llm --model gpt-4 --base-url https://your-resource.openai.azure.com
175175

176176
# 로컬 서버
177-
hwp2markdown convert document.hwpx --llm --model llama3.2 --base-url http://localhost:8080
177+
hwp2md convert document.hwpx --llm --model llama3.2 --base-url http://localhost:8080
178178
```
179179

180180
## 지원 포맷
@@ -205,8 +205,8 @@ hwp2markdown convert document.hwpx --llm --model llama3.2 --base-url http://loca
205205

206206
```bash
207207
# 저장소 클론
208-
git clone https://github.com/roboco-io/hwp2markdown.git
209-
cd hwp2markdown
208+
git clone https://github.com/roboco-io/hwp2md.git
209+
cd hwp2md
210210

211211
# 의존성 다운로드
212212
go mod download
@@ -224,8 +224,8 @@ make lint
224224
### 프로젝트 구조
225225

226226
```
227-
hwp2markdown/
228-
├── cmd/hwp2markdown/ # CLI 엔트리포인트
227+
hwp2md/
228+
├── cmd/hwp2md/ # CLI 엔트리포인트
229229
├── internal/
230230
│ ├── cli/ # CLI 명령 구현
231231
│ ├── config/ # 설정 관리
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"os"
55

6-
"github.com/roboco-io/hwp2markdown/internal/cli"
6+
"github.com/roboco-io/hwp2md/internal/cli"
77
)
88

99
var version = "dev"

0 commit comments

Comments
 (0)