Template talk:Demo

(Redirected from Template talk:Demo/testcases)
Latest comment: 1 year ago by JWBTH in topic Changes announcement

demo_kill_categories alias nocat

edit

I've did this change, but it doesn't seem to work. Can somebody with more Lua knowledge take a look? See example here: User:Andrybak/sandbox/demonocat -- note, that page is added to Category:Wikipedians in Russia, but shouldn't be. —⁠andrybak (talk) 11:15, 29 August 2018 (UTC)Reply

Template-protected edit request on 22 March 2019

edit

Please remove the line <noinclude>{{pp-template|small=yes}}</noinclude> - protection templates are automatically handled by the documentation page. Thanks, --DannyS712 (talk) 06:39, 22 March 2019 (UTC)Reply

  Done — JJMC89(T·C) 06:54, 22 March 2019 (UTC)Reply

Syntax highlighting

edit

Please incorporate a parameter to enable syntax highlighting of the preformatted text with <syntaxhighlight lang="{wikitext|html|etc.}">. I've attempted to develop this in the sandbox, without success. —swpbT • beyond • mutual 13:55, 11 May 2023 (UTC)Reply

I believe the syntax should be highlighted by default. Why not? wikitext is a good default that would work with HTML as well. BTW, do we even need html as a parameter? Jack who built the house (talk) 08:40, 20 July 2023 (UTC)Reply
So, I've managed to get the code in the sandbox to work. The resulting look is a bit different from <pre>...</pre>: you can't set display: inline to <syntaxhighlight>...</syntaxhighlight>, as suggested in Template:Demo. Also, if used without <nowiki>...</nowiki>, the templates are replaced with their code, but the code is still treated as code. Compare
<big style="color:#DF0A24; font-size:1.4em;">&#x2717;</big>&nbsp;'''Fail'''
and
{{fail}}
. This result is kind of better than with <pre>...</pre>: when there are no templates inside, <nowiki>...</nowiki> can be omitted (but people might forget that they haven't used <nowiki>...</nowiki> and use a template which will expand). Jack who built the house (talk) 19:52, 20 July 2023 (UTC)Reply
Please update Module:Demo from Module:Demo/sandbox. Test cases: Template:Demo/testcases. Ping the OP: @Swpb. Jack who built the house (talk) 15:07, 21 July 2023 (UTC)Reply
  Done Sidenote to JWBTH, your signature is messed up and should be fixed. * Pppery * it has begun... 21:09, 22 July 2023 (UTC)Reply
Haha, thanks! Forgot to check a checkbox. I don't even see my signature due to a script, and the author username was displayed correctly :) Jack who built the house (talk) 00:18, 23 July 2023 (UTC)Reply

Changes announcement

edit

I'm to make an edit to the module with several notable changes that you can see here or in the test cases:

  • HTML tags in the code snippet will work (they don't now). So, the template will be able to be used to show demonstrations of any code, not necessarily of templates.
  • Markup that must be at the start of the line (like *, {|) will work. It doesn't work for the first line now.
  • There will be |reverse=1 parameter to show the code snippet and the result in reverse order.
  • There will be no <br> after the code snippet by default, because it creates nonfunctional empty space. Many usages of the template try to remove that space. I haven't witnessed cases where it was justified.
  • |br= will be renamed to |sep=, from "separator" (|br= will still work) because the more popular usage of the parameter is to add some meaningful text between the snippet and the result, not just line breaks.

Jack who built the house (talk) 22:11, 26 July 2023 (UTC)Reply