User talk:Your Friendly Neighborhood Sociologist/sandbox/Trans articles by region
Another approach
[edit]I think your table is valuable, and worth putting somewhere on the project. I had a few ideas how to improve it. Here's what I came up with:
Region | History | Rights | People |
---|---|---|---|
Singapore | Transgender history in Singapore | ![]() |
![]() |
R: Redirects to LGBT rights in Singapore | |||
United Kingdom | ![]() |
![]() |
![]() |
H: Needs re-organization, over-emphasis on timelines instead of prose. R: Comprehensive but goes into too much detail often P: Redirects to H. Lotsa room for more detailed remarks if needed: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
The idea being that the remarks for each column in the original version eat up a lot of space, and probably limit you in some cases in adding as much as you might like. By doing it in a second, table-wide column, you have a lot more room, even to expand them if you want; meanwhile, it frees up table space for an additional 'People' column, if desired, and there's easily room to add another.
I'd also add ISO-639 tags (es, fr, de, etc.) to link to the foreign article; in this two-row example, I forgot to pick a foreign example, so I just used Simple Wikipedia as the "foreign" version, and linked it in one of the cells.
Notice that the article class values (B, C, etc.) are no longer hard-coded, but pulled directly from the actual class as defined on the article Talk page, so doesn't require updating if the article gets reassessed. If you wanted to, you could also dynamically control display of the little Redirect icons by adapting the code below:
- {{#if: {{#invoke:redirect|isRedirect|Transgender rights in Singapore}} | is | is not}} a redirect. ⟶ is a redirect.
That would mean a lot fewer updates needed for the table. If it were me, I'd probably do one more thing, because the fully dynamic version is a bit squirrely, but repetitive, so I'd create a row template, and you'd just pass a few params for the article names, and it would emit the table code for that row. See Help:Table#Row template for ideas, and I have examples of it. Cheers, Mathglot (talk) 05:03, 12 February 2024 (UTC)
- Hi @Mathglot, thanks for the advice! I created the row helpers (and a column helper for those lol) and I'll be switching the table to use those. I've spent the past few weeks writing a few hundred lines of code for work but it was oddly relaxing to write a few dozen lines for wikipedia and get more into templating. Your Friendly Neighborhood Sociologist ⚧ Ⓐ (talk) 20:12, 13 February 2024 (UTC)
- It's looking good. If you want to avoid that double horizontal line for countries that don't have any remarks (Bolivia, Greenland) just drop the rowspan=2 attribute on the main row. If the "3 sentences" means what I think it means, I might do this:
Stub (3 sentences)
or (e.g., for Chile:)Section redirect (3 sentences)
- There's always lots of ways to do it, this is just one; anything that clarifies what "3 sentences" means (expl. note? Tooltip?) is good enough. I spun off the doc to its own page, which should make tweaking the row template easier, as well as tweaking the doc without worrying about screwing up the template. Mathglot (talk) 01:03, 14 February 202RR4 (UTC)
- Also, quite a while back, I inquired somewhere about the possibility of getting the Pagename of a foreign Wikipedia article linked via a Wikidata item to an en-wiki article. I know it's possible to grab certain Wikidata items given the Q-item, not sure if you can get the foreign article title, but maybe. If so, that would make it possible to automate your /col helper param 5. Mathglot (talk) 01:35, 14 February 2024 (UTC)
- I just dropped the extra row when it's unused. Regarding the pagenames of foreign wikipedia articles, I spent a few hours trying to figure out how to grab them from wikidata before settling on the approach I used, and was meaning to ask you about if you knew how to do that lol. Relatedly, how to grab the wikidata id given an article name. Your Friendly Neighborhood Sociologist ⚧ Ⓐ (talk) 01:42, 14 February 2024 (UTC)
- Ha ha, synchronicity! Made a few more {{tafr}} tweaks, hope that's all right; revert if not. Mathglot (talk) 08:22, 14 February 2024 (UTC)
- Found it, and added new discussion Module talk:Wd#Accessing titles from other Wikipedias linking to it. Mathglot (talk) 09:02, 14 February 2024 (UTC)
- I just dropped the extra row when it's unused. Regarding the pagenames of foreign wikipedia articles, I spent a few hours trying to figure out how to grab them from wikidata before settling on the approach I used, and was meaning to ask you about if you knew how to do that lol. Relatedly, how to grab the wikidata id given an article name. Your Friendly Neighborhood Sociologist ⚧ Ⓐ (talk) 01:42, 14 February 2024 (UTC)
- It's looking good. If you want to avoid that double horizontal line for countries that don't have any remarks (Bolivia, Greenland) just drop the rowspan=2 attribute on the main row. If the "3 sentences" means what I think it means, I might do this:
Detecting and highlighting redirects with possibilities
[edit]I have another enhancement in mind, which would detect redirects with possibilities, and either add a little icon or something, or maybe better add a comprehensible string to the remarks row, such as:
H: The redirect Transgender history in Australia should probably be developed into a standalone article.
because that is a redirect, and it contains the {{R with possiblities}} template. On the other hand, Transgender history in Cambodia would receive no such icon or remark, because it does not. This would help editors at the project who want to use the information in the table to figure out how to improve our T coverage by highlighting those redirects in some fashion.
This requires the ability to detect usage of a template on a page, and while {{tmpv}} comes close, it apparently doesn't do that now. I've started this discussion at the Template talk page so you might want to follow that. Alternatively, I've done this sort of thing before the brute-force way; see for example, {{Find sources/proj/is med}}. But that's not optimal, and before we try something like that, let's wait to see what happens at the discussion. Mathglot (talk) 23:13, 14 February 2024 (UTC)
- It looks like one of the volunteers might update the Module to do what we want, and we could add this. I thought further about the idea of using icons instead of text, and we could use them to decorate the articles in a more economical and visual manner. That got me to thinking about a decoration template see Draft:Aad for what I've got so far; there's overlap with {{Class/icon}}, but that can be resolved later. Anyway, am thinking about an icon for "redirect with possibilities", and my first thoughts are to use some kind of stylized 'N' (for WP:Notability), like
,
,
,
or any of several others I have found. Mathglot (talk) 21:38, 15 February 2024 (UTC)
- Oh, they just did; it's in the sandbox now. E.g.:
{{#invoke:Template parameter value/sandbox|hasTemplate|Transgender history in Australia|R with possibilities}}
⟶ yes
- I've wrapped it in a template, and you can use it thus:
{{Draft:HasTemplate|Transgender history in Australia|R with possibilities}}
→ yes
- and the template also knows how to follow redirects, which, afaik, the module doesn't; contrast these two:
{{Draft:HasTemplate|Transgender history in Australia|Transgender sidebar}}
→{{Draft:HasTemplate|Transgender history in Australia|Transgender sidebar|follow=yes}}
→ yes
- As soon as the module sandbox goes live, I'll release the Draft template to Template space, and then we'll have the tools we need to determine if a given redirect is can be identified as expandable into an article per its "possibilities" template, and tagged in your trans articles table. As an extension of that idea, see Draft:Article attribute decoration. Mathglot (talk) 11:04, 16 February 2024 (UTC)
Config-based processing
[edit]Your Friendly Neighborhood Sociologist, I think you can generate the whole table from a fairly brief template of just a few lines, consisting of a loop applied to a config. Now that I've seen your code, I realize I don't have to explain everything in detail, which is a godsend; in fact, you're probably ahead of me in concocting solutions. So, if I just tell you to have a look at template {{For loop}} and file Template:Trans articles for region/config, you'll probably understand what I'm driving at without having to spell it out. If this works out, I think it could be a model for how other projects could build similar tables. Lmk if I'm being too opaque here. Such an approach would have other advantages, in that other editors could edit the config to add new countries, or adjust the 'remarks', without having to be template editors, so table maintenance would be easy, and minimal. Mathglot (talk) 10:51, 16 February 2024 (UTC)