feat(editor): add Document Outline and configurable Copy TOC - #258
Open
ThisIs-Developer wants to merge 14 commits into
Open
ThisIs-Developer wants to merge 14 commits into
ThisIs-Developer wants to merge 14 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying markdownviewer with
|
| Latest commit: |
758e558
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ddbd7c37.markdownviewer.pages.dev |
| Branch Preview URL: | https://feat-document-outline.markdownviewer.pages.dev |
This branch was successfully deployed
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.
Adds a resizable Document Outline for navigating Markdown and copying a table of contents without leaving Editor, Preview, or Split mode.
The pure generator is in
src/document-toc.mjs;npm run build:toccreates the committed browser/worker bundle. Symbol-only headings use the documentedheadingfallback; raw HTML heading blocks are outside the AST-generated TOC. Existing headings named “Table of Contents” are included when they fall within the selected depth range.Validation:
npm run test:unit: 22 tests covering nesting, depth, formatting/entities, code and front matter, collisions and per-document reset, output modes, Unicode/emoji, skipped levels, wrappers, empty input, and shared preview anchors.npm run buildandgit diff --checkpassed; desktop resources regenerated.On screens up to 767px, Document Outline uses
width: calc(80% - 24px)to leave more of the document visible. This CSS-only adjustment was not tested, as requested; the validation above covers the preceding implementation.