Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
elapouya committed Jul 21, 2024
2 parents a10c3c1 + d472308 commit 83ecb60
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,16 @@ calling method `new_subdoc()` ::
tpl = DocxTemplate('templates/merge_docx_master_tpl.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.

.. _Escaping:
Expand Down

0 comments on commit 83ecb60

Please sign in to comment.