Introducing Moxiedoc

August 19th, 2009 by Spocke

When developing large JavaScript project you need a way to document the API for the end users of your project. We have been using a Wiki based documentation for the TinyMCE project for a while but it had some drawbacks one of them it that it’s hard to maintain inline documentation and synchronize that with your wiki and it’s also very tricky update the wiki documentation if refactor your API then you need to change lots of referring links and a wiki doesn’t handle that in a elegant way.

So we started to look for existing documentation generation tools for JavaScript and there are a few out there but they all had drawbacks. For example YUIDoc was written in Python and our build process uses Java so mixing these together wasn’t really ideal. We also looked at JsDoc Toolkit but it tries to be smart and parse the JS code and since it’s such a dynamic language it mostly fails. There is also the Ext API documentation but I think their tool is closed and written in PHP so we couldn’t use that. And none of these wouldn’t handle all the things we use in the TinyMCE project it was always something that couldn’t be documented properly.

Since we didn’t find any existing tool that matched our needs we decided to develop our own. We developed a new documentation tool called Moxiedoc and it’s part of the JS Build Tools project that we are using for all our JS development. This documentation tool will only parse the JavaDoc style comments so it will not try to figure out what your logic is doing. The comments will generate an XML structure this structure will then be processed to HTML files using XSLT templates. It will also generate an intellisense JS stub file for usage in Visual Studio.

Here is a example of how the documentation might look for a class in a project:

The intellisense generator for Visual Studio enables you to auto complete all classes, methods and properties within your JS project.

So if you want to play with it you can find the Moxiedoc ant tasks and other tools in JS Build Tools package. Feedback to this project is very welcome since it’s our first release there is probably lots of things that could be added in the future.

Posted in Development, Work

5 Responses

  1. Twitted by hoatle Says:

    [...] This post was Twitted by hoatle [...]

  2. Twitter Trackbacks for Moxiecode Developer Blog » Blog Archive » Introducing Moxiedoc [moxiecode.com] on Topsy.com Says:

    [...] Moxiecode Developer Blog » Blog Archive » Introducing Moxiedoc blog.moxiecode.com/2009/08/19/introducing-moxiedoc – cached page Moxiecode Developer Blog, developers of TinyMCE. — From the page [...]

  3. jehanzeb afridi Says:

    Hi…Really very nice work….but sir i dont understand how to build tinymce.vsdoc.js file.. i have spent alote of time, tying to generate it. sir if you have tinymce.vsdoc.js file, kindly upload on moxiedoc or email it to me if you dont mind. I will provide you my email.. Thanks and have nice time.

  4. Spocke Says:

    You can grab the SVN version to get the tinymce.vsdoc.js file or download the DEV package.

  5. jehanzeb afridi Says:

    Thanks for the reply…
    sir from where i can grab the SVN Version OR from where i can download the DEV package..

    Thanks and Happy Christmas.