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

Add ability to hide keys from inline fields on rendering.

Open EdualcLaiv opened this issue 3 years ago • 5 comments

Hello.

It would be neat to add a syntax to hide the keys form inline fields on rendering.

Desired rendering: image

Ideas of source:

The cat ({scientific_name::[[Felis catus]]}) is a domestic species of small {order::[[Carnivora|carnivorous]]} {class::[[Mammalia|mammal]]}.

or

The cat (%%scientific_name::%%[[Felis catus]]) is a domestic species of small %%order::%%[[Carnivora|carnivorous]] %%class::%%[[Mammalia|mammal]].

(The second example is already rendered as desired, but the inline fields do nothing).

EdualcLaiv avatar May 27 '21 13:05 EdualcLaiv

In Obs 0.14.5 with DV 0.5.4: image

AB1908 avatar Apr 06 '22 20:04 AB1908

I've tried to do this with a little html and CSS, but the fields don't work when wrapped in html tags. For example: <span class="hide-dv-field">Summary:: </span> .hide-dv-field {display:none;} I'd love to hid the field on my page, but still have it available for queries.

pastorjack avatar Sep 22 '22 19:09 pastorjack

One of the two styles () vs [] hide the keys iirc. Can you try and let us know?

AB1908 avatar Sep 22 '22 21:09 AB1908

(Summary::) test ( ) hides the field name in "reading" view but the field does not work for dataview queries.

I'm looking for a way to hide the field in the "live-preview" mode, but still have it work for queries. Is it possible for dataview to look for inline fields within html?

pastorjack avatar Sep 23 '22 05:09 pastorjack

I added a new feature request #1451 to hide (key:: value) syntax in live-preview, too. If you feel it's something that would help you, give it a thumbs-up :)

YesterKo avatar Sep 26 '22 14:09 YesterKo

Oh so if I understand what you're saying, (summary:: test)'s key hiding feature is broken in live preview? Am I understanding correctly? Is this what #1451 also talks about?

AB1908 avatar Oct 08 '22 19:10 AB1908