Repository navigation
feat: add document outline sidebar - #162
Merged
Merged
Conversation
Browse the headings of the current Markdown file as an indented table of contents in the sidebar, opened from a new toolbar button or Ctrl/Cmd+Shift+O. Headings come from the preview's own markdown-it parse, so code-block '#' lines are skipped and setext headings count. Clicking a heading moves the editor caret there with the heading at the top of the view; the preview follows via scroll sync, or scrolls on its own in preview-only mode. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a table of contents for Markdown files, so headings can be browsed and jumped to.
Ctrl/⌘+Shift+O. The same button or shortcut, or ✕, returns to Recents.markdownHeadings()insrc/lib/markdown.tsuses the preview's own markdown-it parse, so it lists exactly what the preview renders. A#inside a code block is skipped, setext headings are included, and inline formatting is reduced to plain text.revealLine(line, "start"), which puts the caret on the heading with the heading at the top of the editor. The preview follows via the existing scroll sync in split view. In preview-only mode the preview scrolls directly withscrollToSyncLine.Not included
Test plan
npm run lint,npm test(287 passed, 3 new),npm run buildtauri dev: toggle via button and shortcut; jumping works in editor, split and preview modes; code-block#is ignored; setext heading is listed; live updates while typing🤖 Generated with Claude Code