There are two table plugins shipped with the kernel;
EditTablePlugin and
TablePlugin. They both give me a bit of discomfort because they both perform a parse of the topic text to extract tables and format them. In
EditTablePlugin this parse is done in the
commonTagsHandler. In
TablePlugin it is done in the
preRenderingHandler.
I have a number of questions about this:
- Since there is already a parse of table syntax in Render.pm that makes three components all trying to do the same thing, doesn't it? Would it be possible/sensible to collapse these into a single pass?
- TablePlugin always parses and formats tables, even when there are no TABLE tags. Is this just to support column sorting? If so, there is a highly efficient JavaScript column sorter available (http://www.kryogenix.org/code/browser/sorttable/
) that would be a much better solution to this specific problem.
- If we are going to ship TablePlugin, and it always parses and formats tables, why do we bother formatting tables in Render.pm?
--
CrawfordCurrie - 28 Mar 2005
If we are always going to ship
TablePlugin then why not factor it into Render.pm anyway?
Which raises the itneresting corollary: if certain plugins are shipped with the core, why not factor them into the core and save the overhead of plugin handling. Some things like
SessionPlugin would probably be better done in the core anyway.
If necessary we could have a
TWikiPreferences setting to turn them on/off
--
AntonAylward - 28 Mar 2005
I don't know if that's the original idea, but having a micro-kernel with just the minimun functionality and alot of surrounding modules extending it is more flexible (and more maintainable) than having a single monolitic kernel.
--
RafaelAlvarez - 28 Mar 2005
Agreed with Rafael.
Answers to Crawford's questions:
- EditTablePlugin and TablePlugin need to be done at different rendering times. The EditTablePlugin should be done as early as possible. The TablePlugin is done late in the game because internal TWikiVariables and and Plugins might introduce tables.
- For sorting, yes. JavaScript should not be used as the sole way of providing functionality (see TWikiMission)
- The TablePlugin overloads the TWiki internal table rendering (and provides additional functionality). TWiki's internal table rendering should not be removed since Plugins can be disabled alltogether. (Similarly, a Plugin could overload the internal TOC handling to provide additional functionality)
--
PeterThoeny - 29 Mar 2005