Skip to content

MRG, ENH: Allow adding custom JavaScript to Report - #9037

Merged
larsoner merged 1 commit into
mne-tools:mainfrom
hoechenberger:custom-js
Mar 14, 2021
Merged

larsoner merged 1 commit into
mne-tools:mainfrom
hoechenberger:custom-js

Conversation

@hoechenberger

@hoechenberger hoechenberger commented Mar 13, 2021 •

Copy link
Copy Markdown
Member

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.

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.
@hoechenberger hoechenberger changed the title ENH: Allow adding custom JavaScript to Report MRG, ENH: Allow adding custom JavaScript to Report Mar 13, 2021
Comment thread mne/report.py
-----
.. versionadded:: 0.23
"""
script = f'\n<script type="text/javascript">\n{js}\n</script>'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your suggestion, care to open an issue as a reminder? 🙂

@larsoner
larsoner merged commit 2114c06 into mne-tools:main Mar 14, 2021
@larsoner

Copy link
Copy Markdown
Member

Thanks @hoechenberger

@hoechenberger
hoechenberger deleted the custom-js branch March 14, 2021 18:55
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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants