[jala-dev] Re: Missing Methods when generating JsDoc with HopKit

  • From: Anton Pirker <helma@xxxxxxxxxxxxx>
  • To: jala-dev@xxxxxxxxxxxxx
  • Date: Fri, 09 Mar 2007 16:25:17 +0100

hi all!

I found the SOLUTION!

There was a little bug in lib.xml. functionReg was wrong.

I changed it from:
   var functionReg = /^(\s*)function (.*)\(/gi;
to
   var functionReg = /(\s*)function (.*)\(/gi;

Because of the ^ only the first (if any) function in a file was converted to the PrototypeName.prototype.functionName = function() Syntax. Now every function is converted. Works quite good for me now! Great stuff, that JsDoc!


i wish you all a nice weekend!

cheers,
Anton



Anton Pirker wrote:
hi tobi!

thanks for the fast response!

however, the docs task actually should pre-process your files accordingly. it copies the javascript code files into a working directory and replaces the globally defined prototype methods with definitions as described above.
that's strange. i did a little debug-output in the preprocessing of the files and it seems, that nothing is changed by the script.
maybe this debug-output helps:
(for the record: i have the latest jala lib from the svn in use, with the latest helma from svn and java 1.6)

[echo] ################################ functionReg: /^(\s*)function (.*)\(/gi
    [echo] ################################ fileNameResult[1]: AccountMgr
    [echo] ################################ before (var content):
    [echo] /**
[echo] * macro renders a link to signup if user is not member of this site
    [echo]  * if user is member, it displays the level of membership
    [echo]  */
    [echo] function membership_macro(param) {
[echo] if (session.user == null || path.Site == null || path.Site.members.getMembershipRole(session.user) == null)
    [echo]       return;
[echo] res.write(I18n.getMessage("Membership.role." + path.Site.members.getMembershipRole(session.user)));
    [echo] }
    [echo]
    [echo]
    [echo] /**
    [echo]  * macro renders a table with all shareable layouts
[echo] * rendering a preview image, a preview button and some basic information
    [echo]  */
    [echo] function visualLayoutChooser_macro(param) {
    [echo]    res.write("DEPRECATED: use Paginator instead")
    [echo] }
    [echo] ################################ after (var str):
    [echo] /**
[echo] * macro renders a link to signup if user is not member of this site
    [echo]  * if user is member, it displays the level of membership
    [echo]  */
    [echo] function membership_macro(param) {
[echo] if (session.user == null || path.Site == null || path.Site.members.getMembershipRole(session.user) == null)
    [echo]       return;
[echo] res.write(I18n.getMessage("Membership.role." + path.Site.members.getMembershipRole(session.user)));
    [echo] }
    [echo]
    [echo]
    [echo] /**
    [echo]  * macro renders a table with all shareable layouts
[echo] * rendering a preview image, a preview button and some basic information
    [echo]  */
    [echo] function visualLayoutChooser_macro(param) {
    [echo]    res.write("DEPRECATED: use Paginator instead")
    [echo] }



Anton




Other related posts: