arnau / obsidian-metatable

An Obsidian plugin to display the frontmatter section as a fully expanded table.
MIT License
150 stars 13 forks source link

Can this work in live preview? #25

Open ghost opened 2 years ago

arnau commented 2 years ago

Hi @aisle9 , as far as I can tell from Obsidian's documentation the live preview is unstable and only implemented by the Obsidian developers so I'm afraid the answer is no. Once it's clear how to do it in an official way I'll give it a go.

DryIce1 commented 2 years ago

Hi @arnau, metatable sure makes yaml look great in reading mode! The most important and useful feature for me is the toggle button which closes the yaml and gets it "out of the way" so that writing is clean and the text at the top of the page where it belongs and in focus.

I wonder if it is possible to bring the Metatable YAML Toggle into live preview ? Or would that be a native obsidian feature?

There has been a bit of demand in at least a couple of feature requests last year on the forum here and here.

Best, Tom 👍🏽

DryIce1 commented 2 years ago

I was able to hide YAML using a snippet, and it looks great in Live Preview. (Although it's not a good solution for those who use YAML regularly, it makes typing very pleasing and clean).

See the snippet on the Banners plugin comments here https://github.com/noatpad/obsidian-banners/issues/19#issuecomment-1064587173

arnau commented 2 years ago

Nice one @DryIce1 ! I'm a bit tight on time lately but as soon as I get a couple of hours I'll explore this 👍

vishae commented 2 years ago

ooh, it would be great if metatable works with live preview and default fold/hide the yaml front matter!

Archie-2021 commented 2 years ago

+1 for this one, really need this. and thanks

Rhydderch commented 2 years ago

Any updates regarding this? Is it possible? :)

arnau commented 2 years ago

I'm afraid not. As far as I can tell Live Preview does not allow hooking into the frontmatter part of the document. If anyone knows how, I'm open to contributions :)