Since I know this will not get implemented in the near future, I decided to try my hand at a user script.
Warning: This is not production-quality code. It's not even beta. It's not even alpha. It's something I threw together in maybe 2 or 3 hours of combined coding and testing.
Disclaimers aside, it does seem to work on most of the Imperial measurements posted on this site. So don't be afraid to give it a try and report anything that's seriously broken. And if it ends up breaking more than it fixes, just uninstall it.
What this script does:
- Searches for U.S. Imperial measurements posted in answers.
- Wraps them in a help-style link and adds a tooltip with the converted unit.
- Whole (1 tsp), fractional (1/2 tsp), and decimal (1.5 qt) measurements.
- Units: ° F, teaspoons, tablespoons, ounces, fluid ounces, cups, quarts, pounds.
- Tries to ignore units inside URLs, but this hasn't been tested extensively.
What this script doesn't do (yet):
- Search in comments. (Concerned about performance and deferred loading.)
- Compound fractions (e.g. "1 1/2 cups"). It only sees the fraction.
- Temperature ranges where the unit is only written once (e.g. "350-450° F").
- Try to guess if "oz" really means dry ounces or fluid ounces. Not touching that one with a fifty-foot pole. Americans, don't be lazy, write your units out properly.
- Any unit conversions other than the one specified above.
- Any kind of interactive features.
- Know the difference between "C" for Cups and "C" for Celsius. However, it uses some number thresholds to make an educated guess, since these two are rarely in the same range.
- Convert units as you type, or in post previews. This is purely for reading posts, not writing.
- Convert units the other way (Metric --> Imperial) - it really only makes sense to do one at a time, but when this is a little more stable I can just reverse most of the formulas and put up an alternate script for U.S. viewers.
I'll try to find some time every now and then to work on improvements. No promises though.
And here's my little sandbox/demo/proof-of concept (try viewing this with the script installed):
- 1/2 C chicken or vegetable stock
- 1 fl oz Brandy
- 1 (14 oz) can tomato sauce
- 1 fluid ounce of vodka
- (Optional) 8 fl. oz. Dry White Wine
- 3 ounces parmesan cheese
- Add 2 Tbsp sugar
- Add 1.5 tbs. cream
- ...or .5 tbs. butter
- Stir in 1/4 tsp. salt
- 1/2 tsps black pepper
- 1/2 teaspoon crushed red pepper
- 3 tablespoons of water
- 350 F
- Makes 4 quarts, or 3 qts. if no wine is used
- 1 flat cookie sheet
- Bake at 350° F
- Bake at 425F for 30 minutes
- ...until the internal temperature reaches 165 degrees F or the juices run clear
- This 1 tbsp in tsp link should not be broken