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] Hide inputs on render #31

Open joeabreu opened 1 year ago

joeabreu commented 1 year ago

Add a some prefix like '%' (or suffix like '~') which denotes a line that should not be rendered in the output but still creates variables that can be used in other lines i.e.

```math
AttackStrength = 10; Defence = 5;
AtkModifier  = 1.5 ~
DamageTaken = AttackStrength * AtkModifier - Defence =>
```
AttackStrength = 10
Defence = 5
DamageTaken = AttackStrength * AtkModifier - Defence                               -> 10.0
gtg922r commented 1 year ago

Thanks for the feature request!

Currently there is Numerals setting to "Hide Result on Lines without Result Annotation". Would an option to hide lines without result annotation cover most of your use use-case? Or is the primary value in having a line-specific indication not to include it in the rendered output?

hubortje commented 1 year ago

I'd appreciate such a feature.

The current feature does not provide the asked feature, because I there is still an entry printed, just the result is omitted. A feature where the whole line is omitted, but the variable is still resuable, would create an oppurnity to create something like this:

```math
rent = 800 $;
electricity = 200 $;
mobile = 20 $;
~monthly = rent + electricity + mobile
monthly_cost 
rent = 800 $
electricity = 200 $
mobile = 20 $
monthly_cost → 1020 $

It'd be neat to hide larger calculations like that.

RaviKavaiya commented 2 months ago

@gtg922r sir, any updates on this? I highly require and recommend this feature. In my case, there are a lot of calculations involved. But, I just want to show the output only. The setting "Hide Result on Lines without Result Annotation" works, but it consumes blank space...

gtg922r commented 2 months ago

@RaviKavaiya initial implementation complete. Need to do some more tests, but should be in a new beta in a few days

gtg922r commented 2 months ago

The newest beta is published and implements this feature by adding a command @hideRows. See the release notes: Release 1.5.1 · obsidian-numerals.

Please try it out by following the directions on the README to get access to the beta using BRAT. Would love any feedback or issues you run in to