render.py jinja templates components overview

Documentation

Overview

Each render.py jinja template is broken down into components. Components are used to encourage reuse between deliverables. Most templates use at least a few key components, such as:

  • header
  • mailing-info
  • policy-term-information

There are also groups of templates, such as Billing templates, which use the following components:

  • stub
  • billing-summary
  • billing-schedule

Others, like Policy Application, Quote Summary, and Declaration use the following components:

  • policy-coverages  
  • rating-information

Most components receive a default argument. This is because many components in the same template use the same set of data, so to avoid sending each piece of data as an argument, or to avoid requesting the same piece of data more than once, we group this data in a default dictionary, which we then pass over to multiple components.

Refer to the render.py jinja templates components reference for information on available components and their arguments.

Folder structure

  1. Client deliverables are saved in the clients directory.
  2. The clients directory includes other directories specific to each client.
  3. The main directory in a client-specific directory is templates. It includes three other directories: componentslayoutsobjects.
  4. The components dir is where reusable components are saved, which are then imported into deliverables.
  5. The objects dir is where reusable asset components are saved.
  6. The layouts dir is where the main files for each deliverable are saved. These files include code specific to each deliverable, while also importing components and objects.

Components used in deliverables

Table 1 outlines the components names and the deliverables they appear in.

Table 1: Components use table.