Skip to content

Adding Docs to Markdown Feature

Latest

Choose a tag to compare

@shloktech shloktech released this 14 Mar 15:54
· 2 commits to main since this release
a9a37dc

I am introducing a new feature in this repo which will convert the given docs to Markdown.

Install new release using:
pip install md2docx-python==1.0.0

Word to Markdown Conversion Example:

Input .docx file:

image

Output .md file:

image

For Converting Word to Markdown

Use the word_to_markdown() function to convert your Word document to Markdown:

word_to_markdown(word_file, markdown_file)
  • word_file: The path to the Word document you want to convert
  • markdown_file: The desired path and name for the output Markdown file

Here's a complete example:

from md2docx_python.src.docx2md_python import word_to_markdown

# Define the paths to your files
word_file = "sample_files/test_document.docx"
markdown_file = "sample_files/test_document_output.md"

# Convert the Word document to a Markdown file
word_to_markdown(word_file, markdown_file)

This code will create a file named test_document_output.md, which is the conversion of test_document.docx to the Markdown format.