Menu

Improved documentation options for script classes

Specifying documentation tags is now easier for script classes.

The HTML documentation generator in JewelScript is mainly intended to document native bindings. As a developer, if you plan to add scripting to your application, you must be able to tell your users what functions and classes are available. The HTML documentation generator makes generating documentation for your native bindings very simple.

But documentation tags are not exclusive to native classes. You always had the option to document script code using tags as well. However, the syntax the compiler expected for documentation tags was clearly geared towards documenting native classes. In script classes, specifying tags was a bit cumbersome. This has now been improved, as the following example shows.

interface I ["This somewhat documents the interface."]
{
    method M(); ["Just another lonely method."]
}

class A implements I ["This documents the class very poorly. Very poorly indeed."]
{
    method A() ["Constructs only a very, very small object. Not worth mentioning at all."]
    {
    }

    method M() ["We wanted to override this, but I forgot why."]
    {
    }
}

class B extends A ["This documents the class very well. Very well indeed."]
{
    method B() extends A() ["Constructs a building. A tall one."]
    {
    }

    method N() ["This is kind of important, you know. Take notes, there will be a test tomorrow!"]
    {
    }
}

The documentation generated from this script can be viewed here.
link

Posted by SourceForge Robot 2015-03-28

Log in to post a comment.

MongoDB Logo MongoDB