Markdown to DOCX Converter. This simple script processes all Markdown (.md
) files in the files
folder and generates corresponding DOCX files for each Markdown file that doesn't already have a DOCX file. The script checks all files inside the files
folder and converts them one by one until all Markdown files are successfully converted.
- Python 3.x
- Required Python packages (
markdown2
,python-docx
,beautifulsoup4
)
-
Clone the repository or download the script and the
requirements.txt
file. -
Install the required packages using pip:
pip install -r requirements.txt
-
Ensure that all your Markdown files are placed in a folder named
files
in the same directory as the script. -
Run the script:
python generate_doc.py
-
The script will process each Markdown file in the
files
folder and create a DOCX file for each one that doesn't already have a corresponding DOCX file. The DOCX files will be saved in the samefiles
folder.
/project-root
├── files/
│ ├── example.md
│ └── ...
├── generate_doc.py
├── requirements.txt
└── README.md
Suppose you have a Markdown file named example.md
in the files
folder. After running the script, a corresponding example.docx
file will be generated in the same folder if it doesn't already exist.
This project is licensed under the MIT License - see the LICENSE file for details.