Conversation
Serene-Arc
left a comment
There was a problem hiding this comment.
This is a good clarification for the behaviour you had a problem with, but I wonder if this is something that only makes sense for programmers. Then again, this might be something that only programmers or people somewhat familiar with programming conventions understand. Might not be a problem in that case.
Perhaps make it clear that for different data types, some are always interpreted as False. 0 is that for an integer, False for a boolean, '' for a string, etc.
I agree that it might be confusing to some people not having the prerequisite programming knowledge, but I still think those people would be better off with more documentation that can at least point them in the right direction/help them ask the right questions when asking for help.
This is a great point, I had not considered this at all! |
snejus
left a comment
There was a problem hiding this comment.
Would you mind adding some examples for the %if function behaviour, following what we have under %first{text,count,skip,sep,join} below?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6399 +/- ##
=======================================
Coverage 69.39% 69.39%
=======================================
Files 141 141
Lines 18816 18816
Branches 3068 3068
=======================================
Hits 13057 13057
Misses 5112 5112
Partials 647 647 🚀 New features to boost your workflow:
|
|
I've changed the wording to explicitly mention which values are interpreted as false, so I think it should be clear for people without programming knowledge now as well.
I wouldn't mind doing this, but I can't think of what examples to add. My personal use case was the same as yours, i.e. creating an album only if the album field is populated, but I don't think that should be recommended unless you also add a workaround for albums with falsy names. |
|
Sounds good to me - now just rebase it on master and run |
|
That's weird, I did run |
|
Interesting. I have just ran it on my end and it does indeed reformat |
Description
Fixes #4991.
I don't know if there's a single, good workaround for this, so I opted to not add an example solution.
To Do
docs/to describe it.)docs/changelog.rstto the bottom of one of the lists near the top of the document.)