Search code examples
apache-flexactionscriptasdoc

Is it possible to include example mxml in your ASDoc?


Is it possible with ASDoc to include example MXML code in your comment?

/**
* @example This should be example code
* <listing version="3.0">
* <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" ...>
* </listing>
*/

This produces an empty example code block.


Solution

  • Yes, but when a browser sees the open and close greater than signs it tries to interpret it as an HTML tag. So, escape them:

    /**
    * @example This should be example code
    * &lt;listing version="3.0"&gt;
    * &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" ...&gt;
    * &lt;/listing&gt;
    */