diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-12-14 17:33:13 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-12-14 17:33:13 +0000 |
| commit | 85cc3f93c01312a907fd017d34bc2e5542cac670 (patch) | |
| tree | 6319244994842c813c73005de7cb971fbfe99061 /mammoth/__init__.py | |
| parent | f5595b78f59d3f3a04c4e83702114dc2704f808a (diff) | |
Plumbing to get full stack working
Diffstat (limited to 'mammoth/__init__.py')
| -rw-r--r-- | mammoth/__init__.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/mammoth/__init__.py b/mammoth/__init__.py index 92278f7..3c212ac 100644 --- a/mammoth/__init__.py +++ b/mammoth/__init__.py @@ -1,6 +1,17 @@ from .results import Result -from . import docx, conversion +from . import docx, conversion, style_reader def convert_to_html(fileobj): - return docx.read(fileobj).bind(conversion.convert_document_element_to_html) + return docx.read(fileobj).bind(lambda document: + conversion.convert_document_element_to_html(document, styles=_create_default_styles()) + ) + + +def _create_default_styles(): + lines = filter(None, map(lambda line: line.strip(), _default_styles.split("\n"))) + return map(style_reader.read_style, lines) + +_default_styles = """ +p:unordered-list(1) => ul > li:fresh +""" |
