Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Wikitech

235 Auto unit conversion

 

 

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded


sylvain at chicoree

Nov 19, 2009, 9:04 PM

Post #1 of 6 (768 views)
Permalink
235 Auto unit conversion

Hi,

There is an issue concerning unit conversions in wikitext:
https://bugzilla.wikimedia.org/show_bug.cgi?id=235

This one doesn't deserved any attention since a long time. The original
proposition was about converting units "on the fly" regarding user preferences.
I don't know if it is feasible and/or desirable.

I propose to work on something less ambitious: adding a parser function to
provide conversion - maybe in ParserFunction.

The idea would be something like:
{{#unit: 1000 ft|m}} => <span title="304m (1000ft)">304m</span>


If I start working on this, will anyone accept to review the code?


Thanks in advance,
Sylvain.

--
sylvain [at] chicoree
http://www.chicoree.fr



_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


jcsahnwaldt at gmail

Nov 19, 2009, 10:05 PM

Post #2 of 6 (720 views)
Permalink
Re: 235 Auto unit conversion [In reply to]

Why not just use http://en.wikipedia.org/wiki/Template:Convert ?

On Fri, Nov 20, 2009 at 06:04, Sylvain Leroux <sylvain [at] chicoree> wrote:
> Hi,
>
> There is an issue concerning unit conversions in wikitext:
> https://bugzilla.wikimedia.org/show_bug.cgi?id=235
>
> This one doesn't deserved any attention since a long time. The original
> proposition was about converting units "on the fly" regarding user preferences.
> I don't know if it is feasible and/or desirable.
>
> I propose to work on something less ambitious: adding a parser function to
> provide conversion - maybe in ParserFunction.
>
> The idea would be something like:
> {{#unit: 1000 ft|m}} =>  <span title="304m (1000ft)">304m</span>
>
>
> If I start working on this, will anyone accept to review the code?
>
>
> Thanks in advance,
> Sylvain.
>
> --
> sylvain [at] chicoree
> http://www.chicoree.fr
>
>
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


wiki at konsoletek

Nov 19, 2009, 11:01 PM

Post #3 of 6 (723 views)
Permalink
Re: 235 Auto unit conversion [In reply to]

{{Convert}} on Wikipedia isn't one single fancy template, it is actually
several hundred. I ran Special:Export and told it to include all the sub
template, and I got back a file with 394 pages, a few of them might be
documentation, but you get the idea. I'd love to see this sort of
functionality be put into MediaWiki somewhere, rather than crazy template
hacking.

-Jon

PS. We tried to steal {{Convert}} on Wikipedia to use on Wikinews... we
eventually gave up and stuck to the handful of separate templates we had
before.

On Thu, Nov 19, 2009 at 22:05, Jona Christopher Sahnwaldt <
jcsahnwaldt [at] gmail> wrote:

> Why not just use http://en.wikipedia.org/wiki/Template:Convert ?
>
> On Fri, Nov 20, 2009 at 06:04, Sylvain Leroux <sylvain [at] chicoree> wrote:
> > Hi,
> >
> > There is an issue concerning unit conversions in wikitext:
> > https://bugzilla.wikimedia.org/show_bug.cgi?id=235
> >
> > This one doesn't deserved any attention since a long time. The original
> > proposition was about converting units "on the fly" regarding user
> preferences.
> > I don't know if it is feasible and/or desirable.
> >
> > I propose to work on something less ambitious: adding a parser function
> to
> > provide conversion - maybe in ParserFunction.
> >
> > The idea would be something like:
> > {{#unit: 1000 ft|m}} => <span title="304m (1000ft)">304m</span>
> >
> >
> > If I start working on this, will anyone accept to review the code?
> >
> >
> > Thanks in advance,
> > Sylvain.
> >
> > --
> > sylvain [at] chicoree
> > http://www.chicoree.fr
> >
> >
> >
> > _______________________________________________
> > Wikitech-l mailing list
> > Wikitech-l [at] lists
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> >
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>



--
Jon
[[User:ShakataGaNai]]
http://snowulf.com/ - Blog
http://snowulf.imagekind.com/ - Pictures
This has been a test of the emergency sig system.
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Simetrical+wikilist at gmail

Nov 21, 2009, 3:25 PM

Post #4 of 6 (703 views)
Permalink
Re: 235 Auto unit conversion [In reply to]

On Fri, Nov 20, 2009 at 12:04 AM, Sylvain Leroux <sylvain [at] chicoree> wrote:
> The idea would be something like:
> {{#unit: 1000 ft|m}} =>  <span title="304m (1000ft)">304m</span>

It would make more sense to have it output simply "304". That way it
could be effectively used in a template to achieve any desired
formatting.

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


sylvain at chicoree

Nov 23, 2009, 5:24 AM

Post #5 of 6 (689 views)
Permalink
Re: 235 Auto unit conversion [In reply to]

First of all, thanks for your replies.


In short, in my first message, I failed to explain the targeted use case - which
has somehow moved away from BUG-235. So here it is:
o I was targeting general MediaWiki wikis, not necessary Wikipedia
o My primary concern was to allow an administrator to easily add support for
conversion. Without relying on the end-users (the "contributors") good will or
technical knowledge.


Now for the long answer.

wiki [at] konsoletek wrote:
> {{Convert}} on Wikipedia isn't one single fancy template, it is actually
> several hundred.
I think it is actually several hundred with the new design (as of NOV-2009), but
the old design was requiring several thousands (!) templates. According to [1]
with the new design "new options could be implemented by changing just a few
subtemplates, rather than hundreds at a time".


jcsahnwaldt [at] gmail wrote:
> Why not just use http://en.wikipedia.org/wiki/Template:Convert ?
On its side, {{Convert}} has the advantage of being able to convert many
different things. Keeping it with the vast diversity of knowledge carried by
wikipedia (from converting musical notes to pitch [3] to converting weapon
calibres [4], all of this with several different algorithms). Moreover, by
working at "template level", any contributor is able to edit/update/fix it.
Without requiring any special privilege.

Someone may argue that it has its own drawbacks[2], but anyway Wikipedia is a
special case: it has enough manpower to fix and/or update both this template and
the articles that uses (or should use) it.

This is simply not the case for the general MediaWiki user. I think of one "in
house" wiki that requires handling of some fancy units. Like expressing
quantities as kibibytes as well as kilobytes. Or express throughput as bytes/s
or bits/s. Eventually using those values for producing embedded graphics.
I don't think those units are supported by {{Convert}} now, and the point is
that it requires a substantial amount of work for a non-specialist of that
template to add support for them.
For small wikis, I think it is more effective to let the administrator install a
new extension or edit a few lines of PHP to provide the support for a new
conversion.


Aryeh Gregor <Simetrical+wikilist [at] gmail> wrote:
>> The idea would be something like:
>>> {{#unit: 1000 ft|m}} => <span title="304m (1000ft)">304m</span>
>
> It would make more sense to have it output simply "304". That way it could
> be effectively used in a template to achieve any desired formatting.
I agree with that. In order to be effectively used in template, the "converter"
should only perform the conversion and let the formating at the caller's charge.


Last, but not least, I spend a few hours this WE working on a prototype. It
sounds promising. I intend to upload a demo in the following hours.



Best regards,
Sylvain.


----
[1] http://en.wikipedia.org/wiki/Wikipedia:A_plan_to_reduce_Convert_subtemplates
[2] http://en.wikipedia.org/wiki/Wikipedia:Analysis_of_Template:Convert_problems
[3] http://en.wikipedia.org/wiki/Template:Convert/note
[4] http://en.wikipedia.org/wiki/Template:Convert/calibre


Aryeh Gregor a écrit :
> On Fri, Nov 20, 2009 at 12:04 AM, Sylvain Leroux <sylvain [at] chicoree> wrote:
>
>
>
>> The idea would be something like: {{#unit: 1000 ft|m}} => <span
>> title="304m (1000ft)">304m</span>
>
> It would make more sense to have it output simply "304". That way it could
> be effectively used in a template to achieve any desired formatting.
>
> _______________________________________________ Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

--
sylvain [at] chicoree
http://www.chicoree.fr



_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


sylvain at chicoree

Nov 23, 2009, 6:35 AM

Post #6 of 6 (690 views)
Permalink
Re: 235 Auto unit conversion [In reply to]

Here is a demo of the current prototype:
http://www.chicoree.fr/w/UConvert

As you will see, the core functionalities are here. Since my objective was to
have a working version quickly, I need to spend some time now to clean-up the
code before releasing an alpha version.

Sylvain.



_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.