arnau / obsidian-metatable

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

Is it possible to have comma separated values? #49

Closed ThornedRose closed 1 year ago

ThornedRose commented 1 year ago

Apologies if this is answered in the documentation - I have Cognitive Impairment so, despite reading through all the documentation, I may have missed it.

If, for example, I have the Aliases key in my YAML, currently all values show as a single string with spaces between each value:

aliases: all values run together

When I would like them to look like

aliases: all, values, dont, run, together

I've tried looking at the CSS myself but since it's outputs as <span class="leaf string" part="leaf string">all values run together</span>, I can't target each individual value.

Thanks!

arnau commented 1 year ago

Hi @ThornedRose it is not possible right now. If you want aliases to behave like a list, you should use a YAML array:

aliases: [alpha, beta, gamma]

That said, right now this plugin treats the tags key as a special case to mimic the original Obsidian behaviour. On that basis, it should mimic the behaviour for aliases which means that the following should work:

aliases: alpha, beta, gamma

I'll keep this issue open as a reminder that this needs to be done. Thanks!

arnau commented 1 year ago

Version 0.14.5 handles the aliases key as a special case.

karmeye commented 1 year ago

After this update, I got a funny symbol rendered.

Screenshot_20230716_094940_Obsidian.jpg

aliases: [Spaces, Spaces folder, About Spaces]
arnau commented 1 year ago

Correct, different funny symbol than the default in Obsidian (which I don't like 😄 ). You can change it (or remove it entirely) if you change the CSS property --metatable-alias-symbol in a custom CSS Snippet

karmeye commented 1 year ago

What selector do I use? This doesn't work. Thanks!

body {
 --metatable-alias-symbol: "" !important;
}
arnau commented 1 year ago

The following should work:

 .obsidian-metatable,
.obsidian-metatable-sidebar {
  --metatable-alias-symbol: "";
}
karmeye commented 1 year ago

Yes, thank you.

Is it possible to get the comma separated list back as it used to be?

arnau commented 1 year ago

The only way would be to switch to nacked mode and bring your CSS.