On 13/03/07, Chris Marmo wiki@prosimian.com.au wrote:
Thanks for the replies everyone.
Having recently played with this code I can say it sounds like a good idea to me. The TOC code is tied to the parser and the output more strongly than it need be. It should be free to be output as part of the skin or part of the article. It should be quite easy to implement.
Andrew - I agree completely. I think hacking up the parser class would be easy, however I don't want to mess with the core code. I'd rather build this as an extension on top of what already exists. I've tried extending the class and overriding the Parser::formatHeadings() function but I don't know enough about hooks, etc at the moment to make an informed decision about the best way to go about this.
For my current project CSS positioning isn't an option because I need to position the TOC in another column relative to the actions bar (which I'm displaying vertically). Because both the TOC and Actions bars increase/decrease in size absolute positioning wont cut it, unfortunately.
Again, any suggestions from developers would be received with great appreciation :)
Oftentimes when you're doing something new there is not yet any hook in the right place. Adding a new hook is trivial and typically only adds one line to the core code. In the work I mentioned above I added two hooks. One to allow extra stuff where the [edit] links are added and one to allow an alternative algorithm for generating the TOC and the headings since this code is glommed together now.
Because you're typically only adding one line, svn updates usually cause no problem. And if you want others to benefit from your new hook you can post it to Bugzilla as a feature request with your patch. If the devs see a better way to do it they will usually say so or even implement an improved version right away.
Good luck.
Andrew Dunbar (hippietrail)
Best Regards, Chris
On Mar 13, 2007, at 11:20 PM, Andrew Dunbar wrote:
Andrew Dunbar (hippietrail)
-- http://wiktionarydev.leuksman.com http://linguaphile.sf.net
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l