Subdomain Posts
None | 12 days ago
None | 12 days ago
None | 12 days ago
None | 12 days ago
JavaScript | 23 days ago
JavaScript | 26 days ago
JavaScript | 27 days ago
JavaScript | 27 days ago
None | 27 days ago
None | 35 days ago
Recent Posts
None | 14 sec ago
None | 47 sec ago
HTML | 1 min ago
Linden Scripting | 1 min ago
Haskell | 1 min ago
None | 1 min ago
Haskell | 1 min ago
None | 1 min ago
None | 1 min ago
None | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By botic on the 13th of Jan 2010 12:15:17 PM Download | Raw | Embed | Report
  1. // FIXME: helma.plugin relies heavily to variable JSDOC.Symbol.srcFile for helma properties file detection
  2. // FIXME: a ' wrapped in a # comment, i.e. " # doesn't " silently breaks the parsing resulting in properties being omitted
  3.  
  4. JSDOC.PluginManager.registerPlugin(
  5.    /**
  6.     * In helma objects are defined by files with the extension .properties.
  7.     * So for jsdoc to work we need to parse these properties files and treat
  8.     * them like object constructors.
  9.     * In helma properties files comments are marked by a leading # .
  10.     * That differs from JS, so the rule is to make JS doclet comments
  11.     * after the # . For example:
  12.     * # /**
  13.     * # * @class
  14.     * # * @name Mate
  15.     * # * @type Human
  16.     * # * @augments Person
  17.     * # */
  18.     //*/
  19.    "JSDOC.Helma",
  20.       {
  21.          /**
  22.           * jsdoc-toolkit detects the doclet start end end correctly but the
  23.           * contents inside still need to be cleaned of the # .
  24.           */    
  25.          onDocCommentSrc : function(docComment) {
  26.             // check if properties are parsed
  27.             if (/\.properties$/i.test(JSDOC.Symbol.srcFile) === true) {
  28.                // remove #
  29.                docComment.src = docComment.src.replace(/#/gi, "");
  30.                // apply some standard formating that happens inside the DocComment.unwrapComment
  31.                // but fails because the # are removed by a call to this plugin later.
  32.                docComment.src = docComment.src.replace(/(^\/\*\*|\*\/$)/g, "").replace(/^\s*\* ?/gm, "");
  33.             }
  34.             return;
  35.          },
  36.          /**
  37.           * In helma properties files the object properties are declared just by name,
  38.           * without reference to the object they belong to. Because of that jsdoc-toolkit
  39.           * gets the name and alias wrong. So take the value of the @member tag and
  40.           * insert it into the name and alias.
  41.           * Within helma it is possible to declare prototype functions without atatching
  42.           * them to the prototype: "MyPrototype.prototype.myFunction = function()" can be written
  43.           * as "function myFunction()" . Of course that breaks the JsDoc parsing since it puts the
  44.           * function into global namespace. Setting helmacomp=true on the commandline or in a conf
  45.           * file executes the memberOf resolving for every symbol preventing that error.  
  46.           */
  47.          onSetTags: function(symbol) {
  48.             // check if symbols origin is in a properties file or helmacomp was set
  49.             if ((/\.properties$/i.test(symbol.srcFile) === true) || (JSDOC.opt.D.helmacomp != undefined)) {
  50.                // _children are documented as private because of the _. Uncomment the
  51.                // following code block to prevent that.  
  52.                /*
  53.                if (/_children/i.test(symbol.name) === true) {
  54.                   symbol.name = "children";
  55.                   symbol.alias = symbol.name;
  56.                }
  57.                */
  58.                if (symbol.memberOf != "") {
  59.                   symbol.name = symbol.memberOf + "." + symbol.name
  60.                   symbol.alias = symbol.name;
  61.                }
  62.             }
  63.             return;
  64.          }
  65.       }
  66. );
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: