-
Notifications
You must be signed in to change notification settings - Fork 326
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
Navigate via Headings overview #2840
Comments
Note that PPR isn't involved here, in that the headings-outline would be used to scroll the editor pane, not the preview pane. A brute force but simple approach would be to refresh the overview entirely on every keystroke. There are smarter approaches (e.g. only update the headings in the region of the edited line number) that can be used if the brute-simple approach turns out to be impacting on editing performance. |
There is a risk of some false-positives sneaking into the Headings Outline. Consider this brew source: ## heading two
blah blah text
<!--
### heading three
yada yadas
-->
### heading four
lorem ipsum A Headings Outline which is built via I would consider this to be an acceptable false-positive. |
Without thinking about it too hard... We could build this into the divider bar, which already has the functions to move the editor and the rendered brew. This would then allow us to parse the |
This seems like an idea feature if/when a pop-out editor is available. I think it might use up too much screen real estate. Maybe a roll-out/mouseover ? |
if #3150 got fixed(literally one line) we could insert a fixed positioning div and put in there any heading as we do in the ToC as links. Very easy. |
Nevermind my last comment, we can insert the element inside the frame besides the brewRenderer component, fill it with a list of headers obtained from parsing the virtual DOM, and use that. We could go a step further and give a ref to every heading. Now, in #3506, i have some functions to find what page any element is in via its id, and scroll to it. We could use this to scroll to the element, without the need to scroll the editor too. I'd just need to have that merged and the list of headings when rendering. |
I wanted this type of sidebar for the share view of my PDF. Users have complained that its fairly annoying to have to scroll back up to get to the table of contents and find what they want and then scroll down. I was trying to figure out how to make it so that my Table of Contents page was just fixed the side of the page when a user was viewing the page and then listing all of the links going down instead of being in columns... However, it appears a fixed div inside the container just sticks at the top when a user scrolls down. It would be nice to basically have a special div that gets rendered on the share link that takes all |
I thought This means it would need to be emitted by the brew render engine, not as part of the rendered brew. So, as a sibling element to |
As per one of my lasts comments, position sticky will not work inside the brewRenderer element, because we have (position sticky toggles the element between static and fixed positioning) As i also said the fix for this is for the element to be a sibling of the brewRenderer element. |
Apologies, it wasn't clear whether you used Yes, there are two requirements:
|
I don't really see why is 2. important, we can pass the scrolling info via props or context state, we will be scrolling via js anyway, please clarify if i'm missing something important here. |
#3262 assists here. |
Your idea:
In Overleaf and other editors, the editor maintains a nested list of headings in a sidebar. This overview of headings can be used to navigate the editor pane. The headings outline can be collapsed or expanded as desired. The headings overview could also be optionally collapsed/hidden.
Clicking a heading in the heading-overview would scroll the editor pane (not the preview pane).
This could make navigating a large brew much easier.
The text was updated successfully, but these errors were encountered: