-
I would like to be able to put the notes associated with a part into my BOM template. I've naïvely tried adding this:
inside the sample bill of material report.html file, InvenTree produces a "Invalid filter: 'markdown'" error when I do this. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
Well, I figured it out with help from Grok I added a markdown.py file like below to the folder "/home/inventree/src/backend/InvenTree/report/templatetags"
After this the server needed to be restarted. Then I added a
Now I can get the notes in my reports, with full Markdown, and image support! |
Beta Was this translation helpful? Give feedback.
-
@zwvk there is already internal support for this - I have just made a PR to update the documentation Basically you can use the following code: {% load markdownify %}
{{ part.notes | markdownify %} |
Beta Was this translation helpful? Give feedback.
-
@SchrodingersGat This does indeed work for the Markdown, however it doesn't find images in /media/. The example I posted also solved this problem by resolving the paths. Arguably this could be better solved by having the server be aware of /media/ paths the same way it is aware of /static/ paths. Any thoughts on this? |
Beta Was this translation helpful? Give feedback.
-
I'm closing this conversation in favor of this PR #9394 |
Beta Was this translation helpful? Give feedback.
Well, I figured it out with help from Grok
I added a markdown.py file like below to the folder "/home/inventree/src/backend/InvenTree/report/templatetags"
After this the server needed to be restarted.
Then I added a
{% load markdown %}
as well as this …