Welcome GuestLogin

@example token

Modified on Thursday, 10 December 2009 12:22 by Administrator Categorized as Uncategorized
Provides an example of using a function or other code.


 * Returns an array of arguments.
 * @example var args = Array.fromArguments(arguments);
 * @example var args = Array.fromArguments(arguments, 2);
Array.fromArguments = function Array$fromArguments() .... 

/** * Implements a control that shows... * @example lang=css * #supercontrol { * background-color: #FF6600; color: white; border: 1px solid #4F5C71; * padding: 2px; position: absolute; visibility: hidden; * filter: alpha(opacity=0.8); opacity: 0.8; * } */ function SuperSuperControl() { .... }


This token enables providing code usage examples. A comment block can contain any number of @example tokens. Example blocks will be interpreted and syntax-highlighted as JavaScript. To make ECMADoc interpret an example as another language, set its name in the lang section of the @example token.

lang=<lang> example

  1. The lang of the example (name=value pair of lang=<the name of the language>). Optional.
       (The languages that will be syntax highlighted are 'javascript and 'css').
  2. The example itself. Required.
       (Any characters until the next token or until the end of the comment).

See also

All tokens

ScrewTurn Wiki version Some of the icons created by FamFamFam.