docxhelper.py¶
This module contains classes and functions for generating DocX documents from HTML used for exporting reports.
Function definitions:
-
class
apps.utils.docxhelper.HTMLToDocXParser[source]¶ Bases:
HTMLParser.HTMLParserClass for parsing HTML to Docx
-
handle_starttag(tag, attrs)[source]¶ Handles a starttag in the HTML. Converts a predefined list of tags to the corresponding DocX definitions.
- Args:
- tag: the name of the HTML tag
- attr: optional attrs coupled to the HTML tag
-
handle_endtag(tag)[source]¶ Handles a endtag in the HTML. Converts a predefined list of tags to the corresponding DocX definitions:
- Args:
- tag: the name of the HTML tag
-