Skip to content

femas66/markdown-gokil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown Gokil (DOCX to MD Converter)

A robust Go-based utility to convert .docx documents into clean, structured Markdown (.md) files. Designed to preserve essential formatting from original documents.

Key Features

  • 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.

Project Structure

  • 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.

Installation

Ensure you have Go installed on your system.

go build -o build/markdown-gokil ./cmd/markdown-gokil/main.go

Usage

Run 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 hasil

The conversion output will be available in the outputs/result/ folder.

Development

This project uses Justfile (a modern alternative to Makefile) for task automation:

  • just build: Compiles the application to build/.
  • just run <input.docx> [output_name]: Runs the conversion directly.
  • just tidy: Cleans up Go dependencies.
  • just clean: Removes the build folder and binary.

License

Created for fast and efficient document conversion.

About

Transform .docx files into .md the "Gokil" way. Fast, simple, and supports automatic image extraction with smart heading detection.

Topics

Resources

Stars

Watchers

Forks

Contributors