|
From: Ron G. <ron...@gm...> - 2009-03-23 23:26:41
|
On Mar 23, 2009, at 4:05 PM, Waylan Limberg wrote:
> On Mon, Mar 23, 2009 at 4:21 PM, Ron Garret <ron...@gm...>
> wrote:
>>
>> On Mar 23, 2009, at 1:08 PM, Waylan Limberg wrote:
>>
>>> Thanks for the feedback Ron. I've responded you your concerns
>>> below to
>>> keep things in context.
>>>
>>> On Mon, Mar 23, 2009 at 3:19 PM, Ron Garret <ron...@gm...>
>>> wrote:
>>>>
>>>> 1. The wikilink behavior has changed in a non-backwards-compatible
>>>> way.
>>>> Before, [[WikiLink]] and [[wiki link]] were equivalent. Now they
>>>> are not.
>>>> Personally, I preferred the old way.
>>>
>>> What was the old way? I don't remember changing that. Could you
>>> provide an example of the current output and the expected output?
>>>
>>
>>
>> The old one converted spaces to CamelCase. The new one converts
>> spaces to underscores.
>>
> Oh, sorry I misunderstood you. You put brackets around both. The old
> way worked only on CamelCase and did not use brackets at all. The new
> way only uses brackets and ignored case. If you notice, the extension
> name even changed from "wikilink" to "wikilinks" (the "s" was added)
> so that old code would not work without changes with the new
> extension. The point is, this is actually a different extension.
>
> As Yuri pointed out, this is actually considered a better wikilink
> syntax. Of course, you are free to implement the old syntax if you
> can. We ran into a few technical difficulties with some of the other
> changes in the code, which is why we dropped the old. But we'd be be
> happy to add it back in if you can get it to work.
Doh! I just remembered...
We had this discussion about CamelCase versus [[brackets]] before and
you convinced me that brackets were better. So I actually went and
changed the old wikilink (no 'S') extension to use brackets. But I
forgot that I had done that, and I didn't change the name of the file,
so I just thought this was the way the old extension worked.
So forget everything I said about the way things used to work :-)
Instead, I would suggest ab initio that wikilinks be canonicalized
through a user-configurable canonicalizer that defaults to Wikipedia's
canonicalization rules. This would be a very simple change to make.
Just change:
label.replace(' ', '_')
to
self.canonicalize(label)
and then add 'canonicalize' to configs, defaulting to
wikipedia_canonicalize (which someone would still need to write, but
that's not hard).
Here's the CamelCase canonicalizer that I personally prefer:
def camelCase_canonicalize(s):
return ''.join([w[0].upper()+w[1:] for w in s.split()])
rg
|