python-docx-template/tests/richtext_and_if.py
2024-07-21 16:10:44 +02:00

17 lines
301 B
Python

# -*- coding: utf-8 -*-
"""
Created : 2015-03-26
@author: Eric Lapouyade
"""
from docxtpl import DocxTemplate, RichText
tpl = DocxTemplate("templates/richtext_and_if_tpl.docx")
context = {"foobar": RichText("Foobar!", color="ff0000")}
tpl.render(context)
tpl.save("output/richtext_and_if.docx")