# Documenting scripting language in application

This topic is 2016 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello,

I've been wondering whether there is a tool like doxygen for documenting what classes, functions etc... are registered in a scripting language like AngelScript that I'm using? Doxygen is probably a bad example, since I don't require it to be generated anything like automated, I'm fully happy to write all the documentation externally, but it should require no/little manual formatting, and should have all the sugar like cross-referencing of classes, functions etc..., if you know what I mean. Is there such a thing?

Edited by Juliean

##### Share on other sites

Maybe you could have a look at sphinx?

This is one of the documentation tool used for python but can be used for any other languages as long as you don't require automatic extraction.

You can create cross references in your documentation, you can even add custom domains to add support for DSL and the likes. You write your docs using restructuredText which is quite nice and easy to use (no to very little manual formatting).

##### Share on other sites

I was searching for something similar, but my final solution write a documented header for Doxygen to parse. Doxygen is quite forgiving about grammar rules such as missing return type for functions so I think it should work with most scripts by writing the document similar to c++ style.

for example:

#ifdef LUA_TABLE
//! Provides generic functions for table manipulation.
class table{

//! Given an array where all elements are strings or numbers, returns table[i]..sep..table[i+1] ... sep..table[j].
static concat (table [, sep [, i [, j]]]);

//! Inserts element value at position pos in table, shifting up other elements to open space, if necessary.
static insert (table, [pos,] value);

//! Returns the largest positive numerical index of the given table, or zero if the table has no positive numerical indices.
static maxn (table);

//! Removes from table the element at position pos, shifting down other elements to close the space, if necessary.
static remove (table [, pos]);

//!Sorts table elements in a given order, in-place, from table[1] to table[n], where n is the length of the table.
static sort (table [, comp]);

};
#endif


results in:

I also use the generated XML for autocomplete in my script editor

##### Share on other sites

Thanks all for the suggestions,

I decided to just stick with doxygen and write a seperate headerfile for all the methods I'm going to register. Might even consider trying to parse those fake header files for actually registering stuff in angelscript, but one bit at a time. I still have one problem with angelscript though, seeing how the return value is part of the method definition there, and that it uses @ for "pointers" instead of "*": Doxygen has a problem parsing this @, but only for the return values.

// here the @ is parsed correctly:
void test(Class@ name);

// and here return value is parsed to "Class", without the @
Class@ test2(void);



Is there any way to fix this?

##### Share on other sites

Is there any way to fix this?

That's a tough one, I'd imagine. If Javadoc compatibility is enabled, try disabling it? That's my first guess.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 18
• 33
• 9
• 16
• 22