-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse booleans from the frontmatter (fixes #79) #177
Conversation
I don't see what could go wrong by just adding: } else if (typeof toParse === "boolean") {
value = toParse ? 1 : 0;
} But in any case, it would be a welcomed addition :) |
Callers of |
@bnjbvr How to install your version? I am really novice to JS |
@AndrewPetrov Sorry, I don't recall precisely how I've done it, but basically you'd need to use my branch by git-pulling it, then follow the instructions to use a local plugin. Hope it helps a bit! |
Have you ever thought about releasing your fork? |
Well I thought this simple PR would be reviewed and accepted without too much trouble. Maybe there are ways we can support the maintainers here, and avoid forking the code ❤️ @pyrochlore Hi! Can you take a look please, and let me know what you think of this PR? |
Hello @pyrochlore , Could you take a look at the pull request? This feature would be highly appreciated to work with other community plugins. Thanks in advanced and thanks @bnjbvr for the pull request proposal. Best regards, |
@pyrochlore Hello! Any updates on this? I'd love to utilise frontmatter boolean values so as to integrate annotations into the calendar view! |
@bnjbvr May you check this PR? Thank you. |
@SalahAdDin there's not much more I can do; I opened this PR in the first place, and I'm not a maintainer of the project so I can't merge it myself. |
@bnjbvr thanks for your initial work. It's frustrating that this is still open 8 months later. Is @pyrochlore dead? Do we fork this repository and start maintaining our own? I mean, last release was Feb... |
where's the fork? |
@bnjbvr any chance you'll create a fork mentioning @pyrochlore because he left the project? |
Ideally we would take over this project so as to keep credit for @pyrochlore, however with his absense that is difficult.. I'm all for other options. Would be frustrating to have to get all users to move to another published plugin also.. |
When using booleans, it replaces the frontmatter to use numbers instead. Is this an issue with the new properties updates? |
Chiming in to say I ran into this issues and this fix would be helpful! |
Thank you for your contribution @bnjbvr. Expect this to be released in the next few days. |
Hi! This allows parsing boolean values from the frontmatter, following the suggestion in #79 that true should mean 1, false or absence should mean 0.
It's just touching the function that parses values from the frontmatter. I've decided to not change
parseFloatFromAny
in general because that might require adapting each call site of this function to identify if it needed additional changes to handle booleans too. Also, I've had to tweakdeepValue
so it returned boolean values: since the function was returningstring | null | any[]
, I kept that convention and the boolean is converted to a string before being returned (many call sites doif (deepValue)
with the return value, so that might have been dangerous to just use the bool there).Please take a look and let me know what you think! Thanks!