Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Template talk:For nowiki

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Module talk:For nowiki)

Hi. This module is trippy. I think the name "for nowiki" is confusing and counterintuitive. You call a "nowiki" template ({{for nowiki}}), wrapping the wikitext in <nowiki> tags, and that produces rendered wikimarkup? That's pretty wild. --MZMcBride (talk) 03:31, 15 November 2017 (UTC)Reply

Help

[edit]

Wondering if this template can display multiple instances of a template in a list.

*{{Moveable date |holiday=Fat Thursday |year=2018}}
*{{Moveable date |holiday=Fat Thursday |year=2019}}
:...
*{{Moveable date |holiday=Fat Thursday |year=2100}}

The only changing variable is the year. In practice it will be |year={{#time:Y|+X years}} with "X" being the variable number.

-- GreenC 01:55, 3 September 2018 (UTC)Reply

Hello it works Very Cool.

{{for nowiki|
|* {{Moveable date |holiday=Fat Thursday |year={{#time:Y|+{{{i}}} years}}}}|count=5}}

Produces:

  • February 4, 2027
  • February 24, 2028
  • February 8, 2029
  • February 28, 2030
  • February 20, 2031

Here in place: Shrove_Tuesday#Dates -- GreenC 02:22, 3 September 2018 (UTC)Reply

Parameter to force one loop

[edit]
* Pppery * it has begun... 20:08, 21 January 2020 (UTC)

I noticed that you reverted my edits to Module:For nowiki. You say you see no use for performing a single loop and you can perform it outside the template. While this is true, this would require copy and pasting code, just adding one parameter to the module makes more sense. And isn't the entire purpose of the template function is so the module can be used in other templates to replace those annoying cases were you have repeated code calling a increased number parameter over and over again? If not, than what is wrong with allowing this module to do that and what is its purpose?BrandonXLF (talk) 06:22, 21 January 2020 (UTC)Reply

First of all, the template function was intended to be used to replace a lot of pre-existing Lua modules, not to luafy new templates (see Wikipedia talk:Lua/Archive 7#Idea). Second, could you provide an example of a template on which this feature (in either form) would be useful? * Pppery * it has begun... 20:12, 21 January 2020 (UTC)Reply
@Pppery: There's talk of making a template like {{Wiktionary}} called {{Simple}} on the VP, it would be useful on both templates. It would be useful because they provide a default value, meaning one loop should be performed even if there's no parameters being sent to the template. Also, what is wrong with luafying new templates? I do realize that it is not the original purpose, but having a smaller call to a lua module is much better to maintain and read and allows for infinite parameters. Even if template is only for replacing existing modules, it should still be documented. This module could also be improved even more and used on more pages if it were to accept a prefix parameter so it loops through each argument with the format [prefix]x. This would not be as useful, but would still be useful. There's many more pages templates that could benefit from either feature.BrandonXLF (talk) 03:07, 22 January 2020 (UTC)Reply
OK, that establishes a use for this parameter in template, however I think it would be cleaner if you took a named parameter (default=?), and took the value to force from that parameter instead of always forcing the empty string if given. * Pppery * it has begun... 17:09, 22 January 2020 (UTC)Reply

Template-protected edit request on 3 July 2026

[edit]

I'd like to introduce a conjunction parameter, as in Module:For batched parameters:

The module takes an optional |conjunction=conjunction parameter, replacing "sep" between the second-to-last and last batches.

(I'm converting Template:Link with archives to use {{For nowiki}}, and I need the conjuction to exactly replicate the template's current behavior.)

Please change the following line

	return table.concat(result, sep)

to this:

	if frame.args.conjunction then
		return mw.text.listToText(result, sep, frame.args.conjunction)
	else
		return table.concat(result, sep)
	end

I copied the latter code from Module:For batched parameters.

Chrisahn (talk) 09:28, 3 July 2026 (UTC)Reply

 Done * Pppery * in solidarity 14:39, 3 July 2026 (UTC)Reply