A delightful question!
You're right; Pandoc is a shining star in the realm of document conversion, supporting an impressive array of formats (Markdown, LaTeX, HTML, DOCX, EPUB, PDF, and many more). The concept of "universal conversion" – having one tool that can translate between numerous formats within a specific domain – is incredibly valuable. It simplifies workflows, reduces format lock-in, and makes interoperability a breeze.
While no tool might match Pandoc's breadth (yet!), there are indeed remarkable alternatives in other domains. Let's explore some "Pandoc-like" tools across various domains:
1. Data serialization formats: jq (JSON, YAML, XML, CSV, ...)
Domain: Data exchange formats
jq isn't exactly a format converter, but a lightweight, command-line JSON processor that's often used for conversions. It's like Pandoc for JSON, YAML, XML, and CSV. With jq, you can:
* Parse, filter, and transform JSON data
* Convert between JSON, YAML, XML, and CSV (using additional tools like yq, xq, or csvkit)
Example: jq -r '.' data.json > data.yaml (convert JSON to YAML)
2. Image formats: ImageMagick (PNG, JPEG, GIF, TIFF, PDF, ...)
Domain: Raster graphics
ImageMagick is the de facto standard for image format conversion, manipulation, and processing. This suite of command-line tools can:
* Convert between 200+ image formats (e.g., convert input.jpg output.png)
* Resize, crop, flip, and apply effects
* Create GIFs, thumbnails, or spritesheets
Example: convert input.pdf output-%03d.png (split a PDF into PNG pages)
3. 3D models: OpenSCAD & MeshLab (STL, OBJ, AMF, OFF, ... )
Domain: 3D modeling & mesh processing
While not a single tool for all conversions, the combination of OpenSCAD and MeshLab covers a broad range of 3D format conversions:
* OpenSCAD: A script-based 3D modeling tool that can export/import: STL, OFF, AMF, DXF, and more.
* MeshLab: A GUI & command-line tool for mesh processing, converting between: STL, OBJ, PLY, VRML, COLLADA, 3DS, X3D, and others.
Example (MeshLab): meshlabserver -i input.stl -o output.obj (convert STL to OBJ)
4. Audio formats: FFmpeg (MP3, WAV, FLAC, AAC, OGG, ...)
Domain: Audio & video codecs
FFmpeg is the multimedia behemoth that dwarfs others in format support. While mostly known for video processing, it's equally adept at:
* Converting between 100+ audio formats (e.g., ffmpeg -i input.mp3 output.wav)
* Editing, mixing, and streaming audio
Example: ffmpeg -i input.flac -c:a libmp3lame output.mp3 (FLAC to MP3)
5. Spreadsheet formats: ssconvert (Gnumeric) (XLS, XLSX, ODS, CSV, ...)
Domain: Spreadsheets
Part of the Gnumeric spreadsheet program, ssconvert is a command-line tool dedicated to spreadsheet conversions:
* Supports 30+ formats, including XLS, XLSX, ODS, CSV, HTML tables
Example: ssconvert input.xlsx output.ods (XLSX to ODS)
6. E-book formats: Calibre (EPUB, MOBI, AZW, PDF, FB2, ...)
Domain: E-books
Calibre, the renowned e-book manager, includes a powerful conversion engine:
* GUI and command-line (ebook-convert) interfaces
* Converts between 20+ e-book formats, adjusting styling and layout as needed
Example: ebook-convert input.epub output.mobi (EPUB to MOBI)
7. Geospatial data: ogr2ogr (GDAL) (SHP, GeoJSON, GPKG, KML, ...)
Domain: Geographic Information Systems (GIS)
The Geospatial Data Abstraction Library (GDAL) provides ogr2ogr for vector data conversions:
* Supports 80+ formats, including SHP, GeoJSON, GPKG, KML, MapInfo TAB
Example: ogr2ogr -f GeoJSON output.geojson input.shp (SHP to GeoJSON)
8. Source code (programming languages): polyglot (not exactly like Pandoc, but...)
Domain: Code translation between programming languages
While not a straightforward format converter, Polyglot is a research project & tool that translates code between languages (think: Java <-> Python). Not production-ready, but promising.
Honorable mentions:
bibtool (Bibliography formats: BibTeX, BibLaTeX, RIS, ...)
unoconv & LibreOffice (Office document conversions: DOC, DOCX, ODT, ...)
csl-cli (Citation Style Language: various citation formats)
Keep in mind that some of these tools might:
* Have varying degrees of conversion quality or fidelity.
* Require additional processing steps (e.g., intermediate formats).
* Support a subset of features within each format (e.g., losing layout nuances).
Still, each of these tools is an invaluable asset in its domain, just like Pandoc in the document world. By wielding these converters, you'll significantly enhance your workflow flexibility and break free from format constraints.
Happy converting!