|
| 1 | +Metadata-Version: 2.1 |
| 2 | +Name: md2docx-python |
| 3 | +Version: 0.3.0 |
| 4 | +Summary: Markdown to Word Converter. |
| 5 | + Simple and straight forward Python utility |
| 6 | + that converts a Markdown file (`.md`) to a Microsoft |
| 7 | + Word document (`.docx`). It supports basic Markdown |
| 8 | + elements, including headings, bold and italic text, |
| 9 | + and both unordered and ordered lists. |
| 10 | +Home-page: https://github.com/shloktech/md2docx-python |
| 11 | +Author: Shlok Tadilkar |
| 12 | +Author-email: shloktadilkar@gmail.com |
| 13 | +License: MIT |
| 14 | +Description: # Markdown to Word Converter |
| 15 | + |
| 16 | + ## Overview |
| 17 | + |
| 18 | + Simple and straight forward Python utility that converts a Markdown file (`.md`) to a Microsoft Word document (`.docx`). It supports basic Markdown elements, including headings, bold and italic text, and both unordered and ordered lists. |
| 19 | + |
| 20 | + #### Input .md file: |
| 21 | +  |
| 22 | + |
| 23 | + #### Output .docx file: |
| 24 | +  |
| 25 | + |
| 26 | + |
| 27 | + ## Features |
| 28 | + |
| 29 | + - Converts Markdown headers (`#`, `##`, `###`) to Word document headings. |
| 30 | + - Supports bold and italic text formatting. |
| 31 | + - Converts unordered (`*`, `-`) and ordered (`1.`, `2.`) lists. |
| 32 | + - Handles paragraphs with mixed content. |
| 33 | + |
| 34 | + ## Prerequisites |
| 35 | + |
| 36 | + You need to have Python installed on your system along with the following libraries: |
| 37 | + |
| 38 | + - `markdown` for converting Markdown to HTML. |
| 39 | + - `python-docx` for creating and editing Word documents. |
| 40 | + - `beautifulsoup4` for parsing HTML. |
| 41 | + |
| 42 | + You can install the required libraries using pip: |
| 43 | + |
| 44 | + ```bash |
| 45 | + pip install -r requirements.txt |
| 46 | + ``` |
| 47 | + |
| 48 | + To run the sample files follow the below steps: |
| 49 | + |
| 50 | + ```bash |
| 51 | + python md2docx_python.py |
| 52 | + Enter the path to the Markdown file (e.g., README.md): ..\sample_files\amazon_case_study.md |
| 53 | + Enter the path for the output Word file (e.g., README.docx): ..\sample_files\amazon_case_study.docx |
| 54 | + ``` |
| 55 | + |
| 56 | + ## Why this repo and not others ? |
| 57 | + |
| 58 | + Here are some reasons why this repo might be considered better or more suitable for certain use cases compared to other scripts available on the internet: |
| 59 | + |
| 60 | + ### 1. **Comprehensive Markdown Support** |
| 61 | + - **Header Levels**: The script supports multiple header levels (`h1`, `h2`, `h3`), which is important for properly structuring the document. |
| 62 | + - **Bold and Italic Text**: It handles bold (`**`) and italic (`*`) text, providing more accurate formatting in the Word document. |
| 63 | + |
| 64 | + ### 2. **Proper List Formatting** |
| 65 | + - **Unordered and Ordered Lists**: The script correctly formats both unordered (`*`, `-`) and ordered lists (`1.`, `2.`) in the Word document. This ensures that lists appear as expected without additional line breaks or formatting issues. |
| 66 | + |
| 67 | + ### 3. **Use of Well-Supported Libraries** |
| 68 | + - **Markdown to HTML Conversion**: Utilizes the `markdown` library, which is a widely used and reliable tool for converting Markdown to HTML. |
| 69 | + - **HTML Parsing and Word Document Creation**: Employs `BeautifulSoup` for parsing HTML and `python-docx` for creating Word documents, both of which are robust and well-maintained libraries. |
| 70 | + |
| 71 | + ### 4. **Simplicity and Readability** |
| 72 | + - **Clear Code Structure**: The script is designed to be straightforward and easy to understand, making it accessible for users who may want to customize or extend it. |
| 73 | + - **Basic Markdown Elements**: Focuses on the most commonly used Markdown elements, ensuring compatibility with a wide range of Markdown files without unnecessary complexity. |
| 74 | + |
| 75 | + ### 5. **Customizability** |
| 76 | + - **Easy to Modify**: Users can easily adjust the script to handle additional Markdown features or customize the output format based on their specific needs. |
| 77 | + - **Example Usage**: Provides a clear example of how to use the script, making it easy for users to adapt it for their own files. |
| 78 | + |
| 79 | + ### 6. **Minimal Dependencies** |
| 80 | + - **Lightweight and Focused**: The script relies on only a few libraries, which reduces potential conflicts and keeps the script lightweight. |
| 81 | + |
| 82 | + ### 7. **Handles Basic HTML Tags** |
| 83 | + - **Text Formatting**: Properly handles bold and italic text by interpreting HTML tags (`strong`, `em`), ensuring that formatting is preserved when converting to Word. |
| 84 | + |
| 85 | + ### 8. **Privacy** |
| 86 | + - If you are working in a corporate firm and you want to convert your markdown files to word and you use a online tool to do it then there are chances that they will store your file which can cause to a vital information leak of your company. With use of this repo you can easily do the conversion in your own system. |
| 87 | + |
| 88 | + ### Comparison to Other Scripts |
| 89 | + - **Feature Set**: Some scripts may lack comprehensive support for Markdown features or may not handle lists and text formatting well. |
| 90 | + - **Performance**: Depending on the implementation, performance might vary. This script is designed to be efficient for typical Markdown files. |
| 91 | + - **User-Friendliness**: The clear and concise code in this script may make it more user-friendly and easier to modify compared to more complex alternatives. |
| 92 | + |
| 93 | + Overall, this script provides a balanced combination of functionality, simplicity, and ease of use, which can be advantageous for many users looking to convert Markdown files to Word documents. |
| 94 | + |
| 95 | + For any queries please start a discussion I will be happy to answer your queries :) |
| 96 | + |
| 97 | +Platform: UNKNOWN |
| 98 | +Requires-Python: >=3.9.0 |
| 99 | +Description-Content-Type: text/markdown |
0 commit comments