emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking Emacs with libxml2


From: joakim
Subject: Re: Linking Emacs with libxml2
Date: Mon, 06 Sep 2010 23:30:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Lars Magne Ingebrigtsen <address@hidden> writes:

> Stefan Monnier <address@hidden> writes:
>
>> It's an obvious idea, but I think it's a fair bit of work:
>> - you'll probably want your function to be able to read from a buffer
>>   rather than from a file (reading from a file would slow down the
>>   operation to a point where using a separate xml-to-elisp executable
>>   isn't that much worse).
>
> That's actually the main entry point for the library:
>
> http://www.xmlsoft.org/html/libxml-HTMLparser.html#htmlParseDoc
>
> Well, you have to convert the buffer to a string, but...
>
>> - parsing HTML is the easy part, rendering it in Emacs is a lot
>>   more difficult.
>
> Well, parsing real work HTML is quite tricky, but you're right in that
> the major part of this work wouldn't be hooking libxml2 into Emacs
> (probably a day's work for somebody who knows what they're doing, and
> three days for me?), but writing an HTML renderer.  I've been looking to
> see whether there are any C libraries for rendering HTML, but I haven't
> found anything.  (Well, except Gecko and Webkit, but 1) we probably
> don't want to make Emacs dependent on those very large libraries, and 2)
> they're oriented towards more graphical environments than Emacs.)

Here I'd like to shamelessly plug my xwidget emacs branch, which allows
for embedding for instance the webkit based uzbl browser inside
Emacs. See the ezbl project for specific use of xwidgets together with
uzbl. Ok, so its only demo-ware code, but its still interesting I think.

> But I'm kinda unsure how much work writing an HTML renderer would be, if
> you had access to a sensible parse tree.  My guess would be that you
> could have something that rendered 80% of pages very nicely with one
> week's worth of work.  And I take those numbers out of the air, but
> that's the vague feeling I have...

-- 
Joakim Verona



reply via email to

[Prev in Thread] Current Thread [Next in Thread]