Skip to content

ENH: HTML anchor support in reports #11794

Closed

Description

@larsoner

When linking to a report like:

It would be nice if you could link to a specific section of the report using an anchor. Similarly, clicking on a button on the left should change the URL to reflect the anchor. In principle it seems like this should be doable using the section titles themselves, maybe with an enumeration (-1, etc.) if there are duplicates beyond the first one (since there is a replace=False option for duplicated titles).

Activity

  1. added this to the 1.5 milestone on Jul 11, 2023
  2. hoechenberger commented on Jul 13, 2023

    @hoechenberger
    Member

    We already have anchors and I regularly use them to link to specific sections, like so:

    https://mne.tools/mne-bids-pipeline/1.4/examples/ERP_CORE/sub-average_ses-P3_task-P3_report.html#global-19

    I right-click on the respective TOC entry, select the "open in new tab" action, and copy the generated URL.

    But yes, we should update the URL displayed in the browser's location bar upon clicking on TOC entries. I believe there's setting in mkdocs-material for that.

  3. larsoner commented on Jul 13, 2023

    @larsoner
    MemberAuthor

    But yes, we should update the URL displayed in the browser's location bar upon clicking on TOC entries. I believe there's setting in mkdocs-material for that.

    I think this shouldn't be affected by any mkdocs-material setting -- it should be part of mne.Report directly and thus separate from any mkdocs-related stuff. (Note this issue is for mne-python not mne-bids-pipeline...)

    Also ideally as above we should make the anchors use the titles (with enumeration beyond the first one if there are dups) rather than global19 which is not an informative anchor name...

  4. hoechenberger commented on Jul 13, 2023

    @hoechenberger
    Member

    Right, of course! I got a little confused there.

  5. modified the milestones: 1.5, 1.6 on Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions