Module:Demo: Difference between revisions
←Redirected page to Template talk:Demo |
Repair breakage. This is one of the reasons why I dislike the entire concept of lint errors |
||
| Line 1: | Line 1: | ||
# | ==demo_kill_categories alias nocat== | ||
{{moved from|Module talk:Demo|[[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">has returned</sub>]] 00:45, 22 April 2019 (UTC)}} | |||
I've did [[Special:Diff/841233019/856477054|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. —⁠[[User:Andrybak|andrybak]] ([[User talk:Andrybak|talk]]) 11:15, 29 August 2018 (UTC) | |||
: | |||
: {{Resolved|[[Wikipedia_talk:Lua/Archive_7#Template:Demo_demo_kill_categories_alias_nocat]] —⁠[[User:Andrybak|andrybak]] ([[User talk:Andrybak|talk]]) 14:52, 3 September 2018 (UTC)}} | |||
== Template-protected edit request on 22 March 2019 == | |||
{{edit template-protected|Template:Demo|answered=yes}} | |||
Please '''remove''' the line <code><nowiki><noinclude>{{pp-template|small=yes}}</noinclude></nowiki></code> - protection templates are automatically handled by the documentation page. Thanks, --[[User:DannyS712|DannyS712]] ([[User talk:DannyS712|talk]]) 06:39, 22 March 2019 (UTC) | |||
:[[File:Yes check.svg|20px|link=|alt=]] '''Done'''<!-- Template:ETp --> — [[User:JJMC89|JJMC89]] <small>([[User talk:JJMC89|T]]'''·'''[[Special:Contributions/JJMC89|C]])</small> 06:54, 22 March 2019 (UTC) | |||
== Syntax highlighting == | |||
Please incorporate a parameter to enable syntax highlighting of the preformatted text with <nowiki><syntaxhighlight lang="{wikitext|html|etc.}"></nowiki>. I've attempted to develop this in the sandbox, without success. —[[User:Swpb|<u>swpb</u>]]<sup>[[User talk:Swpb|T]] • [[WP:BEYOND|beyond]] • [[WP:MUTUAL|mutual]]</sup> 13:55, 11 May 2023 (UTC) | |||
:I believe the syntax should be highlighted by default. Why not? <code>wikitext</code> is a good default that would work with HTML as well. BTW, do we even need <code>html</code> as a parameter? [[User:JWBTH|Jack who built the house]] ([[User:JWBTH|talk]]) 08:40, 20 July 2023 (UTC) | |||
:So, I've managed to get the code in the sandbox to work. The resulting look is a bit different from {{tag|pre}}: you can't set <code>display: inline</code> to {{tag|syntaxhighlight}}, as suggested in [[Template:Demo]]. Also, if used without {{tag|nowiki}}, the templates are replaced with their code, but the code is still treated as code. Compare {{#tag:syntaxhighlight|{{fail}}|lang=wikitext}} and <pre>{{fail}}</pre>. This result is kind of better than with {{tag|pre}}: when there are no templates inside, {{tag|nowiki}} can be omitted (but people might forget that they haven't used {{tag|nowiki}} and use a template which will expand). [[User:JWBTH|Jack who built the house]] ([[User:JWBTH|talk]]) 19:52, 20 July 2023 (UTC) | |||
{{editProtected|answered=yes}} | |||
:Please update [[Module:Demo]] from [[Module:Demo/sandbox]]. Test cases: [[Template:Demo/testcases]]. Ping the OP: @[[User:Swpb|Swpb]]. [[User:JWBTH|Jack who built the house]] ([[User:JWBTH|talk]]) 15:07, 21 July 2023 (UTC) | |||
:: {{done}} Sidenote to {{u|JWBTH}}, your signature is messed up and should be fixed. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 21:09, 22 July 2023 (UTC) | |||
:::Haha, thanks! Forgot to check a checkbox. I don't even see my signature due to a [[c:User:JWBTH/CD|script]], and the author username was displayed correctly :) [[User:JWBTH|Jack who built the house]] ([[User:JWBTH|talk]]) 00:18, 23 July 2023 (UTC) | |||
== Changes announcement == | |||
I'm to make an edit to the module with several notable changes that you can see [https://en.wikipedia.org/w/index.php?title=Module:Demo/sandbox&diff=1166998268&oldid=1166318175 here] or in the [[Template:Demo/testcases|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 <code>*</code>, <code>{|</code>) will work. It doesn't work for the first line now. | |||
* There will be {{para|reverse|1}} parameter to show the code snippet and the result in reverse order. | |||
* There will be no {{tag|br|o}} after the code snippet by default, because it creates nonfunctional empty space. Many [https://en.wikipedia.org/w/index.php?search=hastemplate%3Ademo+insource%3A%2F%5C%7B%5C%7B%5BdD%5Demo%2F+insource%3A%2Fbr+%2A%3D+%2A%5B0%7C%5D%2F+prefix%3Atemplate%3A&title=Special:Search&profile=advanced&fulltext=1&ns0=1 usages] of the template try to remove that space. I haven't witnessed cases where it was justified. | |||
* {{para|br}} will be renamed to {{para|sep}}, from "separator" ({{para|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. | |||
[[User:JWBTH|Jack who built the house]] ([[User:JWBTH|talk]]) 22:11, 26 July 2023 (UTC) | |||
Revision as of 00:05, 28 August 2023
demo_kill_categories alias nocat
Template:Moved from 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)
Template-protected edit request on 22 March 2019
Template:Edit template-protected
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)
- File:Yes check.svg Done — JJMC89 (T·C) 06:54, 22 March 2019 (UTC)
Syntax highlighting
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)
- I believe the syntax should be highlighted by default. Why not?
wikitextis a good default that would work with HTML as well. BTW, do we even needhtmlas a parameter? Jack who built the house (talk) 08:40, 20 July 2023 (UTC) - So, I've managed to get the code in the sandbox to work. The resulting look is a bit different from Template:Tag: you can't set
display: inlineto Template:Tag, as suggested in Template:Demo. Also, if used without Template:Tag, the templates are replaced with their code, but the code is still treated as code. Compareand[[:Template:Fail]]
{{fail}}. This result is kind of better than with Template:Tag: when there are no templates inside, Template:Tag can be omitted (but people might forget that they haven't used Template:Tag and use a template which will expand). Jack who built the house (talk) 19:52, 20 July 2023 (UTC)
- 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)
- Template:Done Sidenote to Template:U, your signature is messed up and should be fixed. * Pppery * it has begun... 21:09, 22 July 2023 (UTC)
- 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)
- Template:Done Sidenote to Template:U, your signature is messed up and should be fixed. * Pppery * it has begun... 21:09, 22 July 2023 (UTC)
Changes announcement
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=1parameter to show the code snippet and the result in reverse order. - There will be no Template:Tag 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)