User:Ohconfucius/script/tometricunits

Objectives
Main objectives, as applied to mainspace articles, are as follows:
 * 1) ensure the most commonly used "bare" measures, notably imperial, have corrresponding SI units of measure in accordance with WP:MOS.

General principles
The rationale and principles applied are as follows:
 * insert convert template to the following numerical non-metric units of measure (for ranges and individual measures)
 * inches, feet, yards, miles
 * pounds
 * feet per second, miles per hour
 * acres, square feet, square yards, square miles

Installing the script
  Open [ your common.js in edit mode] (alternatively, go to your user page and append "/common.js" to the end of the URL and open the page in edit mode).   If you prefer to load this only on a specific skin, such as monobook, open [ your monobook.js in edit mode].  If you make a straight copy of this script, instead of "importing" it, you may not benefit from the enhancements and bug-fixes that are made from time to time. In the latter case, you may choose to watchlist this page so you will know when to update your copy for modifications to this script.   Copy the following code onto the JavaScript page you have chosen in the previous step:

  Save the page and (re-)load it – refresh the cache by following the instructions at the top of your JavaScript page.  Bookmark the script page. This will be your cue to purge the cache on your browser for any updates to take effect.  
 * If you have automatic userscript installation enabled, you can simply visit User:Ohconfucius/script/.js and click "Install" at the top of the page.

Actions and test
Link to script code: User:Ohconfucius/script/tometricunits.js

Speed of script execution may vary depending on browser.

Should the script stall when working on large articles, press  on the pop-up menu – once is usually sufficient.

Known limitations or contraindications

 * 1) The following are not supported:
 * 2) * insertion of templates to convert away from metric measures
 * 3) *The list of measures is limited and is not exhaustive: PSI (pounds per square inch), FPS, nautical miles are not within the scope of the script.
 * 4) *two-dimensional measures as given by x times y (e.g. 8 ft x 6 ft), x by y (e.g. 8 ft by 6 ft);
 * 5) *three-dimensional measures as given by x times y times z, (e.g. 3 ft x 5 ft x 7 ft), x by y by z, (e.g. 2 ft by 8 ft x è ft),
 * 6) Some situations may give rise to false positives where simply the last unit is tagged with a convert template. This will be the case for the two- and three-dimensional measures
 * 7) Where manual converted measures are already in place in an article, the script may cause appearance of an additional converted unit such as   becoming
 * 8) There are no protected strings. Anything in the open edit window is susceptible to change. Be aware of false positives with article names, titles, file names.

Disclaimer
Users are expected to exercise careful judgement in the context of each article in which they run this script. Use at your own risk and make sure you check the edit changes before you save. It's not my fault if someone misuses this script.

Test page

 * User:Ohconfucius/script/units of measure/test