diff --git a/build/lib/md2docx_python/src/markdown_to_word_converter.py b/build/lib/md2docx_python/src/markdown_to_word_converter.py deleted file mode 100644 index f38ba3d..0000000 --- a/build/lib/md2docx_python/src/markdown_to_word_converter.py +++ /dev/null @@ -1,48 +0,0 @@ -import markdown -from docx import Document -from bs4 import BeautifulSoup - -def markdown_to_word(markdown_file, word_file): - # Reading the Markdown file - with open(markdown_file, 'r', encoding='utf-8') as file: - markdown_content = file.read() - - # Converting Markdown to HTML - html_content = markdown.markdown(markdown_content) - - # Creating a new Word Document - doc = Document() - - # Converting HTML to text and add it to the Word Document - soup = BeautifulSoup(html_content, 'html.parser') - - # Adding content to the Word Document - for element in soup: - if element.name == 'h1': - doc.add_heading(element.text, level=1) - elif element.name == 'h2': - doc.add_heading(element.text, level=2) - elif element.name == 'h3': - doc.add_heading(element.text, level=3) - elif element.name == 'p': - paragraph = doc.add_paragraph() - for child in element.children: - if child.name == 'strong': - paragraph.add_run(child.text).bold = True - elif child.name == 'em': - paragraph.add_run(child.text).italic = True - else: - paragraph.add_run(child) - elif element.name == 'ul': - for li in element.find_all('li'): - doc.add_paragraph(li.text, style='List Bullet') - elif element.name == 'ol': - for li in element.find_all('li'): - doc.add_paragraph(li.text, style='List Number') - - doc.save(word_file) - -markdown_file = input("Enter the path to the Markdown file (e.g., README.md): ") -word_file = input("Enter the path for the output Word file (e.g., README.docx): ") - -markdown_to_word(markdown_file, word_file) diff --git a/build/lib/src/__init__.py b/build/lib/src/__init__.py deleted file mode 100644 index e8c07b0..0000000 --- a/build/lib/src/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# This file marks the `src` directory as a Python package. \ No newline at end of file diff --git a/build/lib/src/markdown_to_word_converter.py b/build/lib/src/markdown_to_word_converter.py deleted file mode 100644 index f38ba3d..0000000 --- a/build/lib/src/markdown_to_word_converter.py +++ /dev/null @@ -1,48 +0,0 @@ -import markdown -from docx import Document -from bs4 import BeautifulSoup - -def markdown_to_word(markdown_file, word_file): - # Reading the Markdown file - with open(markdown_file, 'r', encoding='utf-8') as file: - markdown_content = file.read() - - # Converting Markdown to HTML - html_content = markdown.markdown(markdown_content) - - # Creating a new Word Document - doc = Document() - - # Converting HTML to text and add it to the Word Document - soup = BeautifulSoup(html_content, 'html.parser') - - # Adding content to the Word Document - for element in soup: - if element.name == 'h1': - doc.add_heading(element.text, level=1) - elif element.name == 'h2': - doc.add_heading(element.text, level=2) - elif element.name == 'h3': - doc.add_heading(element.text, level=3) - elif element.name == 'p': - paragraph = doc.add_paragraph() - for child in element.children: - if child.name == 'strong': - paragraph.add_run(child.text).bold = True - elif child.name == 'em': - paragraph.add_run(child.text).italic = True - else: - paragraph.add_run(child) - elif element.name == 'ul': - for li in element.find_all('li'): - doc.add_paragraph(li.text, style='List Bullet') - elif element.name == 'ol': - for li in element.find_all('li'): - doc.add_paragraph(li.text, style='List Number') - - doc.save(word_file) - -markdown_file = input("Enter the path to the Markdown file (e.g., README.md): ") -word_file = input("Enter the path for the output Word file (e.g., README.docx): ") - -markdown_to_word(markdown_file, word_file) diff --git a/dist/md2docx_python-python-0.1.0.tar.gz b/dist/md2docx_python-python-0.1.0.tar.gz new file mode 100644 index 0000000..718e0b0 Binary files /dev/null and b/dist/md2docx_python-python-0.1.0.tar.gz differ diff --git a/dist/md2docx_python-python-0.2.0.tar.gz b/dist/md2docx_python-python-0.2.0.tar.gz deleted file mode 100644 index 6915f38..0000000 Binary files a/dist/md2docx_python-python-0.2.0.tar.gz and /dev/null differ diff --git a/dist/md2docx_python_python-0.2.0-py3-none-any.whl b/dist/md2docx_python_python-0.1.0-py3-none-any.whl similarity index 52% rename from dist/md2docx_python_python-0.2.0-py3-none-any.whl rename to dist/md2docx_python_python-0.1.0-py3-none-any.whl index fc892f5..640b086 100644 Binary files a/dist/md2docx_python_python-0.2.0-py3-none-any.whl and b/dist/md2docx_python_python-0.1.0-py3-none-any.whl differ diff --git a/md2docx_python/__pycache__/__init__.cpython-39.pyc b/md2docx_python/__pycache__/__init__.cpython-39.pyc index a15ffbb..123c54b 100644 Binary files a/md2docx_python/__pycache__/__init__.cpython-39.pyc and b/md2docx_python/__pycache__/__init__.cpython-39.pyc differ