obsidian-dataview icon indicating copy to clipboard operation
obsidian-dataview copied to clipboard

Support Markdown first heading as a metadata

Open sghuang19 opened this issue 1 year ago • 3 comments

It'll be great if the first heading in Markdown (followed by # , typically at the top of file) can be treated as an inline metadata to be displayed in TABLE.

I organize my vault in a way that all the filenames are in lower-kebab-case-with-ascii-characters-only so that I can interact with them more comfortably in command line. These filenames, however, if displayed in a table would be difficult to read. Including the real title in the header would improve readability.

I can think of two ways to implement this feature:

  • Solution A: Add a new implicit metadata file.title or file.heading1 to represent the first heading of Markdown.
  • Solution B: If the key title is used, then treat the first heading as a fallback value for the title if it's not set in the front matter (or anywhere else as inline metadata).

It doesn't have to search the whole file to find the title, looking at the first non-blank line after front matter would be sufficient.

sghuang19 avatar Sep 13 '23 16:09 sghuang19

On top of that, it'll be even better if we have an option to display [[file.name|file.title]] instead of [[file-name]] in the first column.

sghuang19 avatar Sep 13 '23 16:09 sghuang19

I was about to open the same feature request, glad I found this one before.

My use case is that I have hundred of notes with a timestamp as filename. It occured to me that it is weird to use a special syntax for the header given that Markdown has us covered there

jmfayard avatar Jan 28 '24 03:01 jmfayard

There is a fix proposed in #2290 https://github.com/blacksmithgu/obsidian-dataview/issues/2290
Would this solve your problem?

SpocWeb avatar May 06 '24 16:05 SpocWeb