Help patch for javascript file?

Nathan Wolek's icon

I would like to distribute some javascript items as part of my LowkeyNW package. Is there a way to integrate documentation for them (like a help file and maxref XML) that would be accessible just like it is for externals compiled from C code? If not, how are others handling documentation?

Darwin Grosse's icon

The answer is revealed in the "ui-mgraphics" example folder. There, you see that a javascript item (in this case, jsplot.js) has a matching .maxhelp file (jsplot.maxhelp). If you instantiate the jsplot javascript, select it and request help, the jsplot.maxhelp patch will open.

Of course, all must be in your current path.

Nathan Wolek's icon

Thanks Darwin! It was not working for me originally because I was *adding* the maxhelp extension to the name, rather than *replacing* the js extension. It should be

myscript.maxhelp

NOT
myscript.js.maxhelp

The second one does not work.

Nathan Wolek's icon

I'll just also point out that Darwin answered me via Facebook and Charles Matthews answered via Twitter here:

Social media certainly speeds up the response time!