gtg922r / obsidian-numerals

An obsidian plugin which turns a math code block into a full featured calculator
Other
389 stars 7 forks source link

[Feature Request] Dataview front matter access #46

Open nayr31 opened 1 year ago

nayr31 commented 1 year ago

It would be great to have access to front matter fields for centralized math operations.

I've included an image in a possible solution using the dataview standard in calling front matter from other files, with core and mod being values in that file's front matter.

image

MultiverseHitchhiker commented 1 year ago

this opens up great opportunities for what I call "programmable contexts" and for which I love Obsidian so much.

gtg922r commented 1 year ago

Some support for this is coming. Currently I have added support for frontmatter from the current file, and it can be available as a variable. Next will add dataview inline field support. Considering accessing values of other files

gtg922r commented 1 year ago

Should land in beta builds later this week

dav-garcia commented 1 year ago

Hi, will this new feature also support inline fields via [key:: value] or (key:: value)? Anyway, thanks for this awesome plugin. :-)

gtg922r commented 1 year ago

Beta is live with frontmatter access in 1.3.

To try it out get Obsidian BRAT: https://github.com/TfTHacker/obsidian42-brat and point it at this repo to install the beta version of Numerals.

Please try it out and leave feedback!

In order to access metadata, you need to tell Numerals to make the value available by:

  1. Set the numerals metadata value (either frontmatter or dataview inline property) to the name of the value you want to include, or a list of values
    • Frontmatter of numerals: other_metadata_name, or numerals: [metadata_1, metadata_2]
    • inline value: [numerals:: other_metadata_name]
      1. Set the metadata value of numerals to all: will index all metadata and make it available to dataview
      2. Enable "Always Process All Frontmatter" in the Numerals settings

Further detailed instructions coming soon. Metadata values are available in a code block and will show up in autosuggest. Code blocks will automatically update when metadata changes.

HighPriest commented 11 months ago

Hey @gtg922r The frontmatter parsing works great for the local properties and the maths executes perfectly fine for me, but what about accessing properties in other notes? Is it possible already?