Update index.rst
Updating 'sub-document' documentation to make explicit what was already implicit.
This commit is contained in:
parent
d322120d2a
commit
0642badebc
@ -288,6 +288,16 @@ calling method `new_subdoc()` ::
|
|||||||
tpl = DocxTemplate('templates/merge_docx_master_tpl.docx')
|
tpl = DocxTemplate('templates/merge_docx_master_tpl.docx')
|
||||||
sd = tpl.new_subdoc('templates/merge_docx_subdoc.docx')
|
sd = tpl.new_subdoc('templates/merge_docx_subdoc.docx')
|
||||||
|
|
||||||
|
context = {
|
||||||
|
'mysubdoc': sd,
|
||||||
|
}
|
||||||
|
|
||||||
|
tpl.render(context)
|
||||||
|
tpl.save('output/merge_docx.docx')
|
||||||
|
|
||||||
|
In the above example, the content of 'templates/merge_docx_subdoc.docx' will be inserted into the parent document in place of the declared
|
||||||
|
variable `{{ mysubdoc }}`.
|
||||||
|
|
||||||
See `tests/merge_docx.py` for full code.
|
See `tests/merge_docx.py` for full code.
|
||||||
|
|
||||||
.. _Escaping:
|
.. _Escaping:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user