A batch script that converts documents to Markdown format with enhanced features for handling images and formatting.
- Pandoc - Document converter
- ImageMagick - For image conversion
- PowerShell (comes pre-installed on Windows)
- Download
GenMD.bat
to your preferred location - Ensure Pandoc and ImageMagick are installed and accessible from the command line
- (Optional) Create a shortcut to
GenMD.bat
for easier access
There are three ways to use the converter:
- Simply drag and drop any supported document onto the
GenMD.bat
file - The script will automatically convert it to Markdown format
- Double-click
GenMD.bat
- Drag and drop your file into the command window, or manually type/paste the file path
- Press Enter to start the conversion
- Double-click
GenMD.bat
- When prompted, type or paste the full path to your document
- Press Enter to start the conversion
- Converts documents to Markdown while preserving:
- Code blocks
- Tables
- Images
- Footnotes
- Superscript and subscript
- Automatically converts EMF images to PNG format
- Creates an
attachments
folder for media files - Cleans up formatting issues like excessive dashes and equal signs
The script will create:
- A
.md
file with the same name as your input file - An
attachments/[filename]
folder containing any extracted media
Supports all input formats that Pandoc can handle, including:
- Word Documents (.docx)
- HTML
- RTF
- And many more
If you encounter any issues:
- Ensure all prerequisites are properly installed
- Check if the input file path contains special characters
- Verify you have write permissions in the output directory
- Open an issue here