A robust Go-based utility to convert .docx documents into clean, structured Markdown (.md) files. Designed to preserve essential formatting from original documents.
- Smart Text Conversion: Converts paragraphs, bold, italic, and combined formatting.
- Automatic Heading Detection: Intelligently determines heading levels (#, ##, ###, ####) based on the original font size.
- Table Support: Automatically converts DOCX tables into clean Markdown table format.
- List and Sub-list Handling: Supports numbered lists (1, A, a, i) and bullet points with proper hierarchical (sub-list) support.
- Image Extraction: Automatically extracts images from the original document and saves them to an 'images' folder in the output directory with correct markdown links.
- Organized Output Structure: Each conversion creates a dedicated folder to keep markdown files and images organized.
cmd/markdown-gokil/: CLI entry point.internal/docx/: DOCX XML parsing logic, table, and numbering handling.internal/converter/: Conversion orchestration and output folder management.internal/markdown/: Writer for generating clean Markdown syntax.
Ensure you have Go installed on your system.
go build -o build/markdown-gokil ./cmd/markdown-gokil/main.goRun the following command to convert a document:
# Otomatis membuat output berdasarkan nama file (misal: outputs/input/input.md)
./build/markdown-gokil input.docx
# Dengan folder output spesifik
./build/markdown-gokil input.docx hasilThe conversion output will be available in the outputs/result/ folder.
This project uses Justfile (a modern alternative to Makefile) for task automation:
just build: Compiles the application tobuild/.just run <input.docx> [output_name]: Runs the conversion directly.just tidy: Cleans up Go dependencies.just clean: Removes the build folder and binary.
Created for fast and efficient document conversion.
