Monday, June 25, 2007

Show don't tell

I have been working heavily in my SoC project. Right now if you want to edit Mono XML documentation you have to open your editor of choice and get going with all the XML stuff.
So if you want to edit for example WrapMode.xml from gtk-sharp you will see this:


This has many shortcomings:
  • Typos can and will break the validity of the document.
  • No help of the valid tags that can be used.
  • Etc.
At first I had some problems with the design. I had the idea of making a whole set of code that will model a Monodoc document and define methods to create, change and remove tags. The problem with this approach is the time to implement and the need of a new custom widget that will handle the view of this model. So Miguel proposed the use of the Text* set of classes in GTK#.
This set of classes implement a MVC pattern around a text. An excellent example of the power of TextView and TextBuffer is Tomboy, this app is like a manager of notes that are linked between them and with many options to format the text of the note.
So I decided to try this path mainly because of the beauty that is TextTag, which represents a region of text, that can have a huge number of properties affecting the text, like color, size, visibility, etc. So a TextBuffer can have any amount of TextTags that affect the text of the buffer, this properties will then be rendered by a TextView.

Now after several weeks of hacking I have a screenshot of the the initial work on the editor:


As you can see from the screenshot the formatting is very light, I have been mainly working in doing a transformation of a Monodoc document to a TextBuffer and back. In this example I have changed the color property of several tags that contains values from elements of the XML document.
This week I will complete the work in the transformations so even the most complex documents can be transformed and design a basic layout of the information.

Thursday, April 12, 2007

Release the hounds!!!

My name is Hector, I am a student at UNAM majoring in Computer Science.
Since 2002 I have been following Mono development, then in 2003 I began sending patches for documentation of GTK#. In those years I was majoring in physics but reason took me in and I decided to switch my major to CS, unfortunately this brought my full attention to school so I stopped sending patches for mono.
Now years later, with more experience under the belt I decided to send an application for Google Summer of Code (SoC), after reading the ideas about implementing a WYSIWYG Editor for ECMA documentation.
From first experience I know how boring and tiring can be to edit XML directly:
  • You have to remember a bunch of tags and its rules
  • You have to validate every change of the document to catch any typo or missing tag, etc.
  • Even after some time and good memory you have to deal with bad typos that break the validity of the document or that change the semantic of the tag.
  • All the extra typing and/or copy/paste of tags (very error prone).
For a person that wants to add some remark or fix some typo it's too much to handle. So the need of a editor that hides all the XML and presents a more intuitive interface to the user is not only a nice idea is a necessity.
Thanks to Google, Mono and my mentor Mike Kestner, I will work this summer to implement this editor that will help lessen the learning curve to edit and create documentation for the Mono Project and with a bit of extra work be integrated to Monodevelop so developers can create and edit documentation for their own projects using this editor.