python-docx-template icon indicating copy to clipboard operation
python-docx-template copied to clipboard

Create richtext from commandline execution

Open effem opened this issue 1 year ago • 0 comments

Describe your problem

I'm calling docxtpl from another programm (as described here https://docxtpl.readthedocs.io/en/latest/#command-line-execution) and try to pass some variables that contain newlines but defining the variable in the word template is not sufficient to turn it into rich text.

Provide a test case

Example JSON:

{
  "text": "This is a text\n\n with newlines!"
}

Example code in the docx: grafik

Is there a possibility to create rich text without creating a rich text object in python and passing it as context?

effem avatar Mar 15 '24 14:03 effem