Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ export OPENAI_API_BASE=<your-api-base>
# Optionally, set up your OpenAI API model
export OPENAI_DEFAULT_MODEL=<your-model>

# Run the application
# pdf to markdown
python main.py < tests/input.pdf > output.md

# image to markdown
python main.py < input_image.png > output.md
```
## Advanced Usage
```bash
python main.py page_start page_end < tests/input.pdf > output.md

# image to markdown
python main.py < tests/input_image.png > output.md
```

## Docker Usage
```bash
docker run -i -e OPENAI_API_KEY=<your-api-key> -e OPENAI_API_BASE=<your-api-base> -e OPENAI_DEFAULT_MODEL=<your-model> jorben/markpdfdown < tests/input.pdf > output.md
docker run -i -e OPENAI_API_KEY=<your-api-key> -e OPENAI_API_BASE=<your-api-base> -e OPENAI_DEFAULT_MODEL=<your-model> jorbenzhu/markpdfdown < input.pdf > output.md
```

## Requirements
Expand Down
14 changes: 7 additions & 7 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ export OPENAI_API_BASE=<你的API端点>
# 可选设置默认模型
export OPENAI_DEFAULT_MODEL=<你的模型>

# 运行转换程序
python main.py < tests/input.pdf > output.md
# PDF转换Markdown
python main.py < input.pdf > output.md

# 图片转换
python main.py < tests/input_image.png > output.md
# 图片转换Markdown
python main.py < input_image.png > output.md
```

## 高级用法
```bash
# 转换指定页码范围
python main.py 起始页码 结束页码 < tests/input.pdf > output.md
# 转换指定页码范围(限PDF)
python main.py 起始页码 结束页码 < input.pdf > output.md
```

## 在Docker中使用
```bash
docker run -i -e OPENAI_API_KEY=<你的API密钥> -e OPENAI_API_BASE=<你的API端点> -e OPENAI_DEFAULT_MODEL=<你的模型> jorben/markpdfdown < tests/input.pdf > output.md
docker run -i -e OPENAI_API_KEY=<你的API密钥> -e OPENAI_API_BASE=<你的API端点> -e OPENAI_DEFAULT_MODEL=<你的模型> jorbenzhu/markpdfdown < input.pdf > output.md
```

## 依赖环境
Expand Down
Loading