This template was considered for deletion on 9 October 2021. The result of the discussion was "no consensus". |
No consensus. See no general agreement to rename this template as proposed; however, since there is the possibility of confusion, this template will be moved to {{ Row indexer}}, the creator's next choice. As is usual with this type of outcome, any editor at any time can open a new RM to garner consensus for a better template name. Have a Great Day and Happy Publishing! ( nac by page mover) Paine Ellsworth put'r there 01:35, 17 May 2018 (UTC)
Template:Row counter → Template:Autoincrementing table – To avoid confusion with Template:Table row counter {{3x|p}}ery ( talk) 14:45, 28 April 2018 (UTC)--Relisting. -- Dane talk 15:54, 5 May 2018 (UTC)
{{
Table row counter}}
counts the number of rows in an existing wikitable and reports that number. That is a completely different sort of task from the task that {{
row counter}}
performs.{{
Table row counter}}
is used. Its documentation says nothing about 'numbering' table rows, it only counts them. So, in a page that has a single table which has 4 rows, {{Table row count}}
returns the single digit number '4'. That's all. Nothing about it is intended to add numbering to a table.{{
row indexer}}
or {{
table indexer}}
.Even though this template seems to work fine on the desktop and mobile browser versions, it fails to work at least on the Wikipedia app for Android. Instead of a table, the plain wikitext is displayed (ostensibly as a result of the <nowiki>
tags). This basically removes the content displays from the relevant articles and should ideally be resolved quickly. I've also set up a
Phabricator task at
T203293 for this issue. Thanks.
RAVENPVFF |
talk ~
01:24, 3 September 2018 (UTC)
@ Trappist the monk: I'm investigating List of living cardinals#Living cardinals which is showing "Lua error: not enough memory." Module:Row numbers has this code:
while (tbl_str:find ('_row_count[^%s|]*')) do tbl_str = tbl_str:gsub ('_row_count[^%s|]*', get_count, 1); end return frame:preprocess (tbl_str);
Why does it replace keywords one at a time? Using the following code fixes the "not enough memory" error.
return frame:preprocess (tbl_str:gsub('_row_count%w*', get_count));
Johnuniq ( talk) 06:11, 5 October 2020 (UTC)
get_count()
, count
was incremented inside the while
loop. I added get_count()
to the gsub()
, it worked, done. No other excuse.@
Quantocius Quantotius: Thanks for
diff which replaced %w
with [_%w]
. I might forget that again because most of my regex (off-wiki) uses a tool where \w
follows the C identifier definition and includes underscores, unlike Lua's %w
which is alpha only. I'm hoping that writing this comment will bring it to my mind next time.
Johnuniq (
talk)
22:34, 20 October 2020 (UTC)
A much better template is Template:Static row numbers
See diff. I was being bold. So I understand why someone would revert it. But try out Template:Static row numbers and see for yourself how easy it is to use. It only requires the addition of {{ static row numbers}} above the top of the table wikitext. Also the addition of class=static-row-numbers to the table wikitext. Nothing more is required for tables with a single header row.
The template is also much better than {{ rank}} which is the template I was using previously. Here is the deleted message below that I tried to add to the top of the doc. I just revised it about mobile view.
This template is deprecated. A much better template is {{ Static row numbers}}. It is much easier to use. The row number column is integrated into the table, and allows editing of the table via the Visual Editor. Zooming the font size has no effect on row alignment. Browser window width has no effect on row alignment. Rows can have multiple lines without effecting row alignment. It also works in mobile view. |
-- Timeshifter ( talk) 14:37, 6 May 2021 (UTC)
{{
row numbers}}
is sometimes a pain to use and has its limitations are not issues that I dispute. If all you need are static row numbers, then by all means use {{
static row numbers}}
. If you want the enumerators to be sortable, if you want the enumeration to pause for items that are ranked the same as the previous or succeeding item, if you want the enumeration to begin at an index other than '1', then {{static row numbers}}
won't give you that functionality.{{row numbers}}
has been labeled as a stop-gap that provides functionality not available from MediaWiki. The real fix for those who need enumeration of any sort is for MediaWiki to support it natively so that {{static row numbers}}
and {{row numbers}}
aren't needed.{{static row numbers}}
were a drop-in replacement for {{row numbers}}
; it isn't so I do.much better". Is there an instruction that can be added (like a simple "sort≈y"...?) that will also sort the row numbers when other columns are sorted? Also, why is this template "deprecated"? (Based on what? fyi- it works perfectly fine for me on mobile). Also pinging Trappist the monk. - wolf 10:58, 18 May 2021 (UTC)
Comment. Thewolfchild. I see you reverted my addition of static row numbers. See diff of my work on List of motor yachts by length. It made the table much easier to maintain. You don't have to add _row_count to new entries. In fact you don't have to do anything at all to new entries. -- Timeshifter ( talk) 11:23, 18 May 2021 (UTC)
So I'm making a table which uses this template, and I need to use _row_count
inside of a time parser function like so: {{#time:d/m/Y|21 December 2016 + _row_count days}}
so it adds a day for each row, but it doesn't work. Is there any way to make this work?
TwoBits (
talk)
14:50, 12 August 2022 (UTC)
_row_count
is maintained internal to
Module:Row numbers so is not available as a value for the #time
parser function is called – it get the plain string _row_count
when it expects a digit. Further, templates (and parser functions) are executed from inside to outside so the #time
parser function executes before {{
row numbers}}
.This template was considered for deletion on 9 October 2021. The result of the discussion was "no consensus". |
No consensus. See no general agreement to rename this template as proposed; however, since there is the possibility of confusion, this template will be moved to {{ Row indexer}}, the creator's next choice. As is usual with this type of outcome, any editor at any time can open a new RM to garner consensus for a better template name. Have a Great Day and Happy Publishing! ( nac by page mover) Paine Ellsworth put'r there 01:35, 17 May 2018 (UTC)
Template:Row counter → Template:Autoincrementing table – To avoid confusion with Template:Table row counter {{3x|p}}ery ( talk) 14:45, 28 April 2018 (UTC)--Relisting. -- Dane talk 15:54, 5 May 2018 (UTC)
{{
Table row counter}}
counts the number of rows in an existing wikitable and reports that number. That is a completely different sort of task from the task that {{
row counter}}
performs.{{
Table row counter}}
is used. Its documentation says nothing about 'numbering' table rows, it only counts them. So, in a page that has a single table which has 4 rows, {{Table row count}}
returns the single digit number '4'. That's all. Nothing about it is intended to add numbering to a table.{{
row indexer}}
or {{
table indexer}}
.Even though this template seems to work fine on the desktop and mobile browser versions, it fails to work at least on the Wikipedia app for Android. Instead of a table, the plain wikitext is displayed (ostensibly as a result of the <nowiki>
tags). This basically removes the content displays from the relevant articles and should ideally be resolved quickly. I've also set up a
Phabricator task at
T203293 for this issue. Thanks.
RAVENPVFF |
talk ~
01:24, 3 September 2018 (UTC)
@ Trappist the monk: I'm investigating List of living cardinals#Living cardinals which is showing "Lua error: not enough memory." Module:Row numbers has this code:
while (tbl_str:find ('_row_count[^%s|]*')) do tbl_str = tbl_str:gsub ('_row_count[^%s|]*', get_count, 1); end return frame:preprocess (tbl_str);
Why does it replace keywords one at a time? Using the following code fixes the "not enough memory" error.
return frame:preprocess (tbl_str:gsub('_row_count%w*', get_count));
Johnuniq ( talk) 06:11, 5 October 2020 (UTC)
get_count()
, count
was incremented inside the while
loop. I added get_count()
to the gsub()
, it worked, done. No other excuse.@
Quantocius Quantotius: Thanks for
diff which replaced %w
with [_%w]
. I might forget that again because most of my regex (off-wiki) uses a tool where \w
follows the C identifier definition and includes underscores, unlike Lua's %w
which is alpha only. I'm hoping that writing this comment will bring it to my mind next time.
Johnuniq (
talk)
22:34, 20 October 2020 (UTC)
A much better template is Template:Static row numbers
See diff. I was being bold. So I understand why someone would revert it. But try out Template:Static row numbers and see for yourself how easy it is to use. It only requires the addition of {{ static row numbers}} above the top of the table wikitext. Also the addition of class=static-row-numbers to the table wikitext. Nothing more is required for tables with a single header row.
The template is also much better than {{ rank}} which is the template I was using previously. Here is the deleted message below that I tried to add to the top of the doc. I just revised it about mobile view.
This template is deprecated. A much better template is {{ Static row numbers}}. It is much easier to use. The row number column is integrated into the table, and allows editing of the table via the Visual Editor. Zooming the font size has no effect on row alignment. Browser window width has no effect on row alignment. Rows can have multiple lines without effecting row alignment. It also works in mobile view. |
-- Timeshifter ( talk) 14:37, 6 May 2021 (UTC)
{{
row numbers}}
is sometimes a pain to use and has its limitations are not issues that I dispute. If all you need are static row numbers, then by all means use {{
static row numbers}}
. If you want the enumerators to be sortable, if you want the enumeration to pause for items that are ranked the same as the previous or succeeding item, if you want the enumeration to begin at an index other than '1', then {{static row numbers}}
won't give you that functionality.{{row numbers}}
has been labeled as a stop-gap that provides functionality not available from MediaWiki. The real fix for those who need enumeration of any sort is for MediaWiki to support it natively so that {{static row numbers}}
and {{row numbers}}
aren't needed.{{static row numbers}}
were a drop-in replacement for {{row numbers}}
; it isn't so I do.much better". Is there an instruction that can be added (like a simple "sort≈y"...?) that will also sort the row numbers when other columns are sorted? Also, why is this template "deprecated"? (Based on what? fyi- it works perfectly fine for me on mobile). Also pinging Trappist the monk. - wolf 10:58, 18 May 2021 (UTC)
Comment. Thewolfchild. I see you reverted my addition of static row numbers. See diff of my work on List of motor yachts by length. It made the table much easier to maintain. You don't have to add _row_count to new entries. In fact you don't have to do anything at all to new entries. -- Timeshifter ( talk) 11:23, 18 May 2021 (UTC)
So I'm making a table which uses this template, and I need to use _row_count
inside of a time parser function like so: {{#time:d/m/Y|21 December 2016 + _row_count days}}
so it adds a day for each row, but it doesn't work. Is there any way to make this work?
TwoBits (
talk)
14:50, 12 August 2022 (UTC)
_row_count
is maintained internal to
Module:Row numbers so is not available as a value for the #time
parser function is called – it get the plain string _row_count
when it expects a digit. Further, templates (and parser functions) are executed from inside to outside so the #time
parser function executes before {{
row numbers}}
.