{% ... %}
{% if some_variable %}
{{ ... }}
{{ client.name }}
... |filter ...
{{ client.name|title }}
{{ client.name }}
or {% if ... %}
) – unless otherwise noted.capitalize(string)
lower(string)
replace(string, old, new)
title(string)
trim(value, chars=None)
unique(value, case_sensitive=False)
upper(string)
String
] Full date the report was generated (localized based on server settings)Dict
] All information about the projectDict
] All information about the project's clientDict
] All team information (individuals assigned to the project)Dict
] All objectives informationDict
] All project targetsDict
] All project scope listsDict
] All project infrastructure informationDict
] All information about a project's findingsDict
] All information about the selected DOCX templateDict
] All information about the selected PPTX templateDict
] All information about your company (configured in the admin panel)String
] The report's title set in GhostwriterBool
] Value indicating if the report has been marked as completeBool
] Value indicating if the report has been marked as archivedBool
] Value indicating if the report has been marked as deliveredDict
] Various sums and counts of different project-related values (e.g., total findings, objectives, and targets)en-us
, so the default date format is M d, Y (e.g., June 22, 2021).project
key has separate values for the day, month, and year the project started and ended. Use these to assemble your own date or date range formats if you need to represent a date differently or only want part of the date.short_name
value set, Ghostwriter will replace references to client.short_name
with the client's full name.{{ finding.description }}
in the template. It's unlikely you would want that.striptags
filter can help, but that removes all HTML without preserving new lines. Ghostwriter's custom strip_html
filter will strip the tags and preserve newlines, but the output will still be all plaintext. You will have to re-apply character and paragraph styles, font changes, and other options. Your evidence files will also appear as their text placeholders._rt
(for rich text) to the attribute's name and use the p
tag (see Ghostwriter Tags below). The above example becomes:severity_rt
attribute. You don't style this text in the WYSIWYG editor. Ghostwriter creates a rich text version of your severity category that is colored using your configured color code for that category.severity_rt
attribute only styles the color of the text run, so you can apply a paragraph style to it directly in your Word template. Use it with the r
tag (for a run) like so:{{p findings_subdoc }}
python-docx-template
, do not use {%p
, {%tr
, {%tc
or {%r
twice in the same paragraph, row, column or run.{% cellbg color_var %}
color_var
is a hex value without the #{% colspan some_number %}
some_number
of columnsfilter_severity(list)
findings
variable and filters it with a list of severities{% for x in findings|filter_severity(["High", "Medium"]) %}
strip_html
compromised
targets
value and filters it to only include hosts marked as compromised.filter_type(list)
findings
variable and filters it with a list of categories{% for x in findings|filter_type(["Network"]) %}
add_days(date,
current_format, new_format)
Feb. 1, 2022 | add_days("%b. %d, %Y", -10)
format_datetime
(
date, format_str, days)
Feb. 1, 2022 | format_datetime("%b. %d, %Y", "%B %-d, %Y")
{{p VARIABLE }}
.That variable is automatically replaced with the contents of the subdocument.jinja2.ext.debug
extension to make it easier for you to debug a template. Place a {% debug %}
tag somewhere in your template.