-
-
Notifications
You must be signed in to change notification settings - Fork 450
add all Headings to every List-Item #2330
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
base: master
Are you sure you want to change the base?
Conversation
added test-file to demonstrate the proper Heading Function
Nicely done. I'd really like to have this merged. |
Noob question, would this allow us to build queries with a placeholder for the query's heading(s)? If so, one use case I can see is the ability to write a query with such a placeholder and then move/duplicate it in a board (from the Kanban plugin) and have the query automatically adjust in function of the column it's in. In addition, renaming a link in the heading would adjust the links in the properties without breaking the query. That would be a nice addition! (But again, noob question!) |
This could already be possible now using these
|
Not as far as I know, there seems to be no way for a query to refer to its own heading or task at the moment, only its own file (with "this."). |
It surely is possibly for both task and list item to refer to their section link, and access the closest heading of the given item. This PR seems to be more on actually having the full list of headings it's under. Let's say you got an outline like H2 A | H3 AA | H2 B | H3 BB | a task instead of only seeing the H3 BB then get the full hierarchy of H2 B and H3 BB if that make sense. |
@charle36 This is the...
You have to enable JavaScript Queries and possibly inline JavaScript Queries then you can access the containing header: My pull-request enables to not only retrieve this, but also all containing headers starting with the immediate header up to the top-Level Header. |
I've still not really looked into the code, but this doesn't interfere with existing logic related to the |
No, everything stays as before, I have just added a new List, so it is backwards compatible. @holroy |
I'm going to defer this until a 0.6 release, as it might interfere/relate to some other changes I'm planning for that release. I'm not sure if we should impose this information on all queries, or rather just when the users specifically asks for it. Leaning towards the latter, and hence this deferral. |
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.
It prepares to used Headings instead of nested Lists to manage lists or data-key-value Pairs.
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.