Repository navigation
MRG, ENH: Allow adding custom JavaScript to Report - #9037
Merged
Merged
Conversation
This will enable users to enrich their reports with custom JS. We already allow for custom CSS, so adding custom JS is a kind of logical next step.
jasmainak
reviewed
Mar 13, 2021
| ----- | ||
| .. versionadded:: 0.23 | ||
| """ | ||
| script = f'\n<script type="text/javascript">\n{js}\n</script>' |
Member
There was a problem hiding this comment.
I can't quite pinpoint the issue but this feels a bit hacky. I guess it might still work but see issues like this. Ideally you'd want the report.html to be some sort of OrderedDict instead of list so that you can access the existing <script> elements and append it there rather than make a new element in the list.
Not pushing for it, but just a mild suggestion if someone is bored on a rainy afternoon :)
Member
Author
There was a problem hiding this comment.
I like your suggestion, care to open an issue as a reminder? 🙂
Member
|
Thanks @hoechenberger |
larsoner
added a commit
to vpeterson/mne-python
that referenced
this pull request
Mar 15, 2021
* upstream/main: (135 commits) DOC: use bibtex in plot_source_power_spectrum_opm.py (mne-tools#8906) (mne-tools#9050) DOC: use bibtex in plot_sleep (mne-tools#9044) FIX: fix sideways helmet plot (mne-tools#9059) FIX: bibtex mne-tools#8933 (mne-tools#9047) Fix bibtex citation issue mne-tools#8929. (mne-tools#9051) bibtex fix plot_time_frequency_global_field_power (mne-tools#9052) Fixed bibtex references in plot_background_statistics (mne-tools#9046) Bibtex raw py (mne-tools#9048) DOC update footcite maxwell.py (mne-tools#9043) update footcite [skip github] [skip azp] (mne-tools#9054) Adding bibtex in plot_otp (mne-tools#9049) fix bibtex plot_evoked_whitening (mne-tools#9042) MAINT: Link earlier [skip github] [skip azp] (mne-tools#9041) DOC: convert references in plot_parcellation to use footcite (mne-tools#9032) MAINT: Fix circle (mne-tools#9039) ENH: Allow adding custom JavaScript to Report (mne-tools#9037) MRG, DOC: Bump theme version (mne-tools#9036) MAINT: Simplify expression (followup to mne-tools#9015) (mne-tools#9035) MRG, MAINT: Cleaner split, fewer skips in _brain tests (mne-tools#9029) MRG, ENH: viz.plot_drop_log() gains special-handling for subject=None (mne-tools#9015) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will enable users to enrich their reports with custom JS.
We already allow for custom CSS and HTML, so adding custom JS is a logical next step.