View source for Module:Convert/makeunits
MyWikiBiz, Author Your Legacy — Wednesday June 04, 2025
Jump to navigationJump to searchYou do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
-- This module generates the wikitext required at Module:Convert/data
-- by reading and processing the wikitext of the master list of units
-- (see conversion_data for the page title).
--
-- Script method:
-- * Read lines, ignoring everything before "== Conversions ==".
-- * Process the following lines:
-- * Find next level-3 heading like "=== Length ===".
-- * Parse each following line starting with "|"
-- (but ignore lines starting with "|-" or "|}".
-- * Split such lines into fields (delimiter "||") and trim
-- leading/trailing whitespace from each field.
-- Remove any "colspan" at front of second field (symbol).
-- * Remove thousand separators (commas) from the scale field.
-- If the scale is a number, do not change it.
-- Otherwise, it should be an expression like "5/9", in
-- which case it is replaced by the value of the expression.
-- * Remove wiki formatting '[[...]]' from the link field.
-- * Remove redundant fields from the unit to reduce size of data table.
-- * Create alternative forms of a unit such as an alias or a combination.
-- * Stop processing when encounter end of text or a line starting
000
1:0
Template used on this page:
Return to Module:Convert/makeunits.