Open mdbraber opened 6 months ago
For those who want a quick solution, update data-import/markdown-file.ts
around line 67 and include
let title: string | undefined;
if (metadata.headings && metadata.headings.length > 0) {
title = metadata.headings[0].heading;
}
and include title
in the returned PageMetadata
@mdbraber do you want to make your change into a Pull-Request?
I would propose to even add the full HeadingCache[] to the Page-Info, so we can query it for any number of problems.
I think it is more value to provide the full Heading Info as demonstrated here: https://github.com/blacksmithgu/obsidian-dataview/compare/master...SpocWeb:obsidian-dataview:headings-in-PageInfo
Don't have time to do it right now; but I'll see if I can get to it later
Try to have a look at my link above, because it covers all Headings. If you would second this, I would make it a PR.
Fine with me!
I'd like to be able to query the title of a Markdown document being the first H1 or H2 heading in the document. This is described in the comments of the Markdown parser: https://github.com/blacksmithgu/obsidian-dataview/blob/4829a8320044dd3bdc3eafa96d628ffc74bacfd6/src/data-model/markdown.ts#L22 - but is not (yet?) implemented. Would it be possible to implement this?
Related FR: https://github.com/blacksmithgu/obsidian-dataview/issues/29