How to do this in Haskell

If you wanted to write a Haskell application that included a WYSIWYG HTML editor, how would you do it? More details: - I'll probably be using Gtk2Hs for the app, though that could change with a (very) good reason. - The top priorities for the editor are that it resemble common word processors in editing functions, and that the display looks as near as possible to what can be expected from some major browser such as FireFox or IE. If it's not possible to do extremely well in both of these criteria, then I may as well abandon the project now. - I'd like for the result to be cross-platform, but Windows-only would be just as good from my boss's perspective. So, with all that in mind, I'm looking for options. What looks most realistic that I've found to date is building an XP-COM implementation for Haskell via the FFI and either a code generation tool or Template Haskell, and then using that to try to embed the Mozilla editor component. Given my serious lack of knowledge in XP-COM or the Mozilla project or GTK, that looks sort of scary. Any other ideas? -- Chris Smith

Hi Chris, You wrote:
If you wanted to write a Haskell application that included a WYSIWYG HTML editor, how would you do it?
I would use fckeditor. Why do you need to write an HTML editor from scratch in Haskell? That is a very, very big wheel to re-invent. Regards, Yitz

Yitzchak Gale wrote:
I would use fckeditor.
Sorry to be unclear. I'm looking for a way to integrate an HTML editor into a GUI application, not a web application. Unless I missed something, fckeditor is a JavaScript-based component that is designed to be included in a web page.
Why do you need to write an HTML editor from scratch in Haskell? That is a very, very big wheel to re-invent.
Right, which is why I'm trying to avoid reinventing it. Writing a new HTML editor is not even a consideration. I'm looking at the effort to integrate the Mozilla editor component, and wondering if there are other components that could be used instead in a Gtk2Hs application. -- Chris Smith

Chris Smith wrote:
Right, which is why I'm trying to avoid reinventing it. Writing a new HTML editor is not even a consideration. I'm looking at the effort to integrate the Mozilla editor component, and wondering if there are other components that could be used instead in a Gtk2Hs application.
A not-so-well-known feature of X11 is reparenting of windows. You should be able to take any X11 app and have it display in a window of your choice inside your app. So pick an HTML editor and integrate it into your app that way. -- Joe Buehler

On Mon, 2007-11-12 at 16:16 -0500, Joe Buehler wrote:
Chris Smith wrote:
Right, which is why I'm trying to avoid reinventing it. Writing a new HTML editor is not even a consideration. I'm looking at the effort to integrate the Mozilla editor component, and wondering if there are other components that could be used instead in a Gtk2Hs application.
A not-so-well-known feature of X11 is reparenting of windows. You should be able to take any X11 app and have it display in a window of your choice inside your app. So pick an HTML editor and integrate it into your app that way.
Ah yes, that's a good point. Gtk+ and Gtk2hs support this X11 feature: http://haskell.org/gtk2hs/docs/current/Graphics-UI-Gtk-Embedding-Plug.html http://haskell.org/gtk2hs/docs/current/Graphics-UI-Gtk-Embedding-Socket.html Duncan

On Sat, 2007-11-10 at 23:44 -0700, Chris Smith wrote:
If you wanted to write a Haskell application that included a WYSIWYG HTML editor, how would you do it?
More details:
- I'll probably be using Gtk2Hs for the app, though that could change with a (very) good reason.
I would look into binding extensions of the GtkMozEmbed widget. The current GtkMozEmbed API does not expose the Gecko engine's html editing features. Alternatively I'd look at binding the GtkHTML3 library. It's used as the html editor in the evolution email client. I'm not sure if WebKit/Gtk has html editing features, it might be worth looking into. As others have said, it's not easy however. Duncan

On Sat, Nov 10, 2007 at 11:44:54PM -0700, Chris Smith wrote:
If you wanted to write a Haskell application that included a WYSIWYG HTML editor, how would you do it?
use google docs, yahoo zimbra, or get one of the html editing widgets from a popular dhtml toolkit and roll your own. in any case, you needn't even leave the browser to solve this.
participants (5)
-
brad clawsie
-
Chris Smith
-
Duncan Coutts
-
Joe Buehler
-
Yitzchak Gale