Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know, that GNOME3 UI uses HTML and CSS elements for creating menus and windows. How can I write simple web-based application like some text-editor with own document-format and formatting tools written in JS? HTML widget, that saves documents to the file-system.

Main reason of this question - to create Text editor, with Markdown support...

GTK File Menu:

  • Open
  • Save as...

WebKit content:

<link rel="stylesheet"...>
<script src="..."></script>
<content>{opened file}</content>
share|improve this question
Try with bluefish :) if you really dont want to stick to Webkit – bebojoor Apr 25 '12 at 9:21

It doesn't use HTML. It uses GTK, which itself uses a styling language based on CSS. However, you can use WebKit to provide the functionality you're after. For instance, the following program will give you a WebKit-based AskUbuntu-browser.

I wrote this in Python, but you can use JavaScript as well if you like. That's the great thing about GObject Introspection, from which we're importing GTK and WebKit. It works with most languages and the code will be very similar in JavaScript. And of course, just replace with the location of your HTML-application.

#!/usr/bin/env python
from gi.repository import Gtk, WebKit

win = Gtk.Window()
web = WebKit.WebView()"")
scroller = Gtk.ScrolledWindow()
win.connect("destroy", Gtk.main_quit)
share|improve this answer
Ok, but how to open/save documents on file-system using this widget? – iegik Apr 25 '12 at 9:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.