fix(summary)!: fix norg links, use first heading as title if found #928
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.
Fixes and improvements following on from #927 . I noticed a bug in the link destinations, so I went ahead and did some of what @vhyrro suggested.
{:index.norg:}[My Index]
=>{:index:}[My Index]
) - lol, funny I didn't notice this last time.{:index:}
rather than{:/Users/me/notes/work/index:}
. (It assumes you're in the workspace root, which seems OK?)metadata.title
, it queries TS to find the first heading text. The TS query allows heading1 or heading2, and it checks matches up to 20 lines into the doc (e.g. if there's metadata but no title). IDK if this is right or if the query could be improved, but it seems like an OK starting point.Index
rather thanIndex.norg
.metadata
todefault
because now it uses a mixture of metadata and headings/filenames now.My summary looks like this now (as before, I only have scraps of document metadata, and some files are completely empty):