Topic on Help talk:TemplateData/Archive 2

Don't list the contents in the form of tables

6
SolidBlock (talkcontribs)

I find in this page, there are many tables to show the usage of parameters. I don't think using table is a preferred way. It is hard to read and unfriendly in mobile views.

For example:

parameterdescriptionexample
aliasesdescription of aliases<syntaxhighlight>...</syntaxhighlight>

The better way to present content may be:

=== aliases ===
description of aliases

Example:
<syntaxhighlight>...</syntaxhighlight>
Whatamidoing (WMF) (talkcontribs)

TemplateData is stored in machine-readable JSON, and I think that JSON might create the tables.

Tacsipacsi (talkcontribs)

The complaint is not about TemplateData, but about the wikitext page Help:TemplateData – to be exact, about Help:TemplateData#Template data parameters. (By the way, even if it was about TemplateData itself – JSON doesn’t create tables, it’s just a format for storing data. Those tables are created by PHP code that was programmed to create tables, but which could just as well be programmed to create definition lists or whatever format we want.)

Daask (talkcontribs)

I know of two common ways the TemplateData in JSON format is converted to HTML:

  1. The default provided by Extension:TemplateData in TemplateDataHtmlFormatter.php (Phabricator Diffusion, GitHub)
  2. w:en:Template:Format TemplateData.

It totally possible to write a new template/module to parse the JSON and produce the format that SolidBlock suggests (or any other format). That's exactly what w:en:Module:Format TemplateData does, so start by just replacing its its features function.

I'm not sure if SolidBlock's concern was with the specific page Help:TemplateData as Tacsipacsi suggests, or with TemplateDataHtmlFormatter.php's output in general. However, if it's a readability issue on this page, then it's surely a readability problem elsewhere as well.

Tacsipacsi (talkcontribs)

However, if it's a readability issue on this page, then it's surely a readability problem elsewhere as well.

Not necessarily, as most tables on this page aren’t generated by TemplateDataHtmlFormatter.php. Compare the first table of Help:TemplateData#Template data parameters with the TemplateData table at the bottom of the preceding section – the former is gigantic both vertically and horizontally (it definitely has a readability problem), and thus hard to use even on desktop, while the TemplateData table – which is what appears on other pages as well – is completely fine on desktop, and mostly usable on my phone as well (so I wouldn’t say it has a readability problem).

Daask (talkcontribs)

Oh, my mistake, Tacsipacsi is certainly right. Thus my above comments, while true, are irrelevant.