Talk:BSicon/Templates

From Wikimedia Commons, the free media repository
Jump to: navigation, search

Table in legend breaks BS-templates?[edit]

moved from Talk:BSicon#Table in legend breaks BS-templates?

Please take a look at this pt:Template talk:DiagramaSMTUC: If I add a table inside BS-table, text in a BS row causes the diagram to break. If there’s no text in the rows it looks almost good (still a slight gap at the right). What’s wrong? (NB: wp:pt’s BS templates were fully synchronized from those in en:pt a couple months back — there may be a few tweaks missing.) --Tuvalkin (talk) 10:36, 29 October 2011 (UTC)

I'm fairly sure that is quite simply because en:BS-table is NOT meant to handle a table there. The template that, I believe, might be able to is en:template:BS-map (which is currently recommended over it, too), specifically the "top" parameter. Circeus (talk) 15:47, 29 October 2011 (UTC)
I fixed it with pt:template:BS-map, but had to change it to make it look like BS-table, in terms of text size. Seems that this new template inherits some specs from the general wp style that are different in wp:pt and wp:en. -- Tuválkin 04:41, 2 November 2011 (UTC)

Redlinks[edit]

moved from Talk:BSicon#Redlinks

A number of the subpages have sections moved from English Wikipedia, etc. Unfortunately, some of these threads use templates, and not all of the relevant templates on those Wikipedias exist on Commons. Could these redlinks be sorted please? --Redrose64 (talk) 16:12, 5 September 2011 (UTC)

Not just redlinks, some of the BS templates are missing in commons, making some of the example RDTs used in the moved discussions hard to follow (see example). There should be an effort to keep BS templates synchronized. --Tuvalkin (talk) 11:10, 8 September 2011 (UTC)
I know we already talked about that. How about changing our templates to match those in wikipedia? a×pdeHello! 19:58, 8 September 2011 (UTC)

New overlap template {{BS-o}}[edit]

