diff --git a/docs/docs/report/helpers.md b/docs/docs/report/helpers.md index 7883637a2f..2220e886ce 100644 --- a/docs/docs/report/helpers.md +++ b/docs/docs/report/helpers.md @@ -86,8 +86,6 @@ A number of helper functions are available for accessing database objects: The `filter_queryset` function allows for arbitrary filtering of the provided querysert. It takes a queryset and a list of filter arguments, and returns a filtered queryset. - - ::: report.templatetags.report.filter_queryset options: show_docstring_description: false @@ -513,6 +511,26 @@ A [Part Parameter](../part/parameter.md) has the following available attributes: | Units | The *units* of the parameter (e.g. "km") | | Template | A reference to a [PartParameterTemplate](../part/parameter.md#parameter-templates) | +## Rendering Markdown + +Some data fields (such as the *Notes* field available on many internal database models) support [markdown formatting](https://en.wikipedia.org/wiki/Markdown). To render markdown content in a custom report, there are template filters made available through the [django-markdownify](https://github.com/erwinmatijsen/django-markdownify) library. This library provides functionality for converting markdown content to HTML representation, allowing it to be then rendered to PDF by the InvenTree report generation pipeline. + +To render markdown content in a report, consider the following simplified example: + +```html +{% raw %} + +{% load markdownify %} + +

Part Notes

+

+ {{ part.notes | markdownify }} +

+{% endraw %} +``` + +You can read further details in the [django-markdownify documentation](https://django-markdownify.readthedocs.io/en/latest/). + ## List of tags and filters The following tags and filters are available.