|
1 | 1 | Metadata-Version: 2.1 |
2 | 2 | Name: md2docx-python |
3 | | -Version: 0.3.0 |
| 3 | +Version: 0.3.1 |
4 | 4 | Summary: Markdown to Word Converter. |
5 | 5 | Simple and straight forward Python utility |
6 | 6 | that converts a Markdown file (`.md`) to a Microsoft |
@@ -39,20 +39,56 @@ Description: # Markdown to Word Converter |
39 | 39 | - `python-docx` for creating and editing Word documents. |
40 | 40 | - `beautifulsoup4` for parsing HTML. |
41 | 41 |
|
42 | | - You can install the required libraries using pip: |
| 42 | + Sure, let's enhance your instructions for clarity and completeness: |
| 43 | + |
| 44 | + --- |
| 45 | + |
| 46 | + ### How to Convert Markdown to Word Using `md2docx-python` |
| 47 | + |
| 48 | + #### Step 1: Install the Required Library |
| 49 | + First, you need to install the `md2docx-python` library using pip. Open your terminal and run the following command: |
43 | 50 |
|
44 | 51 | ```bash |
45 | | - pip install -r requirements.txt |
| 52 | + pip install md2docx-python |
46 | 53 | ``` |
47 | 54 |
|
48 | | - To run the sample files follow the below steps: |
| 55 | + #### Step 2: Import the Library in Your Code |
| 56 | + To use the library, import it into your Python code with the following line: |
49 | 57 |
|
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 |
| 58 | + ```python |
| 59 | + from md2docx_python.src.md2docx_python import markdown_to_word |
| 60 | + ``` |
| 61 | + |
| 62 | + #### Step 3: Convert Markdown to Word |
| 63 | + Call the `markdown_to_word()` function to convert your Markdown file to a Word document. Here's the syntax: |
| 64 | + |
| 65 | + ```python |
| 66 | + markdown_to_word(markdown_file, word_file) |
| 67 | + ``` |
| 68 | + |
| 69 | + - `markdown_file`: The path to the Markdown file you want to convert. |
| 70 | + - `word_file`: The desired path and name for the output Word document. |
| 71 | + |
| 72 | + #### Step 4: Sample Code |
| 73 | + Here's a complete example to illustrate how it works: |
| 74 | + |
| 75 | + ```python |
| 76 | + from md2docx_python.src.md2docx_python import markdown_to_word |
| 77 | + |
| 78 | + # Define the paths to your files |
| 79 | + markdown_file = "sample_files/amazon_case_study.md" |
| 80 | + word_file = "sample_files/amazon_case_study.docx" |
| 81 | + |
| 82 | + # Convert the Markdown file to a Word document |
| 83 | + markdown_to_word(markdown_file, word_file) |
54 | 84 | ``` |
55 | 85 |
|
| 86 | + This code will create a file named `amazon_case_study.docx`, which is the conversion of `amazon_case_study.md` to the Word format. |
| 87 | + |
| 88 | + --- |
| 89 | + |
| 90 | + This should make it easier to understand and follow the steps. Let me know if you need any more help or further enhancements! |
| 91 | + |
56 | 92 | ## Why this repo and not others ? |
57 | 93 |
|
58 | 94 | 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: |
|
0 commit comments