How to use the docxtpl.Subdoc function in docxtpl

To help you get started, we’ve selected a few docxtpl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jhpyle / docassemble / docassemble_base / docassemble / base / core.py View on Github external
def show(self, width=None):
        """Inserts markup that displays each element in the list as an image.
        Takes an optional keyword argument width.

        """
        output = ''
        for element in sorted(self.elements):
            if element.ok:
                new_image = element.show(width=width)
                if isinstance(new_image, InlineImage) or isinstance(new_image, Subdoc):
                    return new_image
                output += new_image
        return output
    def path(self):
github jhpyle / docassemble / docassemble_base / docassemble / base / core.py View on Github external
def show(self, **kwargs):
        """Inserts markup that displays each part of the file collection as an
        image or link.
        """
        the_files = [getattr(self, ext).show(**kwargs) for ext in self._extension_list() if hasattr(self, ext)]
        for the_file in the_files:
            if isinstance(the_file, InlineImage) or isinstance(the_file, Subdoc):
                return the_file
        return u' '.join(the_files)
    def __str__(self):

docxtpl

Python docx template engine

LGPL-2.1
Latest version published 4 months ago

Package Health Score

74 / 100
Full package analysis