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.
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
ToC block: re-enable + use static markup and only support core Heading and Page Break blocks #29739
ToC block: re-enable + use static markup and only support core Heading and Page Break blocks #29739
Changes from all commits
c53df83
afadefa
2796c70
f564667
4b7bbc6
0ff623d
8ba556a
dc2730a
8f7db2d
4282578
3080087
803eddc
6a724bf
1eb8d22
e7e866a
6221796
38bb612
a8a1cbd
6d9c653
21adec5
fa6cc7d
2ed8a4a
c439c5b
425109f
327338f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what value this brings!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think of it as serving a similar function to the transforms for the Navigation Link that let you convert a Page Link to a Category Link (and etc.)... obviously, the block just gets replaced with little to nothing kept from the original block, but the purpose is to make replacing the block easier. If you convert a Table of Contents to a static list, but then want to go back later, a transform is more convenient than deleting the List and inserting a ToC. Or at least that's the idea.
(In the future, some simple stuff like background/text color from the List could be transferred over, but I decided against adding those to the ToC right now to avoid making this PR even bigger.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be cool to have something basic here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of how the block updates itself, any dummy heading data put in here would be quickly overwritten (I think). Perhaps if there was a way to detect if the block was being rendered in "example-preview mode" or whatever, this could be worked around. It would be kinda hacky to do something like that, though.
A somewhat less weird solution would be to add the ability for examples to include "context" blocks that aren't shown in the preview, but are still part of the simulated document the previewed block is a part of. No clue what the schema changes necessary would be, nor if such a thing is even worth considering. It seems perhaps a bit too convoluted.