Skip to content

Commit 6617a89

Browse files
committed
Add DocDataConverter for structured data format conversions and update README.md
1 parent cdf76f8 commit 6617a89

File tree

7 files changed

+828
-20
lines changed

7 files changed

+828
-20
lines changed

README.md

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,32 @@
44

55
Terminal-based file converter built with Go. It provides a modern, user-friendly Terminal User Interface (TUI) for batch converting images, videos, audio, and documents between various formats.
66

7+
## Table of Contents
8+
9+
- [Features](#features)
10+
- [Supported Formats](#supported-formats)
11+
- [Images](#images)
12+
- [Videos](#videos)
13+
- [Audio](#audio)
14+
- [Documents](#documents)
15+
- [Installation](#installation)
16+
- [Prerequisites](#prerequisites)
17+
- [Quick Install](#quick-install)
18+
- [Build from Source](#build-from-source)
19+
- [Platform-Specific Setup](#platform-specific-setup)
20+
- [Usage](#usage)
21+
- [Keyboard Controls](#keyboard-controls)
22+
- [Notes](#notes)
23+
- [License](#license)
24+
725
## Features
826

927
- **Modern TUI Interface:** Beautiful terminal interface with smooth animations and visual feedback.
1028
- **Batch Conversion:** Select multiple files and convert them all at once with concurrent processing.
1129
- **Image Conversion:** Native Go implementation for high-performance image processing with quality control.
1230
- **Video Conversion:** Leverages `ffmpeg` for robust video format support with optimized encoding presets.
1331
- **Audio Conversion:** Convert between various audio formats using `ffmpeg` with bitrate control.
14-
- **Document Conversion:** Support for PDF, Markdown, HTML, and EPUB conversions.
32+
- **Document Conversion:** Support for PDF, Markdown, HTML, EPUB, and doc data conversions (JSON/YAML/XML/TOML/CSV/Excel).
1533
- **Keyboard Navigation:** Full keyboard support with Vim-like keybindings (`j`/`k`, `h`/`l`).
1634
- **Cross-Platform:** Works on Linux, macOS, and Windows.
1735
- **Compression Options:** Choose from High, Balanced, or Compact quality levels.
@@ -58,15 +76,23 @@ Terminal-based file converter built with Go. It provides a modern, user-friendly
5876
- FLAC lossless support
5977
- Opus/Vorbis encoding for OGG
6078

79+
> **Note:** Video and audio conversion requires `ffmpeg`. Ebook conversions beyond EPUB require Calibre's `ebook-convert`. DOCX conversions require Pandoc.
80+
6181
### Documents
6282

63-
| Input | Output |
64-
|-------------------------------------------|---------------------------------------------------------------------------|
83+
| Input | Output |
84+
|-------------------------------------------|----------------------------------------------------------------------------|
6585
| `.pdf`, `.md`, `.html` | `.pdf`, `.md`, `.html`, `.docx`, `.epub`, `.mobi`, `.azw`, `.azw3`, `.fb2` |
66-
| `.docx` | `.md`, `.html`, `.txt` |
67-
| `.epub`, `.mobi`, `.azw`, `.azw3`, `.fb2` | `.epub`, `.mobi`, `.azw`, `.azw3`, `.fb2`, `.pdf`, `.html`, `.txt`, `.md` |
68-
| `.csv` | `.xlsx` |
69-
| `.xlsx`, `.xls` | `.csv` |
86+
| `.docx` | `.md`, `.html`, `.txt` |
87+
| `.epub`, `.mobi`, `.azw`, `.azw3`, `.fb2` | `.epub`, `.mobi`, `.azw`, `.azw3`, `.fb2`, `.pdf`, `.html`, `.txt`, `.md` |
88+
| `.csv` | `.xlsx` |
89+
| `.xlsx`, `.xls` | `.csv` |
90+
| `.json` | `.yaml`, `.yml`, `.xml`, `.csv`, `.xlsx`, `.xls` |
91+
| `.yaml`, `.yml` | `.json`, `.toml` |
92+
| `.toml` | `.yaml`, `.yml` |
93+
| `.xml` | `.json` |
94+
| `.csv` | `.json` |
95+
| `.xlsx`, `.xls` | `.json` |
7096

7197
**Features:**
7298

@@ -78,18 +104,10 @@ Terminal-based file converter built with Go. It provides a modern, user-friendly
78104
- PDF compression/optimization
79105
- CSV to Excel conversion with styled headers and auto-fit columns
80106
- Excel to CSV export (exports first sheet)
81-
82-
> **Note:** Video and audio conversion requires `ffmpeg`. Ebook conversions beyond EPUB require Calibre's `ebook-convert`. DOCX conversions require Pandoc.
83-
84-
**PATH Note (ebook-convert):**
85-
- **Linux:** Typically available at `/usr/bin/ebook-convert` (or `/snap/bin/ebook-convert`). Ensure the directory is on `PATH`.
86-
- **macOS (Homebrew):** `/opt/homebrew/bin/ebook-convert` (Apple Silicon) or `/usr/local/bin/ebook-convert` (Intel).
87-
- **Windows:** `C:\Program Files\Calibre2\ebook-convert.exe` (or `C:\Program Files (x86)\Calibre2\ebook-convert.exe`). Add the folder to `PATH` if not detected.
88-
89-
**PATH Note (pandoc):**
90-
- **Linux:** Typically available at `/usr/bin/pandoc` or `/usr/local/bin/pandoc`.
91-
- **macOS (Homebrew):** `/opt/homebrew/bin/pandoc` (Apple Silicon) or `/usr/local/bin/pandoc` (Intel).
92-
- **Windows:** `C:\Program Files\Pandoc\pandoc.exe` (or `C:\Program Files (x86)\Pandoc\pandoc.exe`). Add the folder to `PATH` if not detected.
107+
- JSON ↔ YAML conversion (preserves nested data)
108+
- JSON ↔ XML conversion with automatic root wrapping
109+
- JSON ↔ CSV / Excel (first sheet) conversions
110+
- YAML ↔ TOML conversion
93111

94112
## Installation
95113

@@ -240,6 +258,20 @@ Start in a specific directory:
240258
| `Esc` | Go back / Cancel |
241259
| `q` | Quit application |
242260

261+
## Notes
262+
263+
**PATH Note (ebook-convert):**
264+
265+
- **Linux:** Typically available at `/usr/bin/ebook-convert` (or `/snap/bin/ebook-convert`). Ensure the directory is on `PATH`.
266+
- **macOS (Homebrew):** `/opt/homebrew/bin/ebook-convert` (Apple Silicon) or `/usr/local/bin/ebook-convert` (Intel).
267+
- **Windows:** `C:\Program Files\Calibre2\ebook-convert.exe` (or `C:\Program Files (x86)\Calibre2\ebook-convert.exe`). Add the folder to `PATH` if not detected.
268+
269+
**PATH Note (pandoc):**
270+
271+
- **Linux:** Typically available at `/usr/bin/pandoc` or `/usr/local/bin/pandoc`.
272+
- **macOS (Homebrew):** `/opt/homebrew/bin/pandoc` (Apple Silicon) or `/usr/local/bin/pandoc` (Intel).
273+
- **Windows:** `C:\Program Files\Pandoc\pandoc.exe` (or `C:\Program Files (x86)\Pandoc\pandoc.exe`). Add the folder to `PATH` if not detected.
274+
243275
## License
244276

245277
[GPL-3.0](LICENSE)

go.mod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ require (
99
github.com/charmbracelet/bubbles v0.21.0
1010
github.com/charmbracelet/bubbletea v1.3.10
1111
github.com/charmbracelet/lipgloss v1.1.0
12+
github.com/clbanning/mxj/v2 v2.7.0
1213
github.com/go-pdf/fpdf v0.9.0
1314
github.com/ledongthuc/pdf v0.0.0-20250511090121-5959a4027728
1415
github.com/pdfcpu/pdfcpu v0.11.1
16+
github.com/pelletier/go-toml/v2 v2.2.3
1517
github.com/taylorskalyo/goreader v1.0.1
1618
github.com/xuri/excelize/v2 v2.10.0
1719
github.com/yuin/goldmark v1.7.16
20+
gopkg.in/yaml.v3 v3.0.1
1821
)
1922

2023
require (
@@ -31,6 +34,7 @@ require (
3134
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
3235
github.com/gabriel-vasile/mimetype v1.3.1 // indirect
3336
github.com/gofrs/uuid v3.1.0+incompatible // indirect
37+
github.com/google/go-cmp v0.7.0 // indirect
3438
github.com/hhrutter/lzw v1.0.0 // indirect
3539
github.com/hhrutter/pkcs7 v0.2.0 // indirect
3640
github.com/hhrutter/tiff v1.0.2 // indirect

go.sum

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payR
3232
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
3333
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
3434
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
35+
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
36+
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
3537
github.com/clipperhouse/uax29/v2 v2.2.0 h1:ChwIKnQN3kcZteTXMgb1wztSgaU+ZemkgWdohwgs8tY=
3638
github.com/clipperhouse/uax29/v2 v2.2.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
3739
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -45,6 +47,8 @@ github.com/go-pdf/fpdf v0.9.0 h1:PPvSaUuo1iMi9KkaAn90NuKi+P4gwMedWPHhj8YlJQw=
4547
github.com/go-pdf/fpdf v0.9.0/go.mod h1:oO8N111TkmKb9D7VvWGLvLJlaZUQVPM+6V42pp3iV4Y=
4648
github.com/gofrs/uuid v3.1.0+incompatible h1:q2rtkjaKT4YEr6E1kamy0Ha4RtepWlQBedyHx0uzKwA=
4749
github.com/gofrs/uuid v3.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
50+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
51+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
4852
github.com/hhrutter/lzw v1.0.0 h1:laL89Llp86W3rRs83LvKbwYRx6INE8gDn0XNb1oXtm0=
4953
github.com/hhrutter/lzw v1.0.0/go.mod h1:2HC6DJSn/n6iAZfgM3Pg+cP1KxeWc3ezG8bBqW5+WEo=
5054
github.com/hhrutter/pkcs7 v0.2.0 h1:i4HN2XMbGQpZRnKBLsUwO3dSckzgX142TNqY/KfXg+I=
@@ -76,6 +80,8 @@ github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc
7680
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
7781
github.com/pdfcpu/pdfcpu v0.11.1 h1:htHBSkGH5jMKWC6e0sihBFbcKZ8vG1M67c8/dJxhjas=
7882
github.com/pdfcpu/pdfcpu v0.11.1/go.mod h1:pP3aGga7pRvwFWAm9WwFvo+V68DfANi9kxSQYioNYcw=
83+
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
84+
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
7985
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
8086
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
8187
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

0 commit comments

Comments
 (0)