...making Linux just a little more fun!

[elinks-users] elinks friendly wiki

Thomas Adam [thomas.adam22 at gmail.com]
Tue, 5 Dec 2006 23:30:09 +0000

[Bcc'ed tag@lists.linuxgazette.net for inclusion into LG at some point.]

On Tue, Dec 05, 2006 at 11:21:52PM +0100, Jonas Fonseca wrote:

> On 12/4/06, Michael Thompson <miket@ilm.com> wrote:
> >does such a thing exist?
> I've never personally used ELinks to edit a wiki, however
> I have heard about various problems related to the poor
> caching and encoding support of ELinks. Maybe you can
> share a bit more about any problems you have encountered?

I am assuming more that Michael meant one that displays properly in ELinks. Of course, this is related to the limited CSS capabilities that ELinks currently has, but it's not all doom and gloom depending on the wiki engine ELinks is looking at.

In my experience, Wikipedia, and other sites which use Wikimedia are the worst if only because they're very CSS-intensive -- and don't really give much, if any, consideration for people who use text-based browers or even screen-readers. If you look at the preferences page for, say, wikipedia, the best skin to choose I have found is "Classic". This reduces the rather long list of options at the end of the document (the "sidebar that wikipedia has which displays to the left-hand side in Firefox). Of course, the default theme wikipedia has displays fine -- it's just that ELinks renders the CSS part without positioning at the end of the document.

Moinmoin, OTOH, is perhaps the better wiki engine that's ELinks friendly. If you look here:


You'll note that the main options are at the top of the page instead (because ordinarily they'd appear horizontally across the page in some other browser). Since MoinMoin hides any user preferences in a separate page, and doesn't list all sorts of weirder options for you to choose from in some sort of sidebar like wikimedia does, visually, it's much nicer, IMO.

Again, along similar lines is the all-perl wiki engine "UseMod" which is very Elinks friendly, since it's a very simple wiki engine:


... is such an example.

Now, you're probably going to ask what you can do in order to try and improve the look of wikipedia, aren't you? ;) The truth is there isn't a lot you can do unless you decide to script replacement operations via either Lua, Guile, Perl or Ruby. Since I've done a tiny bit of work in ELinks with Ruby that'd be my first choice. Not that it matters, of course.

Perhaps the biggest thing which annoys me about wikimedia with ELinks is how wikimedia decides to link images. If you look at this, for instance:


You'll note that under section 2 there's two images, one for a squirrel (a thumbnail) and the other for an [enlarge]d version of him. I tend not to care for the enlarged one, so I'll leave that as is. You'll note though that clicking on either one of those links takes you to a meta-information page before you can get at the image. I find this annoying and so decided to link the thumbnail link directly to the image, bypassing that page. Assuming you had ELinks compiled in with Ruby support, here's how'd do that in ~/.elinks/hooks.rb

  def ELinks::pre_format_html_hook(url, html)
    if( url =~ /wikipedia\.org/)
          # Handle images.
          html.gsub!(/<a href=\"\/wiki\/Image:(.*?)\"?.*?>?(<img src=(.*?)\s+longdesc.*? \/\>/,'\2');
        return html
I tend to leave the link for Enlarge on the page -- but there's nothing stopping you removing it at pre_formatting time, as above.

If none of this is what you wanted to know, that's your own fault for not being specific enough. ;P But I hope it helps, nevertheless.

-- Thomas Adam

"Wanting to feel; to know what is real.  Living is a lie." -- Purpoise
Song, by The Monkees.

Top    Back

Rick Moen [rick at linuxmafia.com]
Tue, 5 Dec 2006 16:28:31 -0800

Quoting Thomas Adam (thomas.adam22@gmail.com):

> [Bcc'ed tag@lists.linuxgazette.net for inclusion into LG at some point.]

FYI: Posts BCC'd to Mailman get held for listadmin approval. Posts CC'd do not, provided the recipient list isn't overlarge.

Top    Back