summaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
authorJose Alonso Cardenas Marquez <acm@FreeBSD.org>2023-04-30 01:47:38 -0500
committerJose Alonso Cardenas Marquez <acm@FreeBSD.org>2023-04-30 01:49:19 -0500
commit94270243dba9ce772b72772078e586e639c5f21f (patch)
tree31fa79ae2bcef471d2f3f150469e2220b6cf2367 /textproc
parentcad/surelog: Remove Java runtime dependency (diff)
textproc/py-docxtpl: New port: Python docx template engine
python-docx-template has been created because python-docx is powerful for creating documents but not for modifying them. The idea is to begin to create an example of the document you want to generate with microsoft word, it can be as complex as you want: pictures, index tables, footer, header, variables, anything you can do with word. Then, as you are still editing the document with microsoft word, you insert jinja2-like tags directly in the document. You save the document as a .docx file (xml format). it will be your .docx template file. Now you can use python-docx-template to generate as many word documents you want from this .docx template and context variables you will associate.
Diffstat (limited to 'textproc')
-rw-r--r--textproc/Makefile1
-rw-r--r--textproc/py-docxtpl/Makefile23
-rw-r--r--textproc/py-docxtpl/distinfo3
-rw-r--r--textproc/py-docxtpl/pkg-descr12
4 files changed, 39 insertions, 0 deletions
diff --git a/textproc/Makefile b/textproc/Makefile
index defa0a63090a..e6eb7393de7e 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -1322,6 +1322,7 @@
SUBDIR += py-docutils
SUBDIR += py-docx2txt
SUBDIR += py-docxcompose
+ SUBDIR += py-docxtpl
SUBDIR += py-dominate
SUBDIR += py-dparse
SUBDIR += py-duecredit
diff --git a/textproc/py-docxtpl/Makefile b/textproc/py-docxtpl/Makefile
new file mode 100644
index 000000000000..7f4d07044f09
--- /dev/null
+++ b/textproc/py-docxtpl/Makefile
@@ -0,0 +1,23 @@
+PORTNAME= docxtpl
+PORTVERSION= 0.16.6
+CATEGORIES= textproc python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= acm@FreeBSD.org
+COMMENT= Python docx template engine
+WWW= https://github.com/elapouya/python-docx-template
+
+LICENSE= LGPL21
+
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}lxml>=3.3.4:devel/py-lxml@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}python-docx>0:textproc/py-python-docx@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR}
+
+USES= python:3.6+
+USE_PYTHON= autoplist distutils
+
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/textproc/py-docxtpl/distinfo b/textproc/py-docxtpl/distinfo
new file mode 100644
index 000000000000..1f95fea2da67
--- /dev/null
+++ b/textproc/py-docxtpl/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1682829200
+SHA256 (docxtpl-0.16.6.tar.gz) = c5938dd891bf13958dd5dfd513816c688999060f037c316756a005cdebf9a322
+SIZE (docxtpl-0.16.6.tar.gz) = 29991
diff --git a/textproc/py-docxtpl/pkg-descr b/textproc/py-docxtpl/pkg-descr
new file mode 100644
index 000000000000..bf628132670f
--- /dev/null
+++ b/textproc/py-docxtpl/pkg-descr
@@ -0,0 +1,12 @@
+python-docx-template has been created because python-docx is powerful for
+creating documents but not for modifying them.
+
+The idea is to begin to create an example of the document you want to generate
+with microsoft word, it can be as complex as you want: pictures, index tables,
+footer, header, variables, anything you can do with word. Then, as you are
+still editing the document with microsoft word, you insert jinja2-like tags
+directly in the document. You save the document as a .docx file (xml format).
+it will be your .docx template file.
+
+Now you can use python-docx-template to generate as many word documents you
+want from this .docx template and context variables you will associate.