https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AMountains_Prism
Module:Mountains Prism - Revision history
2025-06-14T16:21:33Z
Revision history for this page on the wiki
MediaWiki 1.45.0-wmf.5
https://en.wikipedia.org/w/index.php?title=Module:Mountains_Prism&diff=1286281828&oldid=prev
RedWolf: v1.3: Support qid after page name for items that exist on Wikidata but not on Wikipedia (updated from sandbox)
2025-04-18T21:57:47Z
<p>v1.3: Support qid after page name for items that exist on Wikidata but not on Wikipedia (updated from sandbox)</p>
<a href="//en.wikipedia.org/w/index.php?title=Module:Mountains_Prism&diff=1286281828&oldid=1284650166">Show changes</a>
RedWolf
https://en.wikipedia.org/w/index.php?title=Module:Mountains_Prism&diff=1284650166&oldid=prev
RedWolf: v1.2 (updated from /sandbox)
2025-04-08T21:49:03Z
<p>v1.2 (updated from /sandbox)</p>
<a href="//en.wikipedia.org/w/index.php?title=Module:Mountains_Prism&diff=1284650166&oldid=1282010792">Show changes</a>
RedWolf
https://en.wikipedia.org/w/index.php?title=Module:Mountains_Prism&diff=1282010792&oldid=prev
RedWolf: Various fixes for metric and imperial units (updated from /sandbox)
2025-03-23T19:52:43Z
<p>Various fixes for metric and imperial units (updated from /sandbox)</p>
<a href="//en.wikipedia.org/w/index.php?title=Module:Mountains_Prism&diff=1282010792&oldid=1279612755">Show changes</a>
RedWolf
https://en.wikipedia.org/w/index.php?title=Module:Mountains_Prism&diff=1279612755&oldid=prev
Jonesey95: Fix Linter errors.
2025-03-09T15:06:36Z
<p>Fix <a href="/wiki/Special:LintErrors" title="Special:LintErrors">Linter</a> errors.</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:06, 9 March 2025</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 671:</td>
<td colspan="2" class="diff-lineno">Line 671:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> debug("elev=" .. mtn.elevation ..";elev_wd="..mtn.elevation_wd)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> debug("elev=" .. mtn.elevation ..";elev_wd="..mtn.elevation_wd)</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if (options.showCustom1 or options.showCustom2) and mtn.elevation_wd ~= 0 and mtn.elevation ~= mtn.elevation_wd then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if (options.showCustom1 or options.showCustom2) and mtn.elevation_wd ~= 0 and mtn.elevation ~= mtn.elevation_wd then</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> local mm = "<br/><<del style="font-weight: bold; text-decoration: none;">font</del> <del style="font-weight: bold; text-decoration: none;">color</del>=green>Local/WD elevations mismatch: " .. "\"" .. mtn.elevation .. "\"".. "/\"" .. mtn.elevation_wd.. "\"</<del style="font-weight: bold; text-decoration: none;">font</del>>"</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> local mm = "<br/><<ins style="font-weight: bold; text-decoration: none;">span</ins> <ins style="font-weight: bold; text-decoration: none;">style</ins>=<ins style="font-weight: bold; text-decoration: none;">\"color:</ins>green<ins style="font-weight: bold; text-decoration: none;">\"</ins>>Local/WD elevations mismatch: " .. "\"" .. mtn.elevation .. "\"".. "/\"" .. mtn.elevation_wd.. "\"</<ins style="font-weight: bold; text-decoration: none;">span</ins>>"</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> mtn.custom = mtn.custom .. mm</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> mtn.custom = mtn.custom .. mm</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 696:</td>
<td colspan="2" class="diff-lineno">Line 696:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if string.len(errors) > 0 then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if string.len(errors) > 0 then</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> printf("<<del style="font-weight: bold; text-decoration: none;">font</del> <del style="font-weight: bold; text-decoration: none;">color</del>=red>%s</<del style="font-weight: bold; text-decoration: none;">font</del>>\n", errors)</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> printf("<<ins style="font-weight: bold; text-decoration: none;">span</ins> <ins style="font-weight: bold; text-decoration: none;">style</ins>=<ins style="font-weight: bold; text-decoration: none;">\"color:</ins>red<ins style="font-weight: bold; text-decoration: none;">\"</ins>>%s</<ins style="font-weight: bold; text-decoration: none;">span</ins>>\n", errors)</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if options.debug and string.len(dbgout) > 0 then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if options.debug and string.len(dbgout) > 0 then</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> printf("<br/><<del style="font-weight: bold; text-decoration: none;">font</del> <del style="font-weight: bold; text-decoration: none;">color</del>=green>Debug output<br/>\n%s</<del style="font-weight: bold; text-decoration: none;">font</del>>\n", dbgout)</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> printf("<br/><<ins style="font-weight: bold; text-decoration: none;">span</ins> <ins style="font-weight: bold; text-decoration: none;">style</ins>=<ins style="font-weight: bold; text-decoration: none;">\"color:</ins>green<ins style="font-weight: bold; text-decoration: none;">\"</ins>>Debug output<br/>\n%s</<ins style="font-weight: bold; text-decoration: none;">span</ins>>\n", dbgout)</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
</table>
Jonesey95
https://en.wikipedia.org/w/index.php?title=Module:Mountains_Prism&diff=1279556897&oldid=prev
Anomalocaris: That seems to have worked, but it's not what I intended, try again.
2025-03-09T06:51:44Z
<p>That seems to have worked, but it's not what I intended, try again.</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 06:51, 9 March 2025</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 99:</td>
<td colspan="2" class="diff-lineno">Line 99:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local function errorFont(value)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local function errorFont(value)</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> return "<span style<del style="font-weight: bold; text-decoration: none;">:</del>color:<del style="font-weight: bold; text-decoration: none;">\"</del>red\">" .. value .. "</span>"</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> return "<span style<ins style="font-weight: bold; text-decoration: none;">=\"</ins>color:red\">" .. value .. "</span>"</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
</table>
Anomalocaris
https://en.wikipedia.org/w/index.php?title=Module:Mountains_Prism&diff=1279554604&oldid=prev
Anomalocaris: <font> → <span style> and boldly assume that quotation marks can be returned by escaping them as \" and if this turns out not to be true I will revert
2025-03-09T06:26:10Z
<p><font> → <span style> and boldly assume that quotation marks can be returned by escaping them as \" and if this turns out not to be true I will revert</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 06:26, 9 March 2025</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 99:</td>
<td colspan="2" class="diff-lineno">Line 99:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local function errorFont(value)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local function errorFont(value)</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> return "<<del style="font-weight: bold; text-decoration: none;">font</del> color<del style="font-weight: bold; text-decoration: none;">=</del>red>" .. value .. "</<del style="font-weight: bold; text-decoration: none;">font</del>>"</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> return "<<ins style="font-weight: bold; text-decoration: none;">span</ins> <ins style="font-weight: bold; text-decoration: none;">style:</ins>color<ins style="font-weight: bold; text-decoration: none;">:\"</ins>red<ins style="font-weight: bold; text-decoration: none;">\"</ins>>" .. value .. "</<ins style="font-weight: bold; text-decoration: none;">span</ins>>"</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
</table>
Anomalocaris
https://en.wikipedia.org/w/index.php?title=Module:Mountains_Prism&diff=1279536216&oldid=prev
RedWolf: Gathers information about mountains from Wikidata and displays it in a table
2025-03-09T03:29:50Z
<p>Gathers information about mountains from Wikidata and displays it in a table</p>
<p><b>New page</b></p><div>--[[<br />
This module builds a wiki table that lists information pertinent to mountains. This module accomodates up to 996 lines<br />
of mountains where each line consists of the elevation, wiki-linked name and optional notes information. This<br />
module uses the wiki-linked name to find its corresponding Wikidata item (eid) and then retrieve the following<br />
information from Wikidata: elevation, prominence, isolation, range, first ascent, country, coordinates<br />
]]<br />
local p = {}<br />
--local wd = require('Module:Wd')<br />
local Titled_coords = require('Module:Titled_coords')<br />
local newBuffer = require('Module:OutputBuffer')<br />
<br />
-- Wikidata properties<br />
local WD_PROPERTIES = {<br />
elevation = "P2044",<br />
prominence = "P2660",<br />
mtn_range = "P4552",<br />
coords = "P625",<br />
sig_event = "P793",<br />
pt_in_time = "P585",<br />
isolation = "P2659",<br />
country = "P17"<br />
}<br />
<br />
-- Table column titles for easier translation<br />
local COL_TITLES = {<br />
rank = "Rank",<br />
name = "Mountain / Peak",<br />
elev = "Elevation",<br />
prom = "Prominence",<br />
isoltn = "Isolation",<br />
range = "Subrange",<br />
fa = "FA",<br />
coords = "Coordinates",<br />
country = "Country",<br />
custom = "Notes"<br />
}<br />
<br />
-- ** Runtime Option names **<br />
local OPT_NAMES = {<br />
NAME = "name",<br />
RANK = "rank",<br />
PROM = "prom",<br />
ISOLTN = "isolation",<br />
RANGE = "range",<br />
FA = "fa",<br />
COORDS = "coords",<br />
TCOORDS= "tcoords",<br />
CUSTOM1= "custom1",<br />
CUSTOM2= "custom2",<br />
COUNTRY= "country",<br />
ORDER = "order",<br />
DEBUG = "debug"<br />
}<br />
<br />
local RANK_ORDER = { ELEV = "E", PROM = "P"}<br />
<br />
local UNITS = {<br />
METRE = "m", FEET = "ft",<br />
KILOMETRE = "km", MILE = "mi"<br />
}<br />
<br />
-- Runtime options about what information to display<br />
local Options = { debug = false, test = false, showFA = false, showProm = false,<br />
showCoord = false, showTCoord = false, rankOrder = RANK_ORDER.ELEV,<br />
showRank = false, showRange = false, showIsolation = false, <br />
showCountry = false, showCustom1 = false, showCustom2 = false }<br />
<br />
-- Information about a mountain from Module arguments and Wikidata.<br />
local Mountain = { rank, page, name, eid, elevation, elevation_wd = 0, prominence,<br />
range = "", isolation = "", fa = "", coords, custom, country }<br />
<br />
local QID_FIRST_ASCENT = "Q1194369"<br />
local FA_UNKNOWN = "Unk"<br />
local FA_ERROR = "????"<br />
local FS = "^" -- field separator<br />
local NBSP = "&nbsp;"<br />
local COL_TITLE_SEP = ":" -- do not use "="<br />
local OPTIONS_SEP = ","<br />
local NEWLINE = "\n"<br />
local BR_NEWLINE ="<br/>"..NEWLINE<br />
local TD = '|'<br />
local errors, dbgout<br />
<br />
local function debug(msg)<br />
mw.log(msg)<br />
dbgout = dbgout .. msg .. BR_NEWLINE<br />
end<br />
<br />
local function debugv(var, value)<br />
local s = var .. "=" .. value<br />
mw.log(s)<br />
dbgout = dbgout .. s .. BR_NEWLINE<br />
end<br />
<br />
local function addError(msg)<br />
errors = errors .. msg .. BR_NEWLINE<br />
debug(msg)<br />
end<br />
<br />
local function errorFont(value)<br />
return "<font color=red>" .. value .. "</font>"<br />
end<br />
<br />
-- Split a string based on a separator<br />
local function split(istring, sep)<br />
-- if sep is null, use default<br />
if sep == nil then sep = FS end<br />
<br />
local t = {}<br />
for str in string.gmatch(istring, '([^'..sep..']+)') do<br />
table.insert(t, str)<br />
end<br />
return t<br />
end<br />
<br />
-- Strip newline character at end --<br />
local function stripNewline(value)<br />
local n = string.find(value, NEWLINE)<br />
if n then<br />
return string.sub(value, 1, n-1)<br />
end<br />
return value<br />
end<br />
<br />
-- Extract raw elevation/prominence/isolation value<br />
local function extractRaw(value)<br />
local i, i1, i2, n<br />
local units = { " metre", " feet", " kilometre" }<br />
if value == nil then return -1 end<br />
i = string.find(value, " metre")<br />
if i then<br />
-- remove thousands separator while we are it<br />
return string.sub(value, 1, i-1):gsub(',', '')<br />
end<br />
i = string.find(value, "feet") <br />
if i then<br />
return string.sub(value, 1, i-1):gsub(',', '')<br />
end<br />
i = string.find(value, " kilometre") <br />
if i then<br />
return string.sub(value, 1, i-1):gsub(',', '')<br />
end<br />
return -1<br />
end<br />
<br />
-- Call {{elevation_cells} to format the values<br />
local function getElevationCells(frame, elev, unit)<br />
if frame.expandTemplate then<br />
return frame:expandTemplate{title='elevation_cells', args= { elev, unit}}<br />
end<br />
<br />
return "{{elevation_cells|" .. elev .. "|" .. unit .. "}}"<br />
end<br />
<br />
local function getProminenceCells(frame, prom)<br />
return frame:expandTemplate{title='convert', args= { prom, "km", "mi", disp='table', sortable='on'}}<br />
end<br />
<br />
local function stripBrackets(value)<br />
local stripped = value;<br />
<br />
-- strip leading brackets if found<br />
local n = string.find(stripped, "%[%[")<br />
if n then<br />
stripped = string.sub(stripped, 3)<br />
end<br />
<br />
-- strip trailing brackets if found<br />
n = string.find(stripped, "%]%]")<br />
if n then<br />
stripped = string.sub(stripped,1,n-1)<br />
end<br />
<br />
if stripped then return stripped<br />
else return value end<br />
end<br />
<br />
local function getPage(name)<br />
local parts = split(name,"|")<br />
local page = parts[1]<br />
local n = string.find(page, "%[%[")<br />
if n then<br />
page = string.sub(page,3)<br />
end<br />
n = string.find(page, "%]%]")<br />
if n then<br />
page = string.sub(page,1,n-1)<br />
end<br />
return page<br />
end<br />
<br />
local function getPageTitle(name)<br />
local title<br />
<br />
local parts = split(name,"|")<br />
if parts[2] then<br />
title = stripBrackets(parts[2])<br />
else<br />
title = stripBrackets(parts[1])<br />
end<br />
mw.log("name="..name..";title="..title)<br />
return title<br />
end<br />
<br />
--[[<br />
Retrieve a entity's property value from Wikidata. Unfortunately<br />
the interface only supports one property at a time.<br />
]]<br />
local function getWD(frame, eid, name, cmdFlag, multiple)<br />
if not frame.preprocess then<br />
return "{{Wikidata|property|" .. name .. "|eid=" .. eid .. "}}"<br />
end<br />
<br />
local args<br />
if not multiple then args = "property|" else args = "properties|" end<br />
if cmdFlag then args = args .. cmdFlag .. "|" end<br />
args = args .. name .. "|eid=" .. eid <br />
local invoke = "{{#invoke:Wd|" .. args .. "}}"<br />
local value = frame:preprocess(invoke)<br />
mw.log(invoke .. " => " .. value)<br />
return value<br />
end<br />
<br />
-- Get a wiki linked property value<br />
local function getWDLinked(frame, eid, name)<br />
return getWD(frame, eid, name, "linked", false)<br />
end<br />
<br />
-- Get the raw value of a property value<br />
local function getWDRaw(frame, eid, name)<br />
return getWD(frame, eid, name, "raw", false)<br />
end<br />
<br />
-- Get an entity's property from Wikidata<br />
local function getWDProperty(frame, eid, name, linked)<br />
debug("eid=" .. eid .. " name=" .. name)<br />
<br />
--[[ local stmts = mw.wikibase.getBestStatements(eid, name)<br />
if stmts ~= nil then<br />
mw.logObject(stmts)<br />
for i=1,#stmts do<br />
mw.log("stmts["..i.."]="..stmts[i]);<br />
end<br />
end ]]<br />
<br />
-- call Module:Wd using template syntax<br />
if frame.preprocess then<br />
local args = "property|"<br />
if linked then args = args .. "linked|" end<br />
args = args .. name .. "|eid=" .. eid <br />
local invoke = "{{#invoke:Wd|" .. args .. "}}"<br />
local value = frame:preprocess(invoke)<br />
debug(invoke .. " => " .. value)<br />
return value<br />
end<br />
return "{{Wikidata|property|" .. name .. "|eid=" .. eid .. "}}"<br />
end<br />
-- if frame.expandTemplate then<br />
-- local args = { ['1'] = name, ['page'] = page }<br />
-- return wd._property({eid, args})<br />
-- local args = { ['1'] = 'property', ['2'] = name, ['page'] = page }<br />
-- return frame:expandTemplate{title='Wikidata', args= args}<br />
<br />
local function stripCoords(wdCoords)<br />
--debugv("wdCoords", wdCoords)<br />
if Options.test then -- this only shows up in console test mode<br />
local stripped = string.gsub(wdCoords, "\"`UNIQ%-%-templatestyles%-%d+%-QINU`\"", "")<br />
--debugv("stripped", stripped)<br />
return stripped<br />
end<br />
return wdCoords<br />
end<br />
<br />
local function getCountry(frame, eid)<br />
local value = getWD(frame, eid, WD_PROPERTIES.country, nil, true)<br />
return value<br />
end<br />
<br />
-- get location coordinates<br />
local function getCoords(frame, eid)<br />
local wdCoords = getWDLinked(frame, eid, WD_PROPERTIES.coords)<br />
return stripCoords(wdCoords)<br />
end<br />
<br />
-- Call Module:Titled_coords to get titled coordinates<br />
local function getTitledCoords(frame, eid, page)<br />
local title = getPageTitle(page)<br />
local raw_coords = getWDRaw(frame, eid, WD_PROPERTIES.coords)<br />
local fmt_coords = Titled_coords.build(raw_coords, title, "")<br />
debug(fmt_coords .. " => " .. fmt_coords)<br />
return stripCoords(fmt_coords)<br />
end<br />
<br />
local function getElevation(frame, eid)<br />
local value = getWD(frame, eid, WD_PROPERTIES.elevation, nil)<br />
return extractRaw(value)<br />
end<br />
<br />
local function getFirstAscent(frame, eid)<br />
if frame.preprocess == nil then return FA_ERROR end<br />
<br />
local names = WD_PROPERTIES.sig_event .. "|" .. QID_FIRST_ASCENT .. "|" .. WD_PROPERTIES.pt_in_time<br />
local value = frame:preprocess("{{#invoke:Wd|property|qualifier|" .. names .. "|eid=" .. eid .. "}}")<br />
debugv("FA value", value)<br />
if value == "" then<br />
debugv("No FA found for eid", eid)<br />
return FA_UNKNOWN<br />
end<br />
<br />
-- FA deliberately set to unknown value<br />
if string.find(value, "(unknown)") then<br />
debugv("FA unknown for eid", eid)<br />
return FA_UNKNOWN<br />
end<br />
<br />
-- Find date such as: 10 July 1913<br />
local i1, i2 = string.find(value, "%(%d+%s%a*%s%d%d%d%d%)")<br />
if i1 then<br />
--mw.log("i1="..i1)<br />
local date = string.sub(value, i1+1, i2-1)<br />
debugv("FA date", date)<br />
local len = string.len(date)<br />
local year = string.sub(date, len-4, len)<br />
return year<br />
end<br />
<br />
-- Find date with just the year; e.g. (2025)<br />
i1, i2 = string.find(value, "%(%d+%)")<br />
if i1 then<br />
local year = string.sub(value, i1+1, i2-1)<br />
return year<br />
end<br />
addError("Unknown FA date format for eid " .. eid .. ": " .. value)<br />
return FA_ERROR<br />
end<br />
<br />
-- *** get topgraphic isolation from Wikidata ***<br />
local function getIsolation(frame, eid)<br />
local isoltn = getWD(frame, eid, WD_PROPERTIES.isolation, nil)<br />
return extractRaw(isoltn)<br />
end<br />
<br />
-- get prominence from Wikidata<br />
local function getProminence(frame, eid)<br />
local prom = getWD(frame, eid, WD_PROPERTIES.prominence, nil)<br />
return extractRaw(prom)<br />
end<br />
<br />
-- get mountain range from Wikidata. We want it wiki-linked for<br />
-- the first occurrence of it in the output.<br />
local function getRange(frame, eid)<br />
return getWDLinked(frame, eid, WD_PROPERTIES.mtn_range)<br />
end<br />
<br />
-- generate table header<br />
local function genHeader(options, unit)<br />
local unit_1, unit_2<br />
<br />
if unit == nil or unit == "" then<br />
unit = UNITS.METRE<br />
end<br />
<br />
if unit == UNITS.METRE then unit_1 = UNITS.METRE; unit_2 = UNITS.FEET<br />
else unit_1 = UNITS.FEET; unit_2 = UNITS.METRE<br />
end<br />
<br />
local s = "{| class=\"wikitable sortable\"\n!"<br />
<br />
if options.showRank then<br />
s = s .. " align=\"left\" rowspan=2|" ..COL_TITLES.rank .. "||"<br />
end<br />
<br />
s = s .. "rowspan=2|" .. COL_TITLES.name<br />
if options.showCountry then s = s .. "||rowspan=2|" .. COL_TITLES.country end<br />
if options.showCustom1 then s = s .. "||rowspan=2|" .. COL_TITLES.custom end<br />
s = s .. "||colspan=2|" .. COL_TITLES.elev<br />
if options.showProm then s = s .. "||colspan=2|" .. COL_TITLES.prom end<br />
if options.showIsolation then s = s .. "||colspan=2|" .. COL_TITLES.isoltn end<br />
if options.showRange then s = s .. "||rowspan=2|" .. COL_TITLES.range end<br />
if options.showFA then s = s .. "||rowspan=2|" .. COL_TITLES.fa end<br />
if options.showCustom2 then s = s .. "||rowspan=2|" .. COL_TITLES.custom end<br />
if options.showCoord or options.showTCoord then s = s .. "||rowspan=2|" .. COL_TITLES.coords end<br />
<br />
s = s .. "\n|-\n"<br />
s = s .. '!' .. unit_1 .. '||' .. unit_2 -- elevation cells<br />
if options.showProm then s = s .. '||' .. unit_1 .. '||' .. unit_2 end<br />
if options.showIsolation then<br />
local iso_u1, iso_u2<br />
if unit == UNITS.METRE then iso_u1 = UNITS.KILOMETRE; iso_u2 = UNITS.MILE<br />
else iso_u1 = UNITS.MILE; iso_u2 = UNITS.KILOMETRE<br />
end<br />
s = s .. '||' .. iso_u1 .. '||' .. iso_u2<br />
end<br />
s = s .. NEWLINE<br />
<br />
return s<br />
end<br />
<br />
local function finish()<br />
return "|}" -- table end<br />
end<br />
<br />
local function handleCustomOption(n, options, columnTitle)<br />
if columnTitle then<br />
COL_TITLES.custom = columnTitle<br />
end<br />
if n == 1 then options.showCustom1 = true else options.showCustom2 = true end<br />
end<br />
<br />
--[[ Process run options<br />
rank - show ranking<br />
name - override default name column title<br />
elev - show elevation<br />
prom - show prominence<br />
isolation - show isolation<br />
range - show mountain range or subrange from WD<br />
fa - show first ascent (year only) from WD<br />
coords - show coordinates from WD<br />
tcoords - show titled coordinates from WD<br />
custom[1|2]- show custom field (e.g. Notes)<br />
country - show country<br />
debug - generate debug information<br />
]]<br />
local function processOptions(runOptions)<br />
local o = Options<br />
if runOptions == nil then return o end<br />
runOptions = stripNewline(runOptions)<br />
debugv("runOptions", runOptions)<br />
<br />
local parts = split(runOptions, OPTIONS_SEP)<br />
for i=1,#parts do<br />
option = parts[i]<br />
debugv("option", option)<br />
<br />
-- Strip out column title if given for an option<br />
local colTitle<br />
local n = string.find(option, COL_TITLE_SEP)<br />
if n then<br />
colTitle = string.sub(option, n+1)<br />
debugv("colTitle", colTitle)<br />
option = string.sub(option, 1, n-1)<br />
end<br />
<br />
local valid_option = true<br />
if option == OPT_NAMES.RANK then o.showRank = true<br />
elseif option == OPT_NAMES.PROM then o.showProm = true<br />
elseif option == OPT_NAMES.FA then o.showFA = true<br />
elseif option == OPT_NAMES.PROM then o.showProm = true<br />
elseif option == OPT_NAMES.ISOLTN then o.showIsolation = true<br />
elseif option == OPT_NAMES.COORDS then<br />
o.showCoord = true<br />
if colTitle then COL_TITLES.coords = colTitle end<br />
elseif option == OPT_NAMES.TCOORDS then<br />
o.showTCoord = true<br />
if colTitle then COL_TITLES.coords = colTitle end<br />
elseif option == OPT_NAMES.RANGE then<br />
o.showRange = true<br />
if colTitle then COL_TITLES.range = colTitle end<br />
elseif option == OPT_NAMES.CUSTOM1 then<br />
handleCustomOption(1, o, colTitle)<br />
elseif option == OPT_NAMES.CUSTOM2 then<br />
handleCustomOption(2, o, colTitle)<br />
elseif option == OPT_NAMES.COUNTRY then o.showCountry = true<br />
elseif option == OPT_NAMES.NAME then<br />
if colTitle then COL_TITLES.name = colTitle end<br />
elseif option == OPT_NAMES.ORDER then<br />
if colTitle and colTitle == "prom" then<br />
o.rankOrder = RANK_ORDER.PROM<br />
end<br />
elseif option == OPT_NAMES.DEBUG then o.debug = true<br />
else<br />
addError("Unknown option: " .. option)<br />
valid_option = false<br />
end<br />
end<br />
<br />
return o<br />
end<br />
<br />
-- ** Process a mountain line **<br />
local function processLine(frame, options, line)<br />
local parts, n, name, elev, page, custom, has_custom<br />
<br />
-- argument contains elevation, page link and custom value<br />
parts = split(line, FS)<br />
if #parts == 2 then<br />
has_custom = false<br />
elseif #parts < 3 then<br />
local m = "<br/>Bad format on argument (<nowiki>" .. line .. "</nowiki>) -- skipped"<br />
errors = errors .. m<br />
mw.log(m)<br />
return nil<br />
else<br />
has_custom = true<br />
end<br />
<br />
local mtn = Mountain<br />
<br />
elev = parts[1] -- "m" or "ft"<br />
name = parts[2] -- wiki-linked name<br />
if name then<br />
page = getPage(name)<br />
debug("name = " .. name .. ";page = " .. page)<br />
else<br />
debug("name is null")<br />
return nil<br />
end<br />
<br />
mtn.name = name<br />
mtn.page = page<br />
mtn.eid = nil<br />
mtn.elevation = elev;<br />
mtn.elevation_wd = 0<br />
mtn.prominence = nil<br />
mtn.isolation = nil<br />
mtn.range = ""<br />
mtn.fa = ""<br />
<br />
if options.showCustom1 or options.showCustom2 then<br />
if has_custom then<br />
custom = stripNewline(parts[3])<br />
debugv("custom", custom)<br />
else<br />
custom = NBSP<br />
end<br />
mtn.custom = custom<br />
end<br />
<br />
-- Get the Wikidata entity id<br />
local eid = mw.wikibase.getEntityIdForTitle(page)<br />
if not eid then<br />
debug("Cannot find entity id for page " .. page)<br />
mtn.name = mtn.name .. BR_NEWLINE .. errorFont("Cannot find entity id")<br />
return mtn<br />
end<br />
debug("page="..page .. ",eid=" .. eid)<br />
mtn.eid = eid<br />
<br />
mtn.elevation_wd = getElevation(frame, eid)<br />
mtn.prominence = getProminence(frame, eid)<br />
if options.showIsolation then<br />
mtn.isolation = getIsolation(frame, eid)<br />
debugv("mtn.isolation", mtn.isolation)<br />
end<br />
<br />
if options.showRange then<br />
mtn.range = getRange(frame, eid)<br />
end<br />
<br />
if options.showFA then<br />
mtn.fa = getFirstAscent(frame, eid)<br />
end<br />
<br />
if options.showCoord then<br />
mtn.coords = getCoords(frame, eid)<br />
end<br />
<br />
if options.showTCoord then<br />
mtn.coords = getTitledCoords(frame, eid, mtn.name)<br />
end<br />
<br />
if options.showCountry then<br />
mtn.country = getCountry(frame, eid)<br />
end<br />
<br />
return mtn<br />
end<br />
<br />
-- Process a mountain range. Only display the linked range once.<br />
local function processRange(ranges, mtn)<br />
local found = false;<br />
local range = mtn.range<br />
for k,v in pairs(ranges) do<br />
if v == range then<br />
found = true; break<br />
end<br />
end<br />
<br />
if not found then<br />
debug("Adding range " .. range)<br />
table.insert(ranges, range)<br />
else<br />
local i1, i2 = string.find(range, "|")<br />
if i1 then<br />
local ei = string.len(range) - 2 -- strip ending brackets<br />
name = string.sub(range, i1+1, ei)<br />
else<br />
local len = string.len(range)<br />
name = string.sub(range, 3, len-2)<br />
end<br />
mtn.range = name<br />
end<br />
end<br />
<br />
-- *** Main entry point ***<br />
function p.list(frame)<br />
local debug_on = false<br />
local rank_number = 0<br />
local last_elev, last_prom = ""<br />
local same_rank = 0<br />
<br />
errors = ""; dbgout = ""<br />
--debugv("args[1]", frame.args[1])<br />
--debugv("args[2]", frame.args[2])<br />
--debugv("args[3]", frame.args[3])<br />
local unit = frame.args[1]<br />
local options = processOptions(frame.args[2])<br />
if options.showCoord and options.showTCoord then<br />
return "<p>" .. errorFont("Can only specify one of coords or tcoords") .. "</p>"<br />
end<br />
<br />
-- Create the output buffer and add the table header<br />
local getBuffer, print, printf = newBuffer()<br />
print(genHeader(options, unit))<br />
local ranges = {}<br />
local rankOrderElev = options.rankOrder == RANK_ORDER.ELV<br />
<br />
-- Main processing loop<br />
for i=3,502,1 do<br />
local prom_cells, isoltn_cells<br />
local line = frame.args[i]<br />
if line == nil then break end<br />
<br />
debugv("line", line)<br />
local mtn = processLine(frame, options, line)<br />
if mtn then -- only do if no error<br />
if options.showRank then<br />
if rankOrderElev then<br />
if last_elev ~= mtn.elevation then<br />
rank_number = rank_number + 1 + same_rank<br />
mtn.rank = rank_number<br />
last_elev = mtn.elevation<br />
same_rank = 0<br />
else<br />
same_rank = same_rank + 1<br />
end<br />
else -- ranked by prominence<br />
if last_prom ~= mtn.prominence then<br />
rank_number = rank_number + 1 + same_rank<br />
mtn.rank = rank_number<br />
last_prom = mtn.prominence<br />
same_rank = 0<br />
else<br />
same_rank = same_rank + 1<br />
end<br />
end<br />
end<br />
<br />
if options.showRange and mtn.eid then<br />
processRange(ranges, mtn)<br />
end<br />
<br />
local elev_cells = getElevationCells(frame, mtn.elevation, unit)<br />
local prom = mtn.prominence<br />
if prom ~= nil and prom ~= -1 and prom ~= "" then<br />
prom_cells = getElevationCells(frame, prom, unit)<br />
else<br />
prom_cells = "&nbsp;||&nbsp;"<br />
end<br />
<br />
if options.showIsolation then<br />
local isoltn = mtn.isolation<br />
if isoltn and isoltn ~= -1 and isoltn ~= "" then<br />
isoltn_cells = getProminenceCells(frame, mtn.isolation)<br />
else<br />
isoltn_cells = "&nbsp;||&nbsp;"<br />
end<br />
debugv("isoltn_cells", isoltn_cells)<br />
end<br />
<br />
debug("elev=" .. mtn.elevation ..";elev_wd="..mtn.elevation_wd)<br />
if (options.showCustom1 or options.showCustom2) and mtn.elevation_wd ~= 0 and mtn.elevation ~= mtn.elevation_wd then<br />
local mm = "<br/><font color=green>Local/WD elevations mismatch: " .. "\"" .. mtn.elevation .. "\"".. "/\"" .. mtn.elevation_wd.. "\"</font>"<br />
mtn.custom = mtn.custom .. mm<br />
end<br />
<br />
print("|-\n|")<br />
if options.showRank then print("align=center|" .. mtn.rank .. "||") end<br />
print(mtn.name)<br />
if options.showCountry then printf("\n|%s", mtn.country) end<br />
printf("\n|%s\n", elev_cells)<br />
if options.showProm then printf("|%s\n", prom_cells) end<br />
if options.showIsolation then printf(TD .. "%s\n", isoltn_cells) end<br />
if options.showRange then printf(TD .. "%s\n", mtn.range) end<br />
if options.showFA then printf(TD .. "%s\n", mtn.fa) end<br />
if options.showCustom2 then printf(TD .. "%s\n", mtn.custom) end<br />
if options.showCoord or options.showTCoord then printf(TD .. "%s\n", mtn.coords) end<br />
<br />
end<br />
end -- for<br />
<br />
print(finish())<br />
if debug_on then<br />
printf("</br><nowiki>%s</nowiki>\n")<br />
end<br />
<br />
if string.len(errors) > 0 then<br />
printf("<font color=red>%s</font>\n", errors)<br />
end<br />
if options.debug and string.len(dbgout) > 0 then<br />
printf("<br/><font color=green>Debug output<br/>\n%s</font>\n", dbgout)<br />
end<br />
<br />
return getBuffer('')<br />
end<br />
<br />
--[[<br />
Test via Preview Window Debug console<br />
print(p.test())<br />
]]<br />
<br />
function p._test(doDebug)<br />
local frame = mw.getCurrentFrame()<br />
-- if frame then mw.logObject(frame) end<br />
-- local test_data = { {["e"]="3954",["p"]="[[Mount Robson]]",<br />
-- ["n"]="Highest point in the Canadian Rockies<ref name=robson/>"},<br />
-- {["e"]="3747",["p"]="[[Mount Columbia (Canada)|Mount Columbia]]",<br />
-- ["n"]="Highest point in [[Alberta]]<ref name=columbia/>"}<br />
-- }<br />
local sep = ","<br />
frame.args = {}<br />
frame.args[1] = 'm'<br />
frame.args[2] = OPT_NAMES.RANK..sep..<br />
OPT_NAMES.RANGE..COL_TITLE_SEP.."Mtn Range"..sep..OPT_NAMES.FA<br />
..sep..OPT_NAMES.PROM<br />
--..sep..OPT_NAMES.ISOLTN<br />
..sep..OPT_NAMES.TCOORDS<br />
..sep..OPT_NAMES.CUSTOM2..COL_TITLE_SEP.."Additional info"<br />
-- ..sep..OPT_NAMES.COUNTRY<br />
-- ..sep..OPT_NAMES.ORDER..COL_TITLE_SEP.."prom"<br />
if doDebug then frame.args[2] = frame.args[2] ..sep .. OPT_NAMES.DEBUG end<br />
<br />
frame.args[3] = "3954"..FS.."[[Mount Robson]]"..FS.."Highest point in the Canadian Rockies<ref name=robson/>"<br />
frame.args[4] = "3448"..FS.."[[Mount Saint Elias]]"..FS.."Canada/US border"<br />
frame.args[5] = "3310"..FS.."[[Mount Vaux]]"..FS.."Ottertail Range"<br />
frame.args[6] = "3204"..FS.."[[Ghost Mountain (Chaba Icefield)|Ghost Mountain]]"..FS.."<ref name=ghost/>"<br />
frame.args[7] = "2433"..FS.."[[Saddle Mountain (Alberta)|Saddle Mountain]]"..FS<br />
--[===[<br />
frame.args[3] = "3954"..FS.."[[Mount Robson]]"..FS.."Highest point in the Canadian Rockies<ref name=robson/>"<br />
frame.args[4] = "3747"..FS.."[[Mount Columbia (Canada)|Mount Columbia]]"..FS.."Highest point in [[Alberta]]<ref name=columbia/>"<br />
frame.args[5] = "3731"..FS.."[[North Twin Peak]]"..FS.."Highest peak of The Twins Massif"<br />
frame.args[6] = "3648"..FS.."[[Mount Clemenceau]]"..FS.."Named for [[Georges Clemenceau]], premier of France during WWI"<br />
frame.args[7] = "3619"..FS.."[[Mount Alberta]]"..FS.."Most difficult +11,000 climbing objective<ref name=alberta/>"<br />
frame.args[8] = "3618"..FS.."[[Mount Assiniboine]]"..FS.."Highest point in the Southern Rockies<ref name=assiniboine/>"<br />
frame.args[9] = "3612"..FS.."[[Mount Forbes]]"..FS.."Highest point within the confines of [[Banff National Park|Banff Nat'l Park]]<ref name=forbes/>"<br />
frame.args[10] = "3567"..FS.."[[Mount Goodsir]]"..FS.."Two major summits: South Tower and North Tower (lowest)"<br />
frame.args[11] = "3556"..FS.."[[South Twin Peak]]"..FS.."Lowest peak of The Twins Massif"<br />
frame.args[12] = "3543"..FS.."[[Mount Temple (Alberta)|Mount Temple]]"..FS.."Highest point near [[Lake Louise, Alberta|Lake Louise]]<ref name=temple/>"<br />
frame.args[13] = "3425"..FS.."[[Resplendent Mountain]]"..FS.."tbd"<br />
frame.args[14] = "3204"..FS.."[[Ghost Mountain (Park Ranges)|Ghost Mountain]]"..FS.."<ref name=ghost/>"<br />
--]===]<br />
-- frame.args[7] = ""<br />
-- frame.args[8] = "&nbsp;"<br />
--[[ Commented out<br />
local fi = 3<br />
for i=1,#test_data do<br />
frame.args[fi] = test_data[i]["e"] .. FS .. test_data[i]["l"] .. FS .. test_data[i]["n"]<br />
fi = fi + 1<br />
end ]]<br />
<br />
Options.test = true<br />
return p.list(frame)<br />
end<br />
<br />
function p.testd()<br />
return p._test(true)<br />
end<br />
<br />
function p.test()<br />
return p._test(false)<br />
end<br />
<br />
function p.test2()<br />
local s = '<a href="/wiki/Rainbow_Range_(Rocky_Mountains)" title="Rainbow Range (Rocky Mountains)">Rainbow Range</a>'<br />
--local i1,i2 = string.find(s,"%>(.*)%<%/a%>")<br />
local i1,i2 = string.find(s,"%b><")<br />
if i1 then <br />
mw.log("i1=" .. i1 .. " i2=" .. i2)<br />
mw.log(string.sub(s,i1+1,i2-1))<br />
else<br />
mw.log("not found")<br />
end<br />
end<br />
<br />
function p.test3()<br />
mw.log(stripBrackets("[[abc]]"))<br />
mw.log(stripBrackets("def"))<br />
mw.log(stripBrackets("[[Mount Victoria (Bow Range)|Mount Victoria]]"))<br />
mw.log("title=" .. getPageTitle("[[Mount Victoria (Bow Range)|Mount Victoria]]"))<br />
end<br />
<br />
function p.testR()<br />
local frame = mw.getCurrentFrame()<br />
frame.args = {}<br />
frame.args[1] = 'm'<br />
frame.args[2] = "debug,fa,tcoords,custom2:Easiest route"<br />
<br />
frame.args[3] = "3543"..FS.."[[Mount Temple (Alberta)|Mount Temple]]"..FS.."Moderate scramble on SW face"<br />
frame.args[4] = "3492"..FS.."[[Mount Hungabee|Hungabee Mountain]]"..FS.."[[International Climbing and Mountaineering Federation|UIAA]] III 5.4 on West ridge"<br />
frame.args[5] = "3464"..FS.."[[Mount Victoria (Bow Range)|Mount Victoria]]"..FS.."UIAA II on SE ridge, South Summitend"<br />
<br />
Options.test = true<br />
return p.list(frame)<br />
end<br />
<br />
return p<br />
<br />
--[[<br />
{| class="wikitable sortable"<br />
|- bgcolor="#ffffcc"<br />
! align="left" rowspan=2|Rank||rowspan=2|Mountain/Peak ||colspan=2|Elevation ||colspan=2| Prominence ||rowspan=2| Subrange<br />
!rowspan=2| FA ||rowspan=2| Notes ||rowspan=2| References<br />
|-<br />
!m || ft || m || ft<br />
|-<br />
|align=center|1||Mount Robson<br />
|{{elevation_cells|3,959|m}}|{{elevation_cells|2829|m}}||Rainbow Range<br />
|1913||Highest point in the Canadian Rockies|| <ref name=robson/><br />
]]</div>
RedWolf