Template talk:Note

About this board

Previous discussion was archived at Template talk:Note/Archive on 2019-06-15.

Template source code contains some template doc information

3
Waddie96 (talkcontribs)

The template source code contains some template doc information. Please fix:

  1. Make Template:Note same as Template:Note/sandbox.
  2. Make Make Template:Note/doc same as Template:Note/doc/sandbox.

Warning Warning: the only error I have is visible at Template:Note/testcases, but I am unsure how to fix the display of the <translate>?.

Waldyrious (talkcontribs)

I don't think it's necessarily an error that the documentation is stored within the template page. It may be a good practice to keep it separate, though, especially so that it can be updated by users without the editprotected right. WDYT, @Krinkle?

Waddie96 (talkcontribs)

Yes, sorry I just mean good practice and so that it can be edit by those without making an {{editprotected}} request (unnecessary admin for admins).

Reply to "Template source code contains some template doc information"
FeRDNYC (talkcontribs)

Currently, the template's documentation is split across the template page and a documentation subpage like so:

{{documentation|content=
<translate>
== Usage == <!--T:3-->
</translate>
<pre>
{{Note|Foo}}
{{Note|Foo|info}}
{{Note|Foo|reminder}}
{{Note|Foo|warn}}
{{Note|Foo|error}}
{{Note}} <translate nowrap><!--T:6--> Loose test</translate>

* Text {{Note|Foo|inline=1}}
</pre>
{{Note|Foo}}
{{Note|Foo|info}}
{{Note|Foo|reminder}}
{{Note|Foo|warn}}
{{Note|Foo|error}}
{{Note}} <translate><!--T:4--> Loose test</translate>

* Text {{Note|Foo|inline=1}}

== Parameters ==

{{Note/doc}}

}}
[[Category:Templates{{#translation:}}|{{PAGENAME}}]]

Please move the Usage content to the documentation subpage along with the other documentation, and replace everything quoted here with a simple {{Documentation}} transclusion. This will mean that the documentation box displays the standard view/edit/history links to the subpage, and will make the existence of Template:Note/doc discoverable without having to read the template source.

(Actually, I've Been Bold and already added the |content= documentation to Template:Note/doc, temporarily surrounded by tags to prevent duplicate information from being displayed. So, all that needs to be done is to update the template source, and remove the <noinclude> tags on the documentation page.)

Shirayuki (talkcontribs)

Template's documentation pages (/doc) should not have <translate>...</translate> tags for consistency with other templates.

FeRDNYC (talkcontribs)

Oh! Really? My mistake, I'll fix that up.

FeRDNYC (talkcontribs)

@Shirayuki: Or perhaps I misunderstood — are you saying that the template documentation shouldn't be placed on the Template:Note/doc subpage, because it needs to be translated on the main template page instead?

I took your response to mean that the <translate> tags should be removed, when moving it to the doc page... but now I'm questioning whether I've got that right.

Shirayuki (talkcontribs)
Reply to "Categorization request"
Farvardyn (talkcontribs)

How to use this note template in my mediawiki? Does it require scribuntu? Or what?

MichaelBeijer (talkcontribs)

Good question. I am trying to figure out the same thing.

70.123.154.247 (talkcontribs)

Export and import it

Szabolcs.horvath1122 (talkcontribs)

I have exported and imported it. In order to make it work i had to also install the TemplateStyles extension and after that I have also created the Template:Note/styles.css subpage. It has the content model: sanitized-css. Still when i try to use the Note|Foo template, i get the following error message: Page Templlate:Note/styles.css has no content.

Szabolcs.horvath1122 (talkcontribs)

Figured out, that the last missing piece was to install the JsonConfig extension. Problem solved.

Reply to "How to use this?"
Tacsipacsi (talkcontribs)

@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.

Krinkle (talkcontribs)

Fixed.

Tacsipacsi (talkcontribs)

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.)

Krinkle (talkcontribs)

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?

Tacsipacsi (talkcontribs)

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.

Pppery (talkcontribs)
  1. The |inline= parameter appears to be only used on 8 pages, not counting translations
  2. 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.
  3. 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.
  4. 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)
  5. 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.
Tacsipacsi (talkcontribs)
  1. 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.)

  1. 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.)

Reply to "Boolean parameter"

Why is the info icon identical to the default?

2
175.159.181.165 (talkcontribs)

as title. I was expecting a blue "i" like wikipedia?

Quiddity (WMF) (talkcontribs)
Reply to "Why is the info icon identical to the default?"
There are no older topics
Return to "Note" page.