I can easily modify text of paragraph marked with %main% by using docx with following code.
'''
for paragraph in document.paragraphs:
if '%main%' in paragraph.text:
paragraph.text = 'new text'
'''
However, I would like to inject another piece of formatted docx into this place. Ideally with multiple paragraphs, tables, images, headers and other styles.