akvo.rsr.views.py_reports.docx_utils module

Akvo RSR is covered by the GNU Affero General Public License.

See more details in the license.txt file located at the root folder of the Akvo RSR module. For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.

class akvo.rsr.views.py_reports.docx_utils.DivTagHandler[source]

Bases: object

handle_tail(container, element)[source]
handle_text(container, element)[source]
class akvo.rsr.views.py_reports.docx_utils.EmphasisTagHandler[source]

Bases: object

<em> Creates an italic text run inside the paragraph container. Appends remainder of text as a additional run

handle_tail(container, element)[source]
handle_text(container, element)[source]
class akvo.rsr.views.py_reports.docx_utils.HTMLDocxBuilder(container)[source]

Bases: object

feed(html)[source]
traverse(container, element)[source]
class akvo.rsr.views.py_reports.docx_utils.HeadingTagHandler(level)[source]

Bases: object

<h1>…<h6> creates heading element inside a docx container element.

handle_tail(container, element)[source]
handle_text(container, element)[source]
class akvo.rsr.views.py_reports.docx_utils.LineBreakTagHandler[source]

Bases: object

<br> Creates a break item inside the given container.

handle_tail(container, element)[source]
handle_text(container, element)[source]
class akvo.rsr.views.py_reports.docx_utils.ListItemTagHandler[source]

Bases: object

<li> Create a list item element inside a docx container. Style it according to its parents list type.

handle_tail(container, element)[source]
handle_text(container, element)[source]
class akvo.rsr.views.py_reports.docx_utils.ParagraphTagHandler[source]

Bases: object

<p> creates a paragraph element inside a docx container element.

handle_tail(container, element)[source]
handle_text(container, element)[source]
class akvo.rsr.views.py_reports.docx_utils.StrongTagHandler[source]

Bases: object

<strong> Creates a bold text run inside the paragraph container. Appends remainder of text as a additional run

handle_tail(container, element)[source]
handle_text(container, element)[source]

places a hyperlink within a paragraph object

akvo.rsr.views.py_reports.docx_utils.change_orientation(document)[source]

change document orientation from portrait to landscape and vice versa

akvo.rsr.views.py_reports.docx_utils.get_current_paragraph(container)[source]
akvo.rsr.views.py_reports.docx_utils.get_new_paragraph(container)[source]
akvo.rsr.views.py_reports.docx_utils.get_tag_handler(tag)[source]
akvo.rsr.views.py_reports.docx_utils.load_external_image(src)[source]
akvo.rsr.views.py_reports.docx_utils.load_image(src)[source]

load image from base64 data or url

akvo.rsr.views.py_reports.docx_utils.load_inline_image(src)[source]
akvo.rsr.views.py_reports.docx_utils.make_image(data)[source]
akvo.rsr.views.py_reports.docx_utils.markdown_to_docx(container, text)[source]

insert markdown text to docx document

akvo.rsr.views.py_reports.docx_utils.set_repeat_table_header(row)[source]

set repeat table row on every page

akvo.rsr.views.py_reports.docx_utils.trim_whitespaces(text)[source]

replaces multiple whitespaces and line breaks by a single whitespace