Redigerer
Mal:Routemap/dok
(avsnitt)
Hopp til navigering
Hopp til søk
Advarsel:
Du er ikke innlogget. IP-adressen din vil bli vist offentlig om du redigerer. Hvis du
logger inn
eller
oppretter en konto
vil redigeringene dine tilskrives brukernavnet ditt, og du vil få flere andre fordeler.
Antispamsjekk.
Ikke
fyll inn dette feltet!
==Transition from legacy BS row template to Routemap markup== ===Conversion policies=== Many contributors of the English Route Diagram Template project during the implementation of Routemap have conflicting opinions about the justification of replacing all maps of legacy BS row templates by the Lua-based Routemap. Opponents deem the map markups of Routemap to be too esoteric for editors unfamiliar with Routemap markup to modify. While proponents support a complete conversion for better performance. There is no consensus reached at the moment so any transition without massively updating the map appearance for reflecting service and/or structural change in reality should only be done with the following considerations: *The map of the legacy BS row template design has exceeded [[Wikipedia:Template limits|template size limit]] in the transcluding page, which means the template does not expand into its intended appearance but only the link to the template page is shown, so there is an imminent need to translate the map into Routemap design to reduce post-expand include size. *If there is no template size issue, respect the preference of the initial contributor of the first completed version of the diagram. If that contributor contests the change to Routemap, retain the BS row template design. ===Technical options=== All [[:Category:Route diagram templates|BS row templates]] have had substitutable counterparts created; hence conversion can be easily done by prepending <code>subst:</code> and appending <code>/safesubst</code> to every BS row template name in the map. For example, change <code><nowiki>{{BS2|STR|BHF|0|1|2|3|O1=uSTRq}}</nowiki></code> in the map to <code><nowiki>{{subst:BS2/safesubst|STR|BHF|0|1|2|3|O1=uSTRq}}</nowiki></code>, then publish changes; it will produce <code><nowiki>STR!~uSTRq\BHF~~0~~1~~2~~3</nowiki></code>. The process can be sped up by using the "replace all" function of advanced edit tool or separate text editor such as [[Microsoft Notepad|Notepad]] or [[Notepad++]], but the search rule for the BS row templates should ideally be a [[regular expression]], like <code>\{\{(BS\d*(\-2)?)\{{!}}</code> → <code>{{((}}subst:$1/safesubst{{!}}</code>, in order to avoid templates with similar names such as BSto and BSsplit in case they are present in the map. "Column mode editing" can avoid the trouble of find and replace to add <code>safesubst:</code> on all rows efficiently. This function is common in advanced text editors like [[Geany]],<sup>[https://www.geany.org/manual/current/index.html#column-mode-editing-rectangular-selections]</sup> Notepad++<sup>[https://notepad-plus-plus.org/features/column-mode-editing.html]</sup> and [[Sublime Text]]<sup>[https://www.sublimetext.com/docs/2/column_selection.html]</sup>. You can also use the "convertbs" function of Module:Routemap. ====Function convertbs==== Copy and paste the following code to any edit area of this wiki, maybe the map page you are working on: <pre><nowiki>{{#invoke:Routemap|convertbs|<nowiki> </nowiki></nowiki><nowiki>}}</nowiki></pre> Then copy and paste the original BS-map or BS-table map code between the <code><nowiki><nowiki></nowiki></code> tags (alternatively paste the invoke convertbs header before the original map code and the <code></nowiki>}}</code> ending after the map code) and '''show preview'''. It will generate the safesubst version and show the original versions (for comparison) of the map code. You copy the safesubst code from the preview area back to the edit area, and you should remove everything of <code>#invoke:Routemap|convertbs</code> if the preview of the new code works properly. On the English Wikipedia, the template {{tls|convertbs}} can be used as a shortcut: <pre><nowiki>{{subst:convertbs|1= }}</nowiki></pre> If it doesn't work, it's possible that you haven't copied some of the relevant code, such as table markup for BS-table diagrams, or that you've copied code which actually belongs to something else. {|class="wikitable mw-collapsible mw-collapsed" style="min-width:75%" !Example |- |<pre><nowiki>{{#invoke:Routemap|convertbs|<nowiki> {{BS-map |title=Demonstration |map= {{BS|KBHFa|0 km|A station|Shuttle bus}} {{BS3|WASSERq|hKRZWae|WASSERq||||{{BSsplit|Suburb|Capital}}}} {{BS|KINTe|10 km|B station|City hub}} {{BS-colspan}} ---- Not to scale }} </nowiki></nowiki><nowiki>}}</nowiki></pre> |- !Result |- |{{#invoke:Routemap|convertbs|<nowiki> {{BS-map |title=Demonstration |map= {{BS|KBHFa|0 km|A station|Shuttle bus}} {{BS3|WASSERq|hKRZWae|WASSERq||||{{BSsplit|Suburb|Capital}}}} {{BS|KINTe|10 km|B station|City hub}} {{BS-colspan}} ---- Not to scale }} </nowiki>}} |- !Copy safe substitution markup for actual usage |- |{{ {{PAGENAMETDOC}} |title=Demonstration |map= KBHFa~~0 km~~A station~~Shuttle bus WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~{{BSsplit|Suburb|Capital}} KINTe~~10 km~~B station~~City hub -colspan-2 ---- Not to scale }} |}
Redigeringsforklaring:
Merk at alle bidrag til Wikisida.no anses som frigitt under Creative Commons Navngivelse-DelPåSammeVilkår (se
Wikisida.no:Opphavsrett
for detaljer). Om du ikke vil at ditt materiale skal kunne redigeres og distribueres fritt må du ikke lagre det her.
Du lover oss også at du har skrevet teksten selv, eller kopiert den fra en kilde i offentlig eie eller en annen fri ressurs.
Ikke lagre opphavsrettsbeskyttet materiale uten tillatelse!
Avbryt
Redigeringshjelp
(åpnes i et nytt vindu)
Forhåndsvis en side som bruker denne malen
Denne siden er medlem av 1 skjult kategori:
Kategori:Sider som bruker tilleggsfunksjonen «linjekart»
Navigasjonsmeny
Personlige verktøy
Ikke logget inn
Brukerdiskusjon
Bidrag
Opprett konto
Logg inn
Navnerom
Mal
Diskusjon
norsk bokmål
Visninger
Les
Rediger kilde
Vis historikk
Mer
Navigasjon
Forside
Siste endringer
Tilfeldig side
Hjelp til MediaWiki
Verktøy
Lenker hit
Relaterte endringer
Spesialsider
Sideinformasjon