add all Headings to every List-Item #2330
Open
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.
In Response to #2290 and #2325 I have prepared this minimal Prototype.
@blacksmithgu Please consider this as a basis for discussion, I am not pushing for this exact Design,
but including the Heading Hierarchy would increase the Expressivity very much.
This adds a new List to every
ListItem
containing the path of containing Headings in strictly monotonously decreasing Levels.This forms a kind of
xPath
orjsonPath
to each List Itemand thus helps to organize multiple Lists within the same Markdown Document in
markdown.ts
:I am unsure on how to handle the
serialize(cache: ListSerializationCache): SListItem
-Operation in PageMetadada.tx (line 260)It does not seem to support the Obsidian
HeadingCache
Class, so I am converting it to a List of Heading-Stringswith proper number of
#
s to indicate the correct Heading Levelheadings: this.headings.map(h => "#".repeat(h.level) + " " + h.heading),
Best Regards and thank you for this powerful component. I am aware that there are many factors to consider for the evolution of the DataView.