@Krinkle: boolean
is not for three-value (yes/no/missing) parameters, not for two-value (present/missing) ones, see Help:TemplateData#Type parameter. By the way, I think TemplateData should be moved to Template:Note/doc to allow it to be localized using TemplateData’s internal translation system.
Topic on Template talk:Note
Fixed.
No, if the code and the documentation contradict, fixing means correcting the documentation, not changing the code to match the documentation. Your “fix” means that values like yes
, on
etc. are no longer considered truthy. “Anything non-blank is truthy” is a well-established parameter mode on wiki, and doesn’t have to be changed. (By the way, the documentation is still inaccurate: boolean
means that missing/blank value is a third, special value, while in this case it’s the same as 0
—but that’s not documented.)
I understand that generally the documentation is fixed. In this case, however, the parameter is relatively new and only used as a boolean on this wiki. This is preferred as it aligns with the TemplateData spec, and means that it is optimally supported by VisualEditor and other systems in the future.
It was documented correctly. It is true that it unofficially could also be set with inline=whatever
but was not documented and not supported. If that workedk, it would have been a mistake. I searched using insource:
on this wiki, just in case, and found no results. If we do find some, it's easy to fix.
I'm well-aware of the meaning of the boolean type, given as I wrote the TemplateData spec that defines it. The third "unknown" state does not mean that it has to behave differently from 1 or 0. It simply means that the editing user has not defined it. Which means the choice is not significant and either 1 or 0 is fine, for the template to decide.
The default can be simple like here, where the default is just 0. Or, the default can be complicated, based on the namespace or other parameters etc.
I'd like to understand better how you interpret the meaning of the third "special" value. What did it mean to you?
This is preferred as it aligns with the TemplateData spec, and means that it is optimally supported by VisualEditor and other systems in the future.
Because y’all deny people from documenting the reality. If you make sure that TemplateData-powered tools don’t support this convention, of course they won’t support this convention.
It is true that it unofficially could also be set with
inline=whatever
but was not documented and not supported.
Neither was the opposite (i.e. that only 1
is a valid input) documented. The documentation wasn’t very detailed about it, but the template used a well-established convention that unfortunately can’t be documented in TemplateData, except for describing it in free text each time.
I'd like to understand better how you interpret the meaning of the third "special" value. What did it mean to you?
I can’t interpret the third value (i.e. NULL in ternary logic) in this case. It makes sense where unknown is a possibility (e.g. “Is XY married? Yes/No/Unknown” in an infobox field), but doesn’t make sense where there’s no such uncertainty (the user of the template pretty much knows whether they want to make it inline or not). However, if you document it as a ternary parameter, something needs to be said about NULL’s meaning.
- The
|inline=
parameter appears to be only used on 8 pages, not counting translations - I don't think it is reasonable to force the user who wishes to use inline formatting to specify the computer-centric value "1", as opposed to something else like "yes". It might make sense to use Template:Yesno for the parameter, but I also don't see what the actual problem with the pre-existing system is.
- In generalities, I think TemplateData should not have an opinion. It should provide tools for documenting the way template parameters are used, not try to force templates (and thus all users of those templates) to some normal form. Thus, Topic:Tiazyrpyuav76l53/phab:T144155 should ideally happen. Of course, not a developer so my opinion on this is mostly irrelevant.
- Krinkle's recent changes to this template have gotten caught up in the annoying bug that sometimes prevents translation pages from updating (which affects the code but not the TemplateData)
- As to what
type
the TemplateData for the parameter should use right now, I don't understand the issue well enough to comment on it.
- The
|inline=
parameter appears to be only used on 8 pages, not counting translations
It’s actually 9, your naïve regexp missed Extension:Page Forms/The "edit with form" tab, where {{note}} contains another template. Not that it would matter a lot in this case, but next time you might miss important results because of this. (I used a custom Pywikibot-based script, which seems to handle this better.)
- Krinkle's recent changes to this template have gotten caught up in the annoying bug that sometimes prevents translation pages from updating (which affects the code but not the TemplateData)
You can easily work this around: just go to https://www.mediawiki.org/w/index.php?title=Special:PageTranslation/Template:Note&do=mark and press the big blue button once again. It will hopefully catch up the right version of the source page. (It’s a new feature since this summer that one can mark a page for translation without any actual changes. It was created as part of a translation markup change to ease transition, but comes in handy in situations like this one as well.)