python-docx-template/tests/richtext_and_if.py
Eric Lapouyade 20e30c541c v0.5.9
2018-11-18 17:56:14 +01:00

19 lines
305 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')