moved from [[Talk:BSicon#New overlap template {{BS-o}}]]

(Is it only me or {{BS-overlap}} is broken?) -- Tuválkin 20:39, 30 January 2012 (UTC)

It's just you, as {{BS-overlap}} is working for me in IE, Chrome & Foxfire on a PC and in Foxfire & Safari on a Mac. 128.205.48.118 21:17, 30 January 2012 (UTC)
Well, it was putting the overlapped icons on a separate line and after digging on the matter I noticed that, within text (i.e., within a p HTML tag) mw adds a closing and an opening p, indeed forcing a separate “paragraph” for {{superimpose}} (which is used by {{BS-overlap}}).
I therefore created a whole new template, {{BS-o}}, to show two stacked BSicons in our textual discussions, akin to {{BS-q}}.
-- Tuválkin 02:58, 17 February 2012 (UTC)

I wanted to add a "notxt" switch to this but, having read this and this it is still not working. Help? -- Tuválkin 13:11, 4 May 2012 (UTC)

Duh, fixed. I was using "notxt" and "notext" as if they were the same. (They’re not!) -- Tuválkin 13:13, 4 May 2012 (UTC)

Synchronize![edit]

moved from Talk:BSicon#Local files

Some should be transferred to Commons because most RDT projects in other wikis still have only 1 overlapping layer or none at all. -- Sameboat - 同舟 (talk) 03:49, 28 August 2011 (UTC)

Well if it requires more than 1 overlapping layer, I agree. But are there really wikis without any overlap capability? Maybe we should let them have some of our templates. — Train2104 (talk • contribs • count) 00:17, 31 August 2011 (UTC)
See Wikipedia:Route diagram template/Transwiki guide#Major difference in other Wikimedia project. Although I suspect the named parameters "T~" of German de:Vorlage:BS somehow associate with the overlaying function, I just can't get it right since I don't understand German language. -- Sameboat - 同舟 (talk) 04:50, 31 August 2011 (UTC)
The T-parameter (for "Teleskop") in German BS-templates are used to "stretch" the icons in case the name or annotation includes a <br>-tag. You have to specify which BSicon shall be used to fill the gap between two rows, usually STR or STR-L/R are used. a×pdeHello! 22:02, 3 September 2011 (UTC)
Few diagrams use <br> in wp:en as there are specific templates to display two lines of text: en:Template:BSsplit, en:Template:BSsplit2, en:Template:BSto and en:Template:BScvt. Useddenim (talk) 21:18, 16 March 2013 (UTC)
moved from Talk:BSicon/Icon_topology_and_semantics#Completely_new_BS_icon_set

The Commons templates do not display dICONs at the proper size, and only allow a single overlay. Useddenim (talk) 14:14, 16 December 2011 (UTC)

moved from Talk:BSicon/Icon_geometry_and_SVG_code_neatness#double_stations

Not all projects can handle the d- icons. The ones that can't include those that specify an icon width, not a height, in the {{BS}} templates (or their subtemplates). English Wikipedia can, because en:Template:BSpx is set to x20px, so the d-icons come out the same height as the square ones, but Italian can't, because it:Template:BSpx is set to 20px so the d-icons come out twice the height. See it:Utente:Redrose64/sandbox. --Redrose64 (talk) 15:46, 17 February 2012 (UTC)

All BS templates should be synchronized from en+de, as in many projects they fell out of synch long ago — even in Commons! I had that problem with w:pt, lacking most overlays and even some widths, so what I did was really “simple”: I copied each and every BS* template from w:en onto w:pt (identical names, thankfully!), halting only to slavage the translated/adapted doc pages. That was over 1 yr ago, maybe some templates are unsynched again (the whole BS-map matter hapened later in w:en), but it is still working. I suggest w:it and all interested parties do the same. Ideally these templates should be centralized in Commons, and discussed/develeped centrally. -- Tuválkin 00:30, 18 February 2012 (UTC)

Missing icons in templates[edit]

These templates, used primarily in wp:en to create tables of BS icons by nameID vs. suffix variant, rely on the presence of a switch (any char) to display or not each icon in a table row.

This has two main drawbacks:

  • In order to keep these tables current, it is necessary, to keep adding manually said swicthes to each template call.
  • There’s an {{#if: for each table cell, making these templates “costly”.

I propose we eliminate these {{#if: clauses and let the templates display all possible icons using all nameID+suffix combinations for each table row, as done in a few experimental icon tables here and here.

In order to avoid the unseemingly appearence of cells filled with "x20px", the alt text for each icon is "—" (oslt). These has the opposite advantages as above:

  • Newly created icons show up immediately.
  • The template syntax is simpler.

and new drawbacks:

  • Identical, meaningless alt texts are against style rules.
  • Misnamed icons will show up unopposed.

I think that the latter may be a mixed blessing, and the former may be addressed by saying that these is to be used outside the main namespace, geared to involved editors only.

Opinions? -- Tuválkin 02:53, 5 August 2012 (UTC)

Useddenim remade these wp:en templates (example) in such a way that all my concerns above are addressed and more elegantly than I did in my experimental attempts. Hooray! -- Tuválkin 16:34, 1 July 2013 (UTC)
Yup, great work! And it's also superior to hiding images via Javascript in that it provides a link (invisible) to the title of a missing icon (although at en.wp that is not very useful. Maybe we should Commonize all those tables? They are in English in any case.) YLSS (talk) 17:10, 1 July 2013 (UTC)

Template:BS![edit]

(Don't know where to post this properly.) I've just edited the ru.wp version of Template:BS! to permit using not only RGB-codes, but colour names as well (via template BS-color). The rationale behind this is that when editing a railway template, one only sees the name of the current set and has to consult some other pages (God knows where) to get the corresponding RGB. It's a pity that templates cannot reference data on other projects (unless we dump somehow to Wikidata?), but still it would be far easier to update a single page per Wikipedia than all the templates. So I guess BS! can be updated on other projects as well. YLSS (talk) 23:01, 15 March 2013 (UTC)

I think that’s a terrific (yet logical) idea. As soon as wp:ru’s BS! is fixed, I'll copy the diffs into wp:pt. (I’d even say that the BS templates should be centralized somewhere. There’s a few goodies in wp:no, for one, we all would like to play with, too.) 20:55, 16 March 2013 (UTC)
Yeah, Туча has been developing something like their no:Mal:JBS-tabell/medVisSkjul for a long time, and I was intending to help him. But then I got involved into the Great Migrations... YLSS (talk) 17:07, 18 March 2013 (UTC)

Created {{BS-color}} in Commons for similar purposes. Please check if everything's OK with RGBs etc. YLSS (talk) 15:43, 2 April 2013 (UTC)

New template BSzoom[edit]

If you compare pt:Linha do Corgo and pt:História da Linha do Corgo, you’ll guess that the identical RDT is in a separate template page — and you’d be right. However I have been using it for an experimet for a totally new feature. Wp:pt uses 20px as its default icon size and that’s good for articles (wp:nl’s excellence not questioned here!), but some times we want more. So, I’m playing with this template to develop a zooming feature. Take a look at:

Whenever it is stable, you’re all welcome to port it to your projects. Suggestions are welcome! -- Tuválkin 21:55, 16 March 2013 (UTC)

Template:BSsplit[edit]

I've just created ru:Шаблон:BSsplit on the model of en:Template:BSsplit, but incorporating features of en:Template:BSkm and en:Template:BSsplit2. The former is old and extensively used; the latter is employed in not so many pages yet. Since en:Template:BSsplit & en:Template:BSsplit2 virtually do the same, maybe they can be merged? As a temporary measure, the latter can call the former with |1={{{2|}}}|2={{{3|}}}|3={{{1|}}}|4={{{4|}}}. YLSS (talk) 00:16, 15 May 2013 (UTC)

I'm not so sure that your coding above is correct, but you may be right about merging the two templates. I'm thinking that adding a new argument/parameter (perhaps L= ?) to change the functionality of en:Template:BSsplit to en:Template:BSsplit2, and while I'm at it adding an option for the dividing line so that en:Template:BSkm can finally be dispensed with. Useddenim (talk) 11:56, 15 May 2013 (UTC)
✓ Done adding options to BSsplit and replacing BSsplit2 with a call to the former. From a brief glance, the template seems to be working as previously. I have also updated a couple of articles to use only BSsplit and not BSkm. YLSS (talk) 15:39, 15 May 2013 (UTC)

Template:Routemap[edit]

Okay, since several users on my talkpage convinced me to tell you about my newly created template, I do it. It's supposed to suppress old scheme of drawing route maps with a big number of more or less small templates with just one. Although the documentation is currently only in Russian, in short the format of this template call is:

{{routemap|<params to the table>|1= <- that's where you define the route to draw
ID1!~overlapID\ID2\(and so on)~~info 1~~info 2
(etc)
(etc)
}}

ID# are the ID of icon to use, overlapID is the ID of icon to overlap with the icon stated previously (there is no limit on overlapping icons in the template), info1-2 should be pretty obviously; if only one pair of "~" is found, info2 is assumed. No limit on row number. If you are interested in this template, please let me know, so I would know to write documentation in English. Cheers! KPu3uC B Poccuu (talk) 00:48, 17 August 2013‎ (UTC)

Thank you for your effort. Trying it in Russian WP. I thought that the RDT indeed should be implemented to Lua, but in Firefox there's small gap between every row if info 1 is applied, I know the rows join perfectly in Chrome regardless. Also I think it should provide info 3/note 1 (smaller text next to main text) and info 4/note 2 (smaller text float to right) cells instead of requiring editor to write extra HTML codes to define the text styles. One more problem is that I can't get the extra map parameters work properly in my map, please see ru:Участник:Sameboat/sandbox. I can help translate the Russian help doc to English, although it definitely will require proofread. -- Sameboat - 同舟 (talk) 02:00, 17 August 2013 (UTC)
Thanks for feedback. Yes, I'll add those parameters at some time. Regarding your test, it would be better if you provided the original map, so I could try to convert it myself and see where is the origin of error. Small notice: you really shouldn't use param 2 and any subsequent in regular maps. KPu3uC B Poccuu (talk) 03:08, 17 August 2013 (UTC)
Also, regarding those gaps between rows, it's quite possible that I didn't notice a special HTML/CSS that prevented that in old templates, however, I see that effect only if provided info is too tall in resulting HTML (see ru:Template:Маршрутная карта/test and already converted ru:Шаблон:Условные обозначения маршрутных шаблонов for comparisons). KPu3uC B Poccuu (talk) 03:15, 17 August 2013 (UTC)
I'm just testing around with your template so there's no "original" map to convert, you can edit the testing map in my sandbox, though. I expected param 2 and subsequent params work the similar way as map2~10 of en:template:BS-map, so it's not what you intended... -- Sameboat - 同舟 (talk) 03:18, 17 August 2013 (UTC)
Yes, I added those just because at the time of creation I wasn't sure if separating rows with newlines is a good way. Though it's might be possible to simulate BS-map if you use the "-colspan-N" keyword ("N" is the number of rows after the line with the keyword to treat as plain wikitext, if no "N" is supplied, it means "until -colspan-end or end of table is found") so you can write anything and not break the table. This way, you should be able to do smth like this:
{{routemap|<params to the table>|1= <- that's where you define the route to draw
-colspan-1
<code to write map heading>
<actual map>
-colspan-1
<code to write map #2 heading>
<actual map>
<etc>
}}

Check my edit on your sandbox page. Also it turns out that any parameters except 1 are bugged (for some reason no leading newline is transfered back to page so the parser outputs a code mess). KPu3uC B Poccuu (talk) 03:56, 17 August 2013 (UTC)

The first icon row BHF~~Map 1 is devoured by -colspan- =v= -- Sameboat - 同舟 (talk) 03:50, 17 August 2013 (UTC)
Okay, I'm on it. KPu3uC B Poccuu (talk) 03:56, 17 August 2013 (UTC)
Fixed. KPu3uC B Poccuu (talk) 04:36, 17 August 2013 (UTC)

Regarding those extra info/notes, can you provide me the appropriate wikicode for them? Can't make myself again open Specail:Expandtemplates and figure that out. KPu3uC B Poccuu (talk) 03:56, 17 August 2013 (UTC)

I would add the following after info 2 param: <span style="font-size:90%;padding-left:3px">{{info 3 param}}</span><div style="font-size:90%;padding-left:3px;float:right">{{info 4 param}}</div> . -- Sameboat - 同舟 (talk) 04:08, 17 August 2013 (UTC)
BSicon STR.svg without line-height: 0px !important
BSicon BHF.svg
BSicon STR.svg With line-height: 0px !important
BSicon BHF.svg

For the gap appears in Firefox, it doesn't matter how info 1 is applied. But you may check en:Template:BSrow and I suspect you need to add line-height: 0px !important in the style attribute of info 1 to eliminate the gap. -- Sameboat - 同舟 (talk) 04:23, 17 August 2013 (UTC)

I've added it, but I'm unsure if it changed anything since I use only Opera and IE. KPu3uC B Poccuu (talk) 04:36, 17 August 2013 (UTC)
Nothing changed. I've copied your module and template to Chinese Wikipedia for testing (zh:Template:Routemap, zh:Module:Routemap), but still can't figure out the cause. -- Sameboat - 同舟 (talk) 05:06, 17 August 2013 (UTC)
You should've given me credit for the template and module. KPu3uC B Poccuu (talk) 07:03, 17 August 2013 (UTC)
My last edit to the module fixed the gap finally because the padding attribute of info1 missed a whitespace between the figures so it interpreted padding all around the cell. -- Sameboat - 同舟 (talk) 02:50, 18 August 2013 (UTC)

Added support for info3-4, now I want to implement the "link" parameter of BS#, but, looking at the multileveled transclusion of templates... can anyone give me an insight on how does it work? KPu3uC B Poccuu (talk) 07:03, 17 August 2013 (UTC)

Great, info3/4 works nicely now. You mean the alternative link of the icon image? You just add the parameter of link parameter in the file embeding markup: [[File:BSicon_%s.svg|20px|alt=|link=%s]]. But care should be taken if superimposition is applied, only make the "top" icon to apply the link param. -- Sameboat - 同舟 (talk) 08:46, 17 August 2013 (UTC)
Thank you, I've added it and support for customized background color of rows. KPu3uC B Poccuu (talk) 11:48, 17 August 2013 (UTC)
Tested the icon link and works well, but I have trouble to overlap more than 1 icon. If I type icon 1!~icon 2!~icon 3, only icon 2 overlaps icon 1, but icon 3 appears in the next icon cell instead of overlapping icon 2 and 1. -- Sameboat - 同舟 (talk) 14:23, 17 August 2013 (UTC)
Both should be fixed, I really should've thought about separators more thoroughly, now I use !@ for links so the module won't confuse them with !~ for overlap icons. KPu3uC B Poccuu (talk) 15:04, 17 August 2013 (UTC)
Success! Have to say the markup combos !@ and !~ are so brilliant XD -- Sameboat - 同舟 (talk) 16:07, 17 August 2013 (UTC)

OK, a report or question. When I try to use !~bg to color the icon row, it will report "missing parameter" and the whole map area will not show if I type |<<map codes>> instead of |1=<<map codes>>. Also I want to know if there is any parallel parameter of tw of {{BS}} in Routemap in case of collapsible section? Thx. -- Sameboat - 同舟 (talk) 17:24, 17 August 2013 (UTC)

That's supposed to happen, since you use the equal sign, that is treated by the parser itself rather than my module, and using of explicitly named parameters (1 in our case) fixes that. Regarding that parameter, what does it do? KPu3uC B Poccuu (talk) 02:00, 18 August 2013 (UTC)
Stupid me, should've noticed that earlier. About tw, please check my collapsible section map in my ru sandbox, it's the wiki table and its collapsible limits which could potentially break the collapsible section if the text column width outside the collapsible section is not longer than the text column of either startCollapsible row or longest row inside collapsible section. In order to fix this without adding bunch of html whitespace codes to prolong the text column, the tw parameter will do the trick neatly. Also another questions. Will startCollapsible-replace be fixed (because it's glitched in the test page demo, at least in Firefox) and is BS-2 row supported? I understand they're both tricky to implement. -- Sameboat - 同舟 (talk) 02:33, 18 August 2013 (UTC)
I just don't see that parameter in {{BS}}. Regarding collapsibles in general, I'm going to seek any help in technically more advanced users, there should be a less hacky way to implement this feature. KPu3uC B Poccuu (talk) 02:54, 18 August 2013 (UTC)
No idea why {{BS}} in Commons appears so differently than in other projects, but it's in ru:template:BS and {{BS2}} already. The reason that tw was invented is also because of the structural limit of RDT itself as well. I'm totally aware of the cause of it but it will be very difficult to explain and I'm not confident I will make it clear enough for you to understand. So I can only tell the tw parameter is the quick solution. -- Sameboat - 同舟 (talk) 03:00, 18 August 2013 (UTC)
I tried to add that, but with it all collapsible sections look a bit shifted to the right. Possibly I made something wrong, but do u have a clue? KPu3uC B Poccuu (talk) 03:29, 18 August 2013 (UTC)
Got it, added, please test. KPu3uC B Poccuu (talk) 04:10, 18 August 2013 (UTC)
Yes, it works now! -- Sameboat - 同舟 (talk) 04:20, 18 August 2013 (UTC)

Don't know if you've watched my ru sandbox, but I think I should announce in here that the module:Routemap can be directly transcluded in other container nicely like BS-map. -- Sameboat - 同舟 (talk) 04:30, 18 August 2013 (UTC)

Yesh, why would it not work inside the old templates? In essential it produces the same result as old ones do. KPu3uC B Poccuu (talk) 04:40, 18 August 2013 (UTC)

Sameboat, do you still experience gaps between rows? They seem to disappear from my converted templates. KPu3uC B Poccuu (talk) 06:18, 18 August 2013 (UTC)Nvm, didn't notice your reply about it. Thanks for the fix! KPu3uC B Poccuu (talk) 06:21, 18 August 2013 (UTC)

BSn-2 alternative[edit]

OK. So the remaining function to be implemented is en:template:BSrow-2 series (en:Wikipedia:Route diagram template#BSn-2 row templates). If you're going to do it, I want to make a small request that the order of the text/icon parameters follows the actual appearance instead of arbitrary order that is confusing to human editor. -- Sameboat - 同舟 (talk) 08:01, 18 August 2013 (UTC)

Well, if I would implement it, I'd make a separate row handling function, because layout of the two kind of templates isn't compatible w/ each other. KPu3uC B Poccuu (talk) 08:49, 18 August 2013 (UTC)
Am I right what the only difference between the two is usage of Template:BSrow-2? If no, what else is used here? KPu3uC B Poccuu (talk) 08:55, 18 August 2013 (UTC)
All BSn-2 row templates use BSrow-2 as the base without exception, similar to en:template:BSrow, en:template:BSrow-sc (startCollapsible), en:template:BSrow-replace. en:template:BSrow-2sc and en:template:BSrow-2replace are experimental because they don't align correctly in Chrome. -- Sameboat - 同舟 (talk) 10:05, 18 August 2013 (UTC)
Alright, added, separate two sides with ! ! and put icons on the right side. All text should be typed in position where it's supposed to be in result, so left note will be always the first text and right text must be after icons. To use the template you should add alt=1 into its parameters. Please test. KPu3uC B Poccuu (talk) 14:13, 18 August 2013 (UTC)
Thx. Sorry for the false bug report. Please ignore it. -- Sameboat - 同舟 (talk) 15:00, 18 August 2013 (UTC)
Tested and I just used it in zh:Template:Rdt demo and it works beautifully. -- Sameboat - 同舟 (talk) 15:12, 18 August 2013 (UTC)
For compatibility for BS-2 rows, I am trying to merge BS and BS-2 cases together to make them similar variants. I hope this more-unified format would help you code your Lua modules, since you guys can simply code them in similar instances. I have listed the examples in en:Wikipedia talk:Route diagram template#Template:Routemap. Peterwhy (talk) 19:42, 18 August 2013 (UTC)
I don't think it matters much in KPu3uC's Routemap module because as you can see in zh:Template:Rdt demo (BSn-2), rows without text on the left hand side is used simply in the BSn fashion with the only difference of lacking collapsible/replace option. So I think when the collapsible/replace function of BSn-2 is fully implemented into the module, we can make BSn-2 the default style and BSn an "alternative" (available in case any map exceeds template limit and requires lighter coding to render the map). -- Sameboat - 同舟 (talk) 01:17, 19 August 2013 (UTC)
Now I see the syntax for BSn-2's. Since the row syntax for BSn-2 without left notes is already similar to BSn, may I suggest adding the {{{km}}} column for BSn-2, thus effectively eliminating alternatives? Peterwhy (talk) 07:21, 19 August 2013 (UTC)
I don't have particular preference over the km column and actually I understand the reason why the inventor of BSn-2 omitted this text cell, but I won't disagree if you want to add it for both sides. -- Sameboat - 同舟 (talk) 07:35, 19 August 2013 (UTC)

So I would suggest further modifying the BSn-2 part of the module like this:

left-float smaller text~~right-aligned smaller text~~right-aligned main text~~right-aligned smaller text! !(icon column)~~right-aligned smaller text~~left-aligned main text~~left-aligned smaller text~~right-floating smaller text

--Sameboat - 同舟 (talk) 07:44, 19 August 2013 (UTC)

I am requesting for this:
[small note~~Main text! !](icon column)~~km~~Main text~~small note~~right small note
For this is a common syntax for BSn and BSn-2 columns, with the part before ! ! optional. I don't care about if there are {{{km}}} and the leftmost field on the left (I feel they are not too useful); I only hope a common syntax gives easier map creation. After all, BSn and BSn-2 rows are not that different; BSn has one extra {{{km}}} table column, and BSn-2 has one extra left text table column. Peterwhy (talk) 08:14, 19 August 2013 (UTC)
What's the usefulness of this km thing? Why it wasn't in the old alt templates? — Preceding unsigned comment added by KPu3uC B Poccuu (talk • contribs)
"km" is simply the right info 1 (known to you as "vremya" text cell). -- Sameboat - 同舟 (talk) 08:30, 19 August 2013 (UTC)
To answer your 2nd question, although I said that I understand the reason of its omission, it's just my guessing. BSn-2 was created in 2007 by individual without notice to the project participants. It turns out very popular, but it also means some of its flaw such as the counter-intuitive order of the text cells and the lack of time/distance cell originally available to BSn to be unmodifiable because that would mean causing error of text information of loads of maps. So I think if we're going to rewrite the map markups completely during the transition to Lua module, it's an ideal timing to fix this mistake of BSn-2. -- Sameboat - 同舟 (talk) 09:27, 19 August 2013 (UTC)
I agree the leftmost field is not too useful (and can be easily done by nesting the text in div element), but if you give editor the right km field in BSn-2, it's very natural that they would ask for the left km field as well because many maps using BSn-2 have 2 or more parallel lines and the distance information for each side is desirable. -- Sameboat - 同舟 (talk) 08:30, 19 August 2013 (UTC)
I see you point, and I agree editors will wish more and more features. But I hope you can see that I am not wanting a new {{{km}}} feature here; I am only hoping this union of features would merge two syntaxes into one, and I believe the current slight difference should not require two syntaxes, two alternatives, and two different handling codes. Peterwhy (talk) 08:44, 19 August 2013 (UTC)
I still prefer the addition of left km field and I guarantee this is the last feature we should add to BSrow-2 and no more unless it's critical to most maps. -- Sameboat - 同舟 (talk) 08:55, 19 August 2013 (UTC)
No problem, this is still something I am happy with.
[small~~Main~~km! !](icons)[~~km~~Main~~small~~right note]
Peterwhy 08:58, 19 August 2013 (UTC)
I'll try to implement that, but it just got delayed due to business IRL. KPu3uC B Poccuu (talk) 09:16, 19 August 2013 (UTC)
Thanks. -- Sameboat - 同舟 (talk) 09:27, 19 August 2013 (UTC)

I want you guys to test my quick workaround for overlaping collapsible (espacially replacing) rows. I expect it to not work in all browsers and different resolutions, etc. KPu3uC B Poccuu (talk) 13:24, 19 August 2013 (UTC)

The main text cell of Replace shifts rightward about 15px in Chrome and Firefox. -- Sameboat - 同舟 (talk) 14:03, 19 August 2013 (UTC)
The problem with that min-width:2em you added to km/vremya cell of replace row is that many maps don't use that cell or not necessarily a duration of journey (x:yy), also many editors use this cell to display distance information (xx km), hence the name "km" for this text cell. This causes a strange shift of the main text in the replace row. In the classic BS-replace template we simply let this be because as you can see in the html codes/markups, the text column of collapsible section is independent to non-collapsible row, making it impossible to inherit the length of the widest cell outside. I instead add min-width:10em in the main text cell of replace row in Chinese WP, hopefully it can cover most text of startCollapsible row. -- Sameboat - 同舟 (talk) 01:41, 20 August 2013 (UTC)
I'm trying to write new collapsible rows in such table handling script, there is one problem w/ it so I can't update my module now. KPu3uC B Poccuu (talk) 12:14, 20 August 2013 (UTC)

v 2.0[edit]

before Lua after Lua
CPU time usage 5.604 sec 0.812 sec
Real time usage 6.005 sec 1.003 sec
Preprocessor visited node count 39046/1000000 898/1000000
Preprocessor generated node count 20312/1500000 4556/1500000
Post-expand include size, B 190676/2048000 100532/2048000
Template argument size, В 42226/2048000 14782/2048000
Highest expansion depth 13/40 13/40
Expensive parser function count 0/500 0/500

I have overhauled the module recently, with the main idea being to merge the interfaces of "row" and "row2" together. Indeed, the fact that the module provides a unified syntax instead of a multitude of templates, permits us to use both text-to-the-right and text-on-both-sides layouts without anything else than just providing that text or not. At the same time, it is now possible to create a completely left-aligned RDT, totally symmetrical to the classical right-aligned one. All text fields: distance/timing, main text, left-aligned note and right-aligned note – are available on the both sides of the icon column, although to the left they actually become: left-aligned note, right-aligned note, main text and distance/timing. The only minor drawback is that when we use only text to the right, by default an empty space of 6px appears to the left of icons – a remnant of 3px×2 padding of the left distance column. This can be fixed by providing text-width=,, as a parameter to the whole template. However, I don't think that 6px would really make much difference.

At the same time I have mostly rewrote the coding for startCollapsible keyword in order to circumvent the mis-alignment problem. For simple templates that do not have large chunks of text within the collapsible block, everything should work as fine as it did before, without the need to fix anything. In complex cases, the fact that we have a single template/module is once again beneficial: instead of providing tw, tw-left, pad, {{0}} or god knows what else for each single row, it far easier to provide a single parameter to the whole Routemap template. That's the aforementioned text-width, which sets text column widths both outside collapsible blocks and within them, including the replacement row. And it permits to use collapsibles for text-on-both-sides layout! Unfortunately, now that the columns do not have a "width:100%" property, this text-width will have to be used for quite simple templates as well (but only for those with collapsibles), but once again, that won't give much trouble: just a single parameter for the whole RDT. The details of how to use it can be found at the template's docpage.

Additionally, I have changed the way row properties should be provided: instead of !~, they should be placed now after another (fifth) ~~, and separated by !@ from each other. This was done, on the one hand, to ease parsing, and on the other hand, because I have some thoughts on how !@ can be used for text field properties, and I did not want to introduce new reserved character combinations. As a result, properties for simple rows should now be provided as "ICON~~ ~~Text~~ ~~ ~~properties", instead of "ICON~~Text!@properties", but again, that IMO won't hurt much: properties are a rare thing and it won't make one's fingers fall down from exhaustion to type that in full occasionally.

So now I would request everyone interested in RDTs to test that module and provide your thoughts about any errors, drawback, requested features (for example: do we need the possibility to include several diagrams within one template, as in en:Template:BS-map, and if yes, then with what design), etc., etc. Because really, that module is our BSfuture!!! Check the parser profiling data to the right for ru:Шаблон:Арбатско-Покровская линия before and after switching to Lua. (Tuválkin, your mega-RDTs in pt.wp will be saving without MediaWiki errors!)

As yet, I do not think it useful to copy the module and the template to en.wp, commons or elsewhere. I have a couple more ideas that I want to implement (support of PX parameter, displacement of overlayed icons by e.g. 10px, as in no.wp, and with God's help, javascript collapsing). So I would ask everyone to test it at ru.wp as of now. Some testcases can be found at ru:Шаблон:Маршрутная карта/test. All parameters have English aliases and the template itself can be referred to as ru:Template:Routemap, so you don't need to use Cyrillic letters ;) The syntax should be pretty self-explanatory; nevertheless, I started a draft translation of the docpage to English at ru:Шаблон:Маршрутная карта/doc/en. YLSS (talk) 12:17, 19 December 2013 (UTC)

Mono font for time/distance cell[edit]

Recently in Chinese Wikipedia I added the font definition for time/distance text cell (namely "info1") by adding font-family:Liberation Mono,Courier,Courier New,mono;" before font-size in the style attribute of span element in the cell style definition (adding it to the span element will not allow templates like BSkm and BSsplit to inherit the previous font-family definition). Obviously I didn't ask for local consensus because no one would care for such trivial change. The idea isn't quite discussed earlier because fallback font (in this case ",Courier,Courier New,mono") didn't mature in older browsers but it ensures similar font style is applied in case the initially defined typeface isn't available in the reader's OS. There is no drawback of defining fallback font even if the reader's browser doesn't support it, it will ignore the whole font-family definition and just fallback to browser's default font.

The advantage of using mono style font is that the numerals can align better because the width of all glyphs is fixed which isn't the case of sans serif font. Although I could do the same for note2/info4 cell, in zh.wp it is more often used for non-numeral text. I'm not pushing this proposal to other WM projects. If you like it, implement it when you see no opposition in your local WM project. -- Sameboat - 同舟 (talk) 14:38, 3 February 2014 (UTC)

Certainly not for info4, it is quite universally employed for textual notes. And I have some doubts about info1 as well; I can't recall monospaced fonts to be used anywhere in Wikipedias except for code samples (correct me if I'm wrong). However, I admit that thing may look different when there is a mix-up of CJK characters and Arabic numerals, so I leave that matter wholly to your aesthetics. YLSS (talk) 19:41, 3 February 2014 (UTC)
Sameboat said that «The advantage of using mono style font is that the numerals can align better because the width of all glyphs is fixed», but in all properly designed fonts regular the characters for 0-9 all share the same width (while “old style” digits, when present, do not; equal-width characters are very common in proportional fonts, numbers being jus one case: East Asian ideograms is another). So, the matter is moot, and should any alignment errors be detected, those should be addressed as a error in the default fonts aligned in the Wikipedia skins’ CSS declaration. In cases where text other than digits needs to be presented monospaced, an ad hoc styled SPAN can be used. -- Tuválkin 17:43, 2 April 2014 (UTC)

Two Maps in One[edit]

I was wondering whether it would be possible to have multiple maps in a single template which you could change. A bit like the expansion of minor stations.

An example would be a simplified map and a detailed map where the user could flip through, depending on their requirements. If such template or ability does not exist, would it be possible to create one?

User:Deonyi

en:Template:BS-map allows you to contain more than 1 map and define the collapsible state of each map. You can technically flip between 2 maps with one single button using div overlapping, but that would be too fiddly and I don't think it's worth the trouble because it also confuses the reader, meaning poor accessibility. -- Sameboat - 同舟 (talk) 09:12, 9 April 2014 (UTC)

BS-map with inline[edit]

As far as using BS-map with inline, it works to get the track legend, but then fouls the rest by displaying formatting code above and below the map itself. I actually played around with it quite a bit before getting this format which makes everything work—except for the legend! Perhaps I'm still doing something wrong. This is what happened when I tried it again. Lost on Belmont (talk) 23:25, 5 May 2014 (UTC)

Well, I can’t recall seeing {{BS-map}} used inside {{S-line}} before, but to quote from en:Template:BS-map/doc#Parameters: “{{BS-map}} should be contained within {{Infobox rdt}} when this parameter is used.” (Of course, in that case the RDT has to be transcluded into {{Infobox rdt}}.) Useddenim (talk) 00:14, 6 May 2014 (UTC)
Strange, I thought the whole purpose of the inline parameter was to get rid of {{Infobox rdt}} (which I've been doing on occasion). I don't get why it doesn't work... Sameboat? YLSS (talk) 08:03, 6 May 2014 (UTC)
Nothing to do with S-Line. This is entirely the problem of {{Infobox rail line}} and the protected {{Infobox station}} templates which use HTML table header/data element <th>/<td> to nest the {{{route_map}}} parameter. {{Infobox rdt}} was specifically designed to resolve such coding oddity (also generates higher preprocessor visited node count due to wiki's HTML sanitizer.) There is one workaround to replace with BS-map:
{{Infobox station
|route_map=&nbsp;
{{BS-map|inline=1|map=
{{BS|blahblahblah}}
}}
}}
Doesn't it look familiar, YLSS? -- Sameboat - 同舟 (talk) 15:10, 6 May 2014 (UTC)
OMG, nbsps again! ;) Well, still that's better than {{Infobox rdt}}, I suppose. YLSS (talk) 15:22, 6 May 2014 (UTC)
@Sameboat, YLSS: it shouldn't be necessary to use a &nbsp; here. It's also undesirable, since it creates a gap above the "Legend" link. The purpose of the &nbsp; is to force a newline into the Wiki markup so that the MediaWiki parser correctly recognises the start of a table (tables need to start on a new line); and so, it's possible to use any markup that will not be stripped by MediaWiki, and yet will be ignored by the browser. You could use an empty <span />, but an ordinary space will also do this - provided that you code it as the HTML entity &#32; (or &#x20; if you prefer):
{{Infobox station
|route_map=&#32;
{{BS-map|inline=1|map=
{{BS|blahblahblah}}
}}
}}
This achieves the non-corruption of the start of the table, and also avoids that gap above the Legend link. --Redrose64 (talk; at English Wikipedia) 11:28, 8 May 2014 (UTC)
Why didn't I think about that... Lost on Belmont, would that be OK? YLSS (talk) 07:42, 9 May 2014 (UTC)
And now there also seems to be a problem with {{Infobox Public transit}}: see en:Altamont Corridor Express, for example. Useddenim (talk) 23:47, 9 May 2014 (UTC)
Just this. (BTW, a good example why "nowrap" should be enforced.) YLSS (talk) 06:02, 10 May 2014 (UTC)

class=noviewer for BSicons[edit]

STR + uSTRq
BSicon STR.svg
asd
BHF
qwe

Those projects where BSicons in the diagrams are wikilinked by default, may be interested in this post: en:Template talk:BS-overlap#class=noviewer. YLSS (talk) 06:28, 29 August 2014 (UTC)

Contrary to Wikipedia, since the map in Commons are mostly accessed by us icon/template developers, I support the inclusion of noviewer class here. -- Sameboat - 同舟 (talk) 07:47, 29 August 2014 (UTC)
✓ Done for {{bs-q}}, {{bs-o}}, {{{BS-overlap}}. Not that I use have Media Viewer turned on at Commons... Also, a note for those who would like to use it in other wikis or in other circumstances: better place that parameter right after the icon name. If an empty parameter occurs before it (e.g. as a title of a blank icon), big bugs begin. YLSS (talk) 10:35, 29 August 2014 (UTC)
Any demonstration of the bug? -- Sameboat - 同舟 (talk) 10:42, 29 August 2014 (UTC)
Mmm... Try reverting this edit and purge some page with an RDT. Or if you believe my word, blank cells in RDTs will be bloated to 500×500px size. YLSS (talk) 13:30, 29 August 2014 (UTC)
Literally screwed. -- Sameboat - 同舟 (talk) 13:54, 29 August 2014 (UTC)
What? {{BS}} over here is some weirdness, maybe you meant {{BS1}}? YLSS (talk) 14:19, 29 August 2014 (UTC)
Yes. I forgot about the BS/BS1 name issue. -- Sameboat - 同舟 (talk) 14:52, 29 August 2014 (UTC)