Wikipedia:Wikipedia Signpost/2024-01-10/Crossword
everybody gangsta till the style sheets start cascading
This issue — I'm sure everybody cares about this and is really interested in reading about it — I have spent some time optimizing the templates for crosswords, including a new several that allow for really easy formatting of the clues and answers. You can see the answer formatting in the last issue, for which I've added them.
I apologize to our phonular readers, for whom this sucks and doesn't work right; I am trying to figure out some CSS stuff that will let the highlighting properly on mobile. One major limitation is that it's impossible to just do what every other website (i.e. TV Tropes, the SCP wiki, etc) does and run clientside JavaScript from Wikipedia's MediaWiki install, meaning that 99% of the available technologies for hiding/displaying inline text are just not available. But surely we can use just vanilla tags like <details> and <summary>, and those wouldn't get roosterblocked by the parser, right?
<details> <summary>Open this to read a boring go-off</summary> Wow, hidden content! These are two of those sexy semantic HTML tags everyone forgets about the existence of, and would rather use a megabyte of JavaScript to do the same thing.<br/> But since I'm really smart and I know they exist, in theory it should be really easy to use them to implement behavior like collapsible and expandable text, even in browsers that don't use JavaScript at all!<br/> Then maybe I could use CSS styling to modify the display of the details element to be inline rather than block, and mess around with the positioning and the box model to overlay it in the same place as the summary element.<br/> So then you'd just have a thing you could easily click to show the hidden content (and have its hidden/revealed state persist, even) rather than forcing the user to highlight black-on-black text to see the information. </details>
<details><summary>Spoiler alert (click to open)</summary>It doesn't work.</details>
Furthermore, on an unrelated note, it should be noted that if you make a template to display text that's the same color as the background (like a spoiler), no matter what precautions are taken, or what giant red messages there are in the documentation, or how many technical measures have been taken to make it impossible to use the template in mainspace, there are certain names that you should never, ever give to that template... under any circumstances... no matter how innocuous and straightforward it may be — similar to how certain good-luck symbols should never be used in certain European countries — it will resurrect old terrors and cause great strife. You've been warned!
Anyway, amidst all the excitement, I forgot to actually bother to write any crosswords worth a damn this month, so here is some dreck I had lying around in the drafts.
The good news is that there is now a very good and well-documented guide on how to make your own crosswords easily using these templates here, so maybe next issue I will not have to put them together myself...??
The rectangle of doom
Clues
Across
Down
The H of doom
Clues
Across
Down
The templates of love
I'm not kidding about the templates being easy to use. You basically just type the things into the grid: .
is an unused square, 0
is an empty square, and any number is a square of that number. Here, I will show you. This code:
{{Signpost/Crossword}} {{Signpost/Crossword row|1 |2 |0 |4 |5 }} {{Signpost/Crossword row|6 |0 |. |7 |0 }} {{Signpost/Crossword row|8 |0 |0 |0 |0 }} {{Signpost/Crossword row|9 |0 |. |10|0 }} {{Signpost/Crossword row|11|0 |0 |0 |0 }} |}
Produces this output:
.....And this code, for clues:
{{Signpost/Crossword clues begin}} {{Signpost/Crossword clues}} {{Signpost/Crossword clues|Across}} {{Signpost/Crossword clue | 1|Popular orange vegetable|CARROT}} {{Signpost/Crossword clue | 3|Bone filling|MARROW}} {{Signpost/Crossword clue | 5|Popular white flower|YARROW}} {{Signpost/Crossword clues}} {{Signpost/Crossword clues|Down}} {{Signpost/Crossword clue | 2|Reminiscent of bow ammunition|ARROWY}} {{Signpost/Crossword clue | 4|Characteristic of improper technique|ERRORY}} {{Signpost/Crossword clue | 451|Mechanical model of the solar system|ORRERY}} |}
Produces this:
Across
Down
Discuss this story
As a person who has wrestled with CSS for a long while, I enjoyed this! →Stani Stani 02:54, 13 January 2024 (UTC) [reply ]
I have an idea: Maybe add
text-transform: uppercase
andtext-align: center
to the input boxes.Crosswords are case-insensitive and are usually filled with uppercase letters. Also, there should be one character per input, so it should be centered. (I know that putting a maximum length on an input field is a technical impossibility in MediaWiki, but the users are still expected to type one character) QuickQuokka [talk • contribs] 14:03, 16 January 2024 (UTC) [reply ]
- @QuickQuokka: Yeah, I banged my head against the task of limiting the fields to one character for a while. My conclusion was that this is simply impossible to do with the abilities we're granted by MediaWiki. The text-transform thing, though, I will be stealing, because that's smart. jp ×ばつg 🗯️ 01:08, 13 February 2024 (UTC) [reply ]
- @JPxG: It's not stealing if it's CC BY-SA. I agreed to share my work with others when I signed up to use this platform
- Also, is it possible to use JavaScript to limit the number of characters? I know you can't just load JS into articles, so it would have to be sitewide JS edited by an interface admin. QuickQuokka [talk • contribs] 13:32, 13 February 2024 (UTC) [reply ]
Not to spoil the fun of discovering ingenious wikitext hacks, but if/when WP:On-demand gadgets are implemented, crosswords could be done more like every other website. – SD0001 (talk) 18:14, 4 February 2024 (UTC) [reply ]