A Python package to convert Markdown files to Word documents with advanced formatting
Project description
MDToWord
A Python package that converts Markdown files to Word documents with advanced formatting options.
Installation
pip install mdtoword
Usage
from mdtoword import MarkdownToDocxConverter
# Create a converter instance
converter = MarkdownToDocxConverter()
# Convert markdown to docx
converter.convert_file("input.md", "output.docx")
# Or convert markdown string directly
markdown_text = "# Hello World\nThis is a **bold** text"
converter.convert_string(markdown_text, "output.docx")
Features
- Converts Markdown to Word documents (.docx)
- Supports various Markdown formatting:
- Headers
- Bold and italic text
- Lists (ordered and unordered)
- Code blocks
- Tables
- Links
- Images
- Customizable styles and formatting
- Page numbering support
- Table of contents generation
Configuration
You can customize the document styling:
converter = MarkdownToDocxConverter(
styles={
'document': {
'font_name': 'Arial',
'font_size': 12,
'margins': {
'top': 1.0,
'bottom': 1.0,
'left': 1.0,
'right': 1.0
}
}
}
)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mdtoword-0.1.0.tar.gz
(6.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdtoword-0.1.0.tar.gz.
File metadata
- Download URL: mdtoword-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49c93770d2c7a3de06a084c44bc0fa29f66ae0baac4a9a3c4c43c9095fb7add1
|
|
| MD5 |
4f2ea42a678580ee84780d781ad7c9be
|
|
| BLAKE2b-256 |
cf434b8f68fa9da9974745d46678b5f293582bc82c37da80e38baabed52f5f77
|
File details
Details for the file mdtoword-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mdtoword-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f475b5445b5cd30d801641275ef67e4f970cf3007c8b11aedc2387663e942c9d
|
|
| MD5 |
092a046983f7cc8b1c31a29fbfde3931
|
|
| BLAKE2b-256 |
ed315918b4e4be155457d7b4d9347bf917635aec1b9950cf748b6e24d6a2b8d8
|