Biorix@lemmy.worldOPtoSelfhosted@lemmy.world•Generate document from templates and databaseEnglish
1·
6 months agoI’m using docxtpl which uses jinja placeholder to set values.
For your solution, you should use jinja It’s used for whatever text files you want, htlm, txt, latex, MD, etc. And you can put code into the document (see my examples document in the post)
Yes, that why I recommand jinja. as it can be used in OpenXML as well as latex or anything in plain text.
Let’s say you want to place a table that corresponds to a certain pattern, you could add it to your file conditionally. In your Word document, you could add that :
{% for job in jobs %} {% if job.style == 1 %} {{ job.name }} | {{ job.date}} | ... {% else %} - {{ job.name }} - {{ job.date}} - ... {% endif %} {% endfor %}
I don’t know .NET but you can probably call a Jinja tools
Also for the resume, you might be insterested in Rx Resume