Saturday, April 05, 2008

Monodoc internals and a little annoying fly

If anyone out there still does not know, Monodoc is the mono documentation system. It is the core that allows the mono documentation web and the mono documentation browser work. Well, it is also behind a handful of other nice tools like monodoc2html. Once the presentation are done let's move on...

Monodoc works with several different sources of documentation. It renders API documentation, but also C# compiler errors, the Ecma specification and, in the past, even the monkeyguide (which was obsolete and removed). The nice thing is that it keeps a uniform documentation tree no matter where the documentation comes from (API, man pages, error references, ...)

This tree is generated from a skeleton and feed with different documentation sources. This skeleton is defined in a file called monodoc.xml which is something like this:

<node label="Mono Documentation" name="root:">
<node label="Class Library" name="classlib"/>
<node label="Mono Libraries" name="classlib-mono"/>
... (more contents here)
<node label="Various" name="various">
<node label="DiaCanvas Libraries" name="classlib-diacanvas"/>
<node label="NUnit Libraries" name="classlib-nunit"/>
<node label="Tao" name="tao"/>


Then, when monodoc starts, it looks for all the *.sources files it founds and feeds its contents to the nodes:

In the image above, the "Class Library" node is feed with the contents of netdocs.source, the "C# Compiler errors reference" with cs-errors.source and the "NUnit Libraries" with nothing, because that documentation is not currently installed on my system.

And that's it. That's how monodoc manages the documentation tree.

Well, there is this little annoying fly I'm sure everyone using monodoc has met at least once. What happens if you click on "NUnit Libraries" node which has no documentation:

Unhandled URL

Functionality to view the resource root:/classlib-nunit is not available on your system or has not yet been implemented.

That is the problem of having a static skeleton for documentation which is filled with the *.source files found. I know, the problem is not big, one possible solution is to purge those entries which does not have documentation (no *.source file was found), and that is exactly what is done as of r99894.

Monday, October 10, 2005

Documenting is a Good-ThingTM

I've been cleaning and writing some documentation on the Wiki regarding Monodoc. The problem is that, lately, my english is more broken that it should be (probably due to my year in Germany and that I haven't study english since..since..a lot).

Well, the thing is that someone please check the pages I modified. Here is the list:

Of course, I will also appreciate all types of comments: style, things not clearly explained, things that lack. The Monodocer page should be reviewed a lot and, also, I have to add an Assembler page (the link is there but I didn't write the page yet).

I recommend you to grab the SVN version of monodoc and mono-tools as some minor bugs are corrected. They were little annoying things that appear when using uncompiled sources from monodoc (the ones being created by monodocer). The bug that hanged Gecko-sharp when visiting big pages is also corrected.

There is yet one more bug that makes Monodoc browser to hang, which is really difficult to track. It doesn't reproduce in the same docs (at least, the docs of the bug review doesn't hang monodoc for me, but the same error appears in other places) and is due to a cast from an String somewhere in Gtk. The point is that, the same code is used once and again (setting the title label, near the back/forward arrows) and nothings happens until you enter some specific docs. I will need to sit down and spend some time on this.

Just one last question. Why don't try monodocer/monodoc for documenting your libraries?

Wednesday, September 28, 2005

Welcome to the Real World

The other night I went out with some friends and decided to wear a new-awesome-incredible T-Shirt I have. Luckily there was some paparazzi around who could register everything:

Thanks miguel!!!

In the monodoc camp there are little steps going on. First, and thanks to Rafael Ferreira, we have printing support now. The printing is performed by the GtkHTML widget even when using gecko, since gecko-sharp doesn't support printing by now; that means the printed documentation won't be so sexy as the rendered one (just substitute sexy with CSS-enabled). But, hey, it will be updated when gecko gets improved.

Other recent addition is that you don't have to create the indexes using a command-line option anymore (the search and the normal index) because monodoc handles it with a nice and simple GUI addition. However, the indexes created from inside the browser will be only accesible to that user, since there are created in the config folder. To try this, download a fresh SVN version of monodoc and mono-tools, remove from the monodoc directory the file monodoc.index and the directory search_index and start monodoc.

There is also an interesting conversation in the monodoc mailing list about whether it would be positive or negative for contributors the integration in the monodoc browser of the msdn-browser from Ben Maurer. What do you think?

The other day I was at the Beagle hack-fest in IRC. I had a lot of fun, special thanks goes to Lukas for organizing everything. At the end, I contributed with the first version (so far) of the search sidebar. At least it is more or less what Garret drawed.

Aside from Mono, I finished my degree and now, in the Real World, I'm looking for a job. I would love getting some response from these guys; meanwhile, I will be sending my CV everywhere. Do you need a Telecommunications Engineer?

Just an advice to finish the post. The other day I went to see Mayumana. If they go near to you, don't miss them. Is one of the most awesome things I've seen in the last months.

Thursday, September 01, 2005

SOC ends

The SOC is over. The dialog wasn't finally added to Monodoc. However, there is the list of contributions at the home page and a new "Restore" button next to "save" and "close" buttons, that lets you delete your contribution and restore the old text.

Also, the Monodoc search patch is waiting approval at the mailing list. Just for the curious, here is an screenshot:

At the end I wasn't able to finish all the desired features like Comments or downloading new documentation. However, I plan to continue contributing, so they will come, sooner or later. I don't know yet how many free time I will have, but I'm sure I will find some to work with mono.

After reading lluis post I decided to play a little bit with Inkscape and, then, I realized why I spend more time programming than designing:

well, at least, the guys at seem happy with the logo I made for them.

Friday, August 26, 2005

Contributor-experienceTM revisited

Hey, the people still read the monodoc mailing list. hehehe, just kidding. I've improved the contributor-experienceTM with a nice dialog to deal with your contributions:

From that dialog you are able to open and remove your contributions and upload the selected ones.

The problem is that contributions made before the patch will not be listed here nor in the root page (however, a message appears at the root page telling you have xx old contribs pending). Also, old contributions will be automatically uploaded with your next upload.

The uploaded contributions are controlled by a serial number (I've realized that was already done after implementing one myself) that acts like an ACK. Every time you upload a contribution, you get a new serial number so new contributions are marked with it and, both, the server and you, know which ones are new contributions and which ones are contributions already uploaded. This way, contributions not being uploaded (not selected) get its serial number updated after a successful upload.

Now, it's time to concentrate in the search thing that I've postponed for a month or so.