Jump to content
  • Advertisement
Sign in to follow this  
Juliean

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement

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 this post


Link to post
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:

Hk1XAGA.png

 

 

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

iI8sY1Z.png

Share this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!