Daniel Great to hear I'm not alone in my thoughts. Things like the edit section link shouldn't have to be hacked in at the parser level - if the parser returned the components of a page it would be trivial for the skin to add these itself.
The fact you are resorting to hacks to do things which should be trivial (the infoboxes is a great example) suggest that this is a smell that would be good to fix.
I can't help but think of Wikipedia redefined [1] which had some interesting ideas that alas would be very hard to try out in the current setup.
Another example I can give is in mobile is we render cleanup templates as an overlay as these can fill an entire mobile screen on certain articles making the content unreadable (very much against "a world in which every single human being can freely share in the sum of all knowledge." :)). We have had to add some javascript which collapses them but it would be great to have a better solution for non-javascript users (maybe hide the cleanup templates or put them at the bottom of the page and create a link to that at the top for those who need them) as currently this "a world in which every single human being" ... with javascript .. " can freely share in the sum of all knowledge." :)
[1] http://www.wikipediaredefined.com/
On Tue, Apr 23, 2013 at 11:52 AM, Daniel Friesen daniel@nadir-seen-fire.com wrote:
On Tue, 23 Apr 2013 11:06:13 -0700, Yuvi Panda yuvipanda@gmail.com wrote:
For wider distribution!
---------- Forwarded message ---------- From: Jon Robson jdlrobson@gmail.com Date: Tue, Apr 23, 2013 at 5:13 AM Subject: [WikimediaMobile] Rethinking MobileFormatter / Skins To: mobile-l mobile-l@lists.wikimedia.org
I've been playing around with skins a lot recently. The MobileFrontend extension has had to do various transformations to the content pre-rendering to ensure certain things do not get rendered on mobile (for example table of contents) as well as allow us to do collapsible sections.
When rendering content skins are currently limited to rendering the 'bodytext' key. They cannot retrieve the underlying content. I would like to remove restrictions to skin designers - for instance currently a skin designer has no control over where the table of contents should do. They could not easily put it in a side bar for instance.
I was experimenting with using the onOutputPageParserOutput hook [1] (running based on the current skin) and think it might be a better approach to run the transformations on smaller chunks of data. For instance the table of contents is known to be in the lead section so it seems like it would be more efficient to look for it there rather than throughout the entire document. The solution is not complete but provides an approach that I think would be more efficient on the long term.
Partially for other reasons I have contemplated making the TOC a post-parse task. A placeholder gets put into the skin where the TOC goes. Then the TOC is inserted afterwards. Though 'when' is a little different in the situation I'm thinking of. In that situation I'm just thinking of deferring it to ParserOutput::getText. The same way we defer the editsection link.
It seems like a good idea to experiment with this approach in MobileFrontend extension with the goal to upstream it to core.
Would appreciate comments from people who know this area of code rather well - Max comes to mind :)
I haven't given that much thought to it as a part of core. But the idea of marking off various parts of the page content as components that can be considered separate from the content and removed is an interesting idea. Both TOC and parts of the content.
I've actually hacked things like that into live sites.
Blocks of mainpage content moved to the sidebar: http://www.dragonballencyclopedia.com/wiki/Dragon_Ball_Encyclopedia
Infoboxes moved to the sidebar: http://www.dragonballencyclopedia.com/wiki/Son_Goku_%28anime_character%29
I also did it fairly recently for a client's (EAW's) wiki. But they don't appear to have updated their content to make it work yet.
Thoughts welcomed!
It's not directly related but in my plins to rewrite the skin system I have considered something relevant. A little stale but somewhat readable. https://www.mediawiki.org/wiki/User:Dantman/Skinning_system/Regions https://www.mediawiki.org/wiki/User:Dantman/Skinning_system/New_skin_layout
-- ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l