[Solar-talk] Wiki links
Paul M Jones
pmjones at ciaweb.net
Mon May 28 13:59:43 PDT 2007
Hi Antti,
> 1. How can I add base paths for 'read' and 'add' wiki links (it's the
> _attribs property in Solar_Markdown_Wiki_Link)? There's setAttrib()
> but how can I call it? How about the interwiki hrefs? Shouldn't there
> be config keys for a lot of the wiki stuff, or do they work
> differently?
You've already figured this out, I think, but to recap:
You should be able to call $markdown->getPlugin('link'), which will
get you the Solar_Markdown_Wiki_Link object. You can then $plugin-
>setAttrib() to set the various attributes on that object.
> 2. What is the intended way of naming wiki links?
The idea with Solar_Markdown_Wiki is to match the Wikipedia
convention for link markup, which leads to the normalizing you
noticed. If you want, you can extend Solar_Markdown_Wiki_Link and
override the _normalize() method, which will let you normalize link
names any way you like. However, you then need to extend
Solar_Markdown_Wiki and replace the old rule name with your new one.
(On further consideration, I can see that adding config keys for the
plugins and the "master" processor classes would be a good idea;
happy to take suggestions here.)
> I see that
> Solar_Markdown_Wiki_Link normalizes the names to be capitalized and
> replaces spaces to underscores. Now, the problem is that
> Solar_Uri(_Action) seems to make all links lowercase, so I can't
> create links to wiki pages with the action helper.
Does it? I thought that the the Solar_Uri methods pretty much left
the input alone. Can you give an example here?
> Also, mysql
> SELECTs are not case sensitive so things seem to work even though they
> shouldn't. I want *all* the page names to be named the same way,
> probably how Solar_Markdown_Wiki_Link names them. I want them to be
> named correctly in the DB too. How could one handle these
> inconsistencies? Any tips, good practices?
You're correct on MySQL not honoring case by default; I think you
would need to change the collation to something that is case-
sensitive, perhaps "utf8_bin".
Let me know if this helps (or not) and thanks for your patience. :-)
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Join the Solar community wiki! <http://solarphp.org>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the solar-talk
mailing list