Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] add footer to all masker reports #4307

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/changes/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Enhancements

- :bdg-primary:`Doc` Add example to demonstrate the use of the new ``copy_header_from`` parameter in :func:`nilearn.image.math_img` (:gh:`4392` by `Himanshu Aggarwal`_).

- :bdg-dark:`Code` Add footer to masker reports (:gh:`4307` by `Rémi Gau`_).

Changes
-------

Expand Down
15 changes: 15 additions & 0 deletions nilearn/reporting/data/html/report_head_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,19 @@
/>
$body
</body>

<footer>
<div class="footer">
<address>
<p style="text-align: center">
Built using
<a href="https://nilearn.github.io">Nilearn (version=$version)</a>.
Source code on
<a href="https://github.com/nilearn/nilearn">GitHub</a>. File bugs &
feature requests
<a href="https://github.com/nilearn/nilearn/issues">here</a>.
</p>
</address>
</div>
</footer>
</html>
5 changes: 4 additions & 1 deletion nilearn/reporting/html_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path
from string import Template

from nilearn._version import __version__

Check warning on line 8 in nilearn/reporting/html_report.py

View check run for this annotation

Codecov / codecov/patch

nilearn/reporting/html_report.py#L8

Added line #L8 was not covered by tests
from nilearn.externals import tempita
from nilearn.maskers import NiftiSpheresMasker
from nilearn.plotting.html_document import HTMLDocument
Expand Down Expand Up @@ -168,7 +169,9 @@
head_css = head_css_file.read()

return HTMLReport(
body=body, head_tpl=head_tpl, head_values={"head_css": head_css}
body=body,
head_tpl=head_tpl,
head_values={"head_css": head_css, "version": __version__},
)


Expand Down