diff --git a/Pipfile.lock b/Pipfile.lock index 1613110..90501d1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -234,11 +234,12 @@ }, "setuptools": { "hashes": [ - "sha256:6c1fccdac05a97e598fb0ae3bbed5904ccb317337a51139dcd51453611bbb987", - "sha256:c636ac361bc47580504644275c9ad802c50415c7522212252c033bd15f301f32" + "sha256:54faa7f2e8d2d11bcd2c07bed282eef1046b5c080d1c32add737d7b5817b1ad4", + "sha256:f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0" ], + "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==69.5.1" + "version": "==70.0.0" }, "six": { "hashes": [ diff --git a/docs/index.rst b/docs/index.rst index e54c757..517c3e8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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: