Revision as of 21:08, 6 September 2007 editTomTheHand (talk | contribs)19,190 edits →unlinking []← Previous edit | Revision as of 21:25, 6 September 2007 edit undoIpoellet (talk | contribs)Autopatrolled, Extended confirmed users26,138 edits New section: Unlinking datesNext edit → | ||
Line 50: | Line 50: | ||
::I posted about this on the WP:SHIPS talk page ] if you'd like to participate. I'm not sure what consensus will wind up being, but if it's decided that linking '''ft''' is excessive, could you please remove linked inches as well? It looks odd to unlink '''ft''' and leave '''in''' linked. ] 21:08, 6 September 2007 (UTC) | ::I posted about this on the WP:SHIPS talk page ] if you'd like to participate. I'm not sure what consensus will wind up being, but if it's decided that linking '''ft''' is excessive, could you please remove linked inches as well? It looks odd to unlink '''ft''' and leave '''in''' linked. ] 21:08, 6 September 2007 (UTC) | ||
== Unlinking dates == | |||
Hi, Lightmouse. I notice that you removed the links from years and similar date elements in ]. I appreciate that the use of links on plain-English phrases can seem excessive. But my logic was that, in the case of historic sites, linking the dates could be a quick and easy way to provide the reader with a way to look at the wider historic context for a site. Can you share your thinking on why the links should be removed? ] 21:25, 6 September 2007 (UTC) |
Revision as of 21:25, 6 September 2007
Monobook
Thanks, re this, I added your script to my user space. Now, as I said that I don't have training, could you direct me to a resource that I can use to get to know how to use scripts like this in WP? Thanks again. Michael Patrick 22:59, 28 August 2007 (UTC)
- Aha. That's really cool and really convenient. I think I'll go metricate up a storm. Thank you. Michael Patrick 17:24, 29 August 2007 (UTC)
- Yes, I'm checking each edit. I get a few redundant edits (already metricated), some incorrect precision (like when "100 miles" means "exactly 100 miles"), etc., but I catch them. Thanks again. Michael Patrick 20:00, 29 August 2007 (UTC)
- Try the script on Oakland, California. It appears that non-breaking spaces confuse the script. Michael Patrick 14:45, 30 August 2007 (UTC)
- Yes, I'm checking each edit. I get a few redundant edits (already metricated), some incorrect precision (like when "100 miles" means "exactly 100 miles"), etc., but I catch them. Thanks again. Michael Patrick 20:00, 29 August 2007 (UTC)
- Aha. It was not the non-breaking space. It was the position of the open parenthesis character '('. The code looks within two characters of 'ft' so it will handle 'x ft (y m)', I forgot that it also needs to handle a period as in 'x ft. (y m)'
- I have fixed that. Thanks for letting me know. Lightmouse 17:16, 30 August 2007 (UTC)
Monobook part deux
So your script will only convert imperial to metric and not metric to imperial? —MJCdetroit 12:39, 5 September 2007 (UTC)
- Correct. You are welcome to copy it and modify it to do that. Lightmouse 12:40, 5 September 2007 (UTC)
- Holy smokes that was quick response. I may tinker with it a little as I think it would be beneficial to go both ways, but I am not familiar with the monobook script code. After all I am a chemist and not a computer programmer. So it may take a little trial and error. Regards, —MJCdetroit 12:46, 5 September 2007 (UTC)
- Good luck. I am not a programmer either. I got it through blatent theft of code from others plus trial and error.
- As you probably noticed, I am pro-metric. I sometimes edit non-metric units for consistency (you will see some of those in the code) because I am 'unit aware' (as you seem to be). I would prefer us all to work towards metrication rather than the other direction. However, I will share my limited knowledge of script if you want to produce your own bidirectional code. Lightmouse 13:55, 5 September 2007 (UTC)
- Sorry, I prefer U.S. customary and I'm a scientist (shocking--I know), but am I not anti-metric. I very often add metric values when not present. I just think everyone should be given all the information available to help them. I don't think someone in Europe should read: 30 miles long and think, now what is 30 miles. Likewise, I don't think that someone in the U.S. or U.K. should be reading an article where they have to stop and think about what 48 kilometres are. I'll play with the code when I have time and let you know if I have any problems.—MJCdetroit 14:31, 5 September 2007 (UTC)
- Holy smokes that was quick response. I may tinker with it a little as I think it would be beneficial to go both ways, but I am not familiar with the monobook script code. After all I am a chemist and not a computer programmer. So it may take a little trial and error. Regards, —MJCdetroit 12:46, 5 September 2007 (UTC)
How to do arithmetic conversions
Lightmouse,
Sure, I could give you a few hints about all that #if: stuff, that one, for example, checks the presence or absence of stuff so, e.g., when you transclude {{#if:{{{1|}}}|something|nothing}}
this will give you something if parameter {{{1}}}
is given but will give nothing otherwise ... of course before that makes any sense you've got to look closely at the {{{1|}}}
bit and note the pipe character. Whatever appears to the right of the pipe (still within the triple curlies) is the default value, e.g., {{{1|a}}}
will give you a if no parameter {{{1}}}
is given otherwise it will take the value provided. Note then how there's nothing to the right of the pipe in the above #if: example. {{{1|}}}
just vanishes when no {{{1|}}}
is given. Let's try this then ...
{{#if:anything|something|nothing}}
gives something{{#if:|something|nothing}}
gives nothing
Well, that's the basics of #if: but of course there's also #expr:, #ifexpr:, #ifeq:, #switch:, etc. All great fun, but a good place to read up on them would be m:Help:Calculations. Don't hesitate to ask for another hint or two, though.
Good luck Regards Jɪmp 16:22, 5 September 2007 (UTC)
- Thanks. Could I ask you to help me with a real example from my monobook. For example, it metricates torpedo diameter using:
- txt.value=txt.value.replace(/\s(\d\d)(?:\s|-| )inch(?:\s|-| )torpedo/gi, ' {{convert|$1|in|mm|0|sing=on}} torpedo');
- txt.value=txt.value.replace(/\s(\d\d)(?:\s|-| )inch(?:\s|-| )torpedo/gi, ' {{convert|$1|in|mm|0|sing=on}} torpedo');
- Thus '21 inch torpedo' becomes '21 inch (533 mm) torpedo'. However, it puts the convert template into the article. How might I do the arithmetic in my monobook so that the article is free of the convert template? Lightmouse 17:31, 5 September 2007 (UTC)
- I'm afraid I'm no expert on monobook use. No ideas spring to mind but if do think of a solution, I'll keep you posted. Jɪmp 02:55, 6 September 2007 (UTC)
unlinking ft
Hey Lightmouse! I think you're doing good work, but I wanted to ask for details on one thing. I noticed (for example, on USS Tunny (SS-282)), that where I've linked the first use of "ft" to Foot (unit of length), you're removing those links. However, you're leaving "in" linked, which may be an oversight. I feel that in addition to providing conversions for U.S. units, it's a good idea to link their first use so that people who may be unfamiliar with a foot can learn about what it is instead of just looking at the meter conversion. Could we discuss this? TomTheHand 18:24, 6 September 2007 (UTC)
- Sure we can discuss it. I think that common units are just like plain english. So thousands of links across Misplaced Pages seems weird to me. It isn't a big thing. As you point out with inches, I am not consistent. Lightmouse 18:38, 6 September 2007 (UTC)
- I posted about this on the WP:SHIPS talk page here if you'd like to participate. I'm not sure what consensus will wind up being, but if it's decided that linking ft is excessive, could you please remove linked inches as well? It looks odd to unlink ft and leave in linked. TomTheHand 21:08, 6 September 2007 (UTC)
Unlinking dates
Hi, Lightmouse. I notice that you removed the links from years and similar date elements in List of U.S. National Historic Landmarks by state. I appreciate that the use of links on plain-English phrases can seem excessive. But my logic was that, in the case of historic sites, linking the dates could be a quick and easy way to provide the reader with a way to look at the wider historic context for a site. Can you share your thinking on why the links should be removed? Ipoellet 21:25, 6 September 2007 (UTC)