pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

customize jina template

Open vbpatel73 opened this issue 1 year ago • 5 comments

Hi I have seen index.jinja2 which i can modify and see results in report but I want to create new jinja2 template which i want to use same way like css file. how i can do that?

vbpatel73 avatar Sep 07 '23 15:09 vbpatel73

That's not currently possible but is a feature that has been discussed.

Can you share more detail about your use case? It will help us determine a way forward.

BeyondEvil avatar Sep 09 '23 08:09 BeyondEvil

Hello,

For me the case is simple, but still it would be good to have that custom templates in the future. I would like to instead of: <p>Report generated on {{ date }} at {{ time }} by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a>

display some other content. Using CSS I can not display that at all but in my case it's some dynamic info. I would like to add.

marcinosb avatar Nov 28 '23 11:11 marcinosb

Maybe a first version of this support is to simply allow a custom jinja-template, and then leave it up to the user to figure out how to make it work. 🤔

Thoughts @jeffwright13 ?

BeyondEvil avatar Dec 02 '23 13:12 BeyondEvil

i woud recommend having a default template that can be inherited from while replacing blocks for customization to prevent bitrot copies of the full template

RonnyPfannschmidt avatar Dec 02 '23 13:12 RonnyPfannschmidt

I didn't know jinja supported inherit-type functionality.

BeyondEvil avatar Dec 02 '23 14:12 BeyondEvil