AS3 Documentation Tool AS3toXML

There was one great tool to create a documentation for AS2. It was called BLDoc from Bline-Express. The only problem with this tool is that it does not work with Actionscript3. So I started working on a AS3 documentation tool called AS3toXML because it is only analyzing the code and creates a Xml without any nice visual output. That will be the next tool I will create. XMLtoHTML or something like that. Now back to the first application which is nearly finished.

I need your whishes and suggestions!

Yeah, thats true! I want you to help me to have a powerful tool to create Actionscript3 documentations. So here we go. I will post feature lists and Xml output. I wish you to use the comment function to tell me about possible mistakes since I do not know very much about Xml. I want you to tell me how things can be done better and feature requests.

Updated:

  • Tags like @deceprated. I should have got all common tags now. If you know a tag you would like go ahead and leave a comment
  • Support for the new namespace feature that AS3 offers (access of class members can be public/private/internal/protected or defined by namespace)
  • Design changes. @see, @link, @throws and @req (requires) are now using same layout as multi-tags that can be used several times
  • Fixed code-analyzer to work with very screwed code and multiline declarations/values

Pending:

  • XSLT to format the output since the XMLtoHTML application is also finished now
  • Support for meta-tags (still need a list of all that tags)

1. Supported tags

  • @summary
  • @example
  • @version
  • @throws
  • @author
  • @param
  • @return

2. Supported files

  • Classes lead to a class tag
  • Interfaces will result in a interface tag
  • Functions inside a package will be directly attached to a package

3. Supported items for documentation

  • Functions
  • Variables
  • Classes/Interfaces

Do you want to comment on a package? Is this needed and where to put such a documentation? I think this is a main problem. A brief overview about a package could be useful. I am not sure.

4. Variable example
Input:
[as] /**
* The filter used for convert to binary images
* @see de.je2050.imageprocessing.filters.binarization.Threshold
*/
public static var threshold: IFilter = new Threshold;[/as]

Output:
[html]
The filter used for convert to binary images

[/html]

5. Function example
Input:
[as] /**
* Input BitmapData is taken and a new image will be created with respect
* to the size of the BitmapData object. After that loadBitmapData gets
* called to copy all channels.
*
* @example Image.fromBitmapData( bitmap, ImageFormat.RGB, false );
*
* @param bitmap BitmapData object which will be used for new Image
* @param format May be any kind of de.je2050.imageprocessing.core.ImageFormat
* @param convertToGrayscale If your BitmapData source is not already a grayscale image you
* can convert it by setting convertToGrayscale true.
*
* @return new de.je2050.imageprocessing.core.Image with information from given BitmapData
*
* @see #loadBitmapData
* @see de.je2050.imageprocessing.core.ImageFormat
*
* @summary Returns a new Image that contains all information about given BitmapData source
*/
public static function fromBitmapData( bitmap: BitmapData, format: int, convertToGrayscale: Boolean = false ): Image
{
// …
}[/as]

Output:
[html]




[/html]6. Class example
Input:
[as]package de.je2050.imageprocessing.filters.convolution
{
import flash.filters.ConvolutionFilter;
import de.je2050.imageprocessing.core.Image;
import de.je2050.imageprocessing.filters.NativeFilter;

public class Convolution extends NativeFilter
{
public function Convolution()
{
//…
}

override public function toString(): String
{
//…
}
}
}[/as]

Output:
[html]

[/html]

7. Xml structure example
[html]

[/html]Now it is your turn. Do not be shy and post your whishes and suggestions. Thanks so far for your interest! And do not forget to spread this post ;-)

Related Posts

7 Responses to “AS3 Documentation Tool AS3toXML”


  1. 1 todd anderson

    This is great, joa. ( especially since i wouldn’t have to change my current commenting :) ).
    I’m sure you’ve already checked out the ASTree xml that BlDoc spits out. I like how you’ve decided to move from to straight nodeName of comment type.
    My one feature request is support for pre-class Event meta-tags( ie [Event("load")] or [Event(name="load", type="MyCustomEvent")] ). I use them heavily so i don’t have to peruse a class to see if it fires such-and-such event.

    look forward to seeing more of this.
    thanks.
    -todd

  2. 2 joa

    Thanks for your interest. Since I never used theese meta-tags before I would like to see an example. It would be glad if you could send me a little piece of code to j_at_ je2050_dot_de because it makes it much easier for me to support this.

    I already implemented a better support for exceptions. It is “@throw type description” and results in

    <exceptions>
    <exception type=”ExceptionType”>Description</exception>
    </exceptions>

    Does such a meta-tag also include information about the event? Like “an error is thrown if file could not be read” or without?

    All I can say is, that I would be fine with some examples :o)

  3. 3 brian vaughn

    Hello!
    I am excited to read about this project! Have you reached a point yet where you would be willing to let others beta-test your application? If so, I would be very interested in learning more. I’m currently in desperate need of a documentation generator tool for the AS3 project I am working on, and would love to do anything I could to help speed along your development.

  4. 4 joa

    It is currently not possible for me to invest my whole time in this project. I am willing to finish it but I just can not give any information when since it is a freetime hobby for me and I do not get any money for this. So keep this in mind, stay tuned for a beta-release. Todd Anderson will also get a beta-version. And this project needs lots of beta tests since I want to support most styles of code formating.

    Just write me an email so I got yours and I will inform you soon. You can get my email from comment #2 here.

  5. 5 zy

    any plans to release the source code?

  6. 6 joa

    I think I do not have it anylonger. What is it good for anyways? Writing such a think is pretty easy.

    The XML generator
    1) Write a parser
    2) Convert to XML

    The XML translator
    1) Write some XSLT
    2) Write a XSLT renderer
    3) Render XSLT with XML

  7. 7 Marek

    hi. Might be a dummy question. Sorry if so but… where/how can I get this application?

Leave a Reply






Close
E-mail It