FANDOM


Forums: Yew Grove > Wrapping table bottoms
Replacement filing cabinet
This page or section is an archive.
Please do not edit the contents of this page.
This thread was archived on 10 December 2014 by Gaz Lloyd.

Hi, this can probably be considered a mostly "notice of intent" thread, but I figured I'd allow for it to get some attention/feedback.

My proposal/intention is to wrap the mediawiki syntax for the bottoms of tables (|}) in a template. This would apply mostly to dropslines and other templates that rely on templates to create table rows. I have no intention of making this apply to normally-created tables.

I already made Template:TableBottom and added it to Dried zombie to show that it works as intended.

Okay, so what's the point? It may seem extraneous, but it does have 3 benefits that greatly interest me:

  1. It's easier to understand for normal editors. Every bit of drops lines is created with templates, except this part. It may look like strange code to those none the wiser. With a template, it can be explicitly clear what it is and why it is there.
  2. It will not be as prone to visual editor errors. As with the logic of the reason above, the visual editor has this nasty habit of bringing the |} to the same line as the dropsline templates. The template I created has a newline in it, meaning it won't break the tables when this happens.
  3. I'd like to have DropsLines created entirely with html tags in Lua. Because you can't do a mixture of HTML syntax and MediaWiki syntax, I'll need a way to change everything at once. If this template is already in place, the conversion will be seamless. This can tie in with point #1: I don't think a lone </table> tag would make any sense on its own.

I like the benefits of the idea and can't think of any reasonable opposition. If/when I proceed, I'll be using AWB to fully implement the change. MolMan 16:40, November 30, 2014 (UTC)

Update - I've gone ahead and made all the appropriate changes. ItemsDropsLines now uses mw.html, so the new tablebottom (Template:ItemDropsEnd) is required. All other dropslines still use wiki syntax. Module:DropsLine will go live when Module:Exchange does. MolMan 15:35, December 1, 2014 (UTC)

Template:DropsLineTH now uses mw.html MolMan 16:26, December 1, 2014 (UTC)

Diskushin

If you wanna be super friendly have redirects for stuff like {{DropTableEnd}} or {{DropTableBottom}} to Template:TableBottom. Weird gloop @Gaz#7521 17:14, November 30, 2014 (UTC)

Plan to. MolMan 17:17, November 30, 2014 (UTC)

Support - It's not a lot of work when done with an AWB, and makes wiki editing more friendly towards new contributors. I see no downsides. Lily of the valley ThePsionic White Rabbit 18:18, November 30, 2014 (UTC)

Support - I'll always support something that helps newbies contribute. Ancient talisman Oil4 Talk 19:09, November 30, 2014 (UTC)

Support - this has been done before, so that one could just be merged (ie. redirected) into the template you've got there. PS: plz use teh RS:AWB/S :D JOEYTJE50TALKpull my finger 21:19, November 30, 2014 (UTC)

They can't be merged. Eventually, TableBottom will contain </table>. MolMan 21:22, November 30, 2014 (UTC)

Comment - Can we set up 2 for now, with </table> and |} respectively? The reason is so modules can use mw.html to build tables, which is much easier to read than building tables out of wikitext, allowing us to make a gradual transition from one to the other. I'm not convinced it's worth it from a performance perspective and there are possibly better ways to implement table-based templates that are more VE friendly that would make this obsolete, but I guess this will do for now. User:Cqm/Signature

No modules like this use mw.html yet. I was going to wait for the exchange module to be ready to roll. My plan for tomorrow was to first implement this template, then switch DropsLines over to mw.html. Then probably work on ItemDropsLine. I was going to wait for DropsLines to be ready to roll before converting ItemDropsLine with it. MolMan 23:16, November 30, 2014 (UTC)
Just because they don't yet doesn't mean they won't in the future.
Having 2 templates gives us greater flexibility, e.g. we add {{ItemDropsEnd}} which redirects to {{TableEnd}} which is currently |}. When we want to update to mw.html, we just redirect {{ItemDropsEnd}} to {{TableEnd2}} which is <table>. User:Cqm/Signature
K. Redirected Template:DropsTableBottom to the existing template Joey mentioned. Since that one will be the last to get changed to mw.html. I have no plans to change userboxes, so Template:Userboxesend will likely remain as |} forever. So I've skipped making a second template with the table bottom name. MolMan 01:04, December 1, 2014 (UTC)

Support - I've seen tables that someone forgot to close before. This idea could help prevent this, will be much easier to understand for anonymous contributors. 5-x Talk 17:16, December 7, 2014 (UTC)

Closed - Changes have been made. As a friendly summary of the changes:

  • Regularly used table row templates can have a table end template (but are not required to), which in most cases should be a simple redirect (from a logical name) to one of the table ending templates
  • If the table row template is written in wikiscript-format (using table constructs like {| ! | |-), the table ending template to use is {{Userboxesend}}; this is typically how tables are written in wikiscript templates
  • If the table row template is written in HTML format (using HTML tags like <table> <th> <td> <tr>, and relevant closing tags), the table ending template to use is {{TableBottom}}; this is typically how tables are generated in lua
  • Table row templates are not required to use a table end template, but it is helpful to do so for readability, maintainability and possibly future porting to lua, if the template is not already
  • For consistency and clarity, the specific redirected template to an ending shouldn't be mixed with any other. Template:TableBottom/doc contains a list of headers, rows and endings to be used together (this also contains redirects for wikiscript-style tables, and not just those for HTML tables)
  • These shouldn't be used as a replacement for a normal table ends inside a self-contained template (unless actually needed, though {{!}}} is likely preferable), or in a generic table in an article

Weird gloop @Gaz#7521 21:51, December 10, 2014 (UTC)

Community content is available under CC-BY-SA unless otherwise noted.