Skip to content

Linking to a cell by cell ID #518

@krassowski

Description

@krassowski

JupyterLab and nbconvert allow users to link to a specific cell by it's ID by using hash fragment like #cell-id=my-cell-id where my-cell-id is an example cell ID. JupyterBook nor MyST-NB does not support it yet (executablebooks/MyST-NB#310) although a pull request is open (executablebooks/MyST-NB#519).

Given that there is a new notebook parser in this repository, I wonder if it could facilitate implementation of such a feature.

Proposal

Adopt the same hash fragment scheme for HTML output as other projects.

Additional notes

It appears that support for a kind of cell IDs was implemented in #361 but using a different scheme: nb-cell-0-code (and nb-cell-0-output for output). It appears that cell index was used there instead of cell ID which would not be a stable identifier when user moves cells around. For that I would propose using #cell-index=0 format where 0 represents first cell (whether 0- or 1-based). Also, please note that in Jupyter notebooks any single cell may have multiple outputs, so cell ID cannot identify output (but barely a list of outputs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions