On Tue, 23 Apr 2013 11:06:13 -0700, Yuvi Panda <yuvipa...@gmail.com> wrote:

For wider distribution!


---------- Forwarded message ----------
From: Jon Robson <jdlrob...@gmail.com>
Date: Tue, Apr 23, 2013 at 5:13 AM
Subject: [WikimediaMobile] Rethinking MobileFormatter / Skins
To: mobile-l <mobil...@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!

[1] https://gist.github.com/jdlrobson/5439509

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

Reply via email to