pqzx / html2docx

Convert html to docx
MIT License
69 stars 49 forks source link

Implement default paragraph style #24

Closed ghjklw closed 2 years ago

ghjklw commented 2 years ago

Inspired by #16

Allow paragraph style to be changed by setting paragraph_style attribute on the HtmlToDocx instance.

The default paragraph style is set to None to ensure the behavior doesn't change between versions.

Available default styles can be found here: https://python-docx.readthedocs.io/en/latest/user/styles-understanding.html#paragraph-styles-in-default-template

Example usage:

parser = HtmlToDocx()
parser.paragraph_style = 'Quote'
pqzx commented 2 years ago

Awesome, thanks for adding this enhancement 😄