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

Side-by-side contextual split, where markdown cells are linked/anchored to lines of a code in a code-cell on the side. #7276

Open
flacle opened this issue Feb 26, 2024 · 0 comments

Comments

@flacle
Copy link

flacle commented Feb 26, 2024

Problem

Notebooks tend to get long. Screens are usually oriented in landscape mode. We often have markdown cells before code cells to explain what the code below it is doing. This makes the notebook longer.

Proposed Solution

If we can link lines in a markdown cell to pin text content to code in a separate cell shown on the side, this would reduce the notebook height. Code and contextual text/comments are now viewed side-by-side. This feature could use special symbols that are picked up in the side-by-side contextual view. These special symbols serve two purposes, (1) to not break existing functionality, and (2) to instruct the renderer which line of code is referred to from the markdown so that as we scroll in the markdown box, the "anchored" line of code also scrolls together into view. This synchronized scrolling happens when we either scroll in the code cell on the left or in the markdown cell on the right. Scrolling in the code cell, scrolls the markdown cell to the anchored/pinned text and vice versa.

Additional context

The UI idea is very similar to this comparison view of Bitbucket for code revisions, see: https://youtu.be/9K7L0QgcrO0?t=53. The split view would be an optional feature, with the anchors being optional as well. The anchoring symbol idea is similar to HTML's href anchors where we have a label anchor and an ahref that points to that label (e.g. in Python # a:somelabel and in Markdown $=somelabel).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants