The annotater plugin was created to make it really easy to capture annotations (see bitwiser for a simple usage). If it's not sufficient for everything jsdocer must do then just take a look at how its implemented (Comments.split is the key). It uses Shaper.traverseTree like most shaper plugins.
> You've created a great piece of
> software that should make it possible, even enjoyable, for anyone to
I need to save that quote somewhere. It is indeed the goal of Shaper.
Right now plugins reside under the Shaper directory, in the future it will also be possible to run plugins that reside in your local JS project. This could be useful for one-off project specific Shaper-snippets. There will also be support for a project-level Shapefile (or .shaper, or something else) that specifies the plugin pipeline.
> One critical requirement for JSDoc however is that it be runnable
> under Rhino (as well as node, in version 3). I've been able to force
> Narcissus to run under Rhino, with a Rhino-Require shim, plus a minor
> tweak to their core code, but I wondered if you had any interest or
> experience in this area?
Sure. Here's an excerpt of the README (which need to be merged with jsshaper.org by the way):
JSShaper is designed to run from the command line. It should be
possible to use with the following JS shells:
js: recent versions of Mozilla SpiderMonkey
d8: Google V8 debug shell
node: Embedded V8 with lots more
native read function.
I didn't try Shaper with Rhino before, so I downloaded Rhino 1.7R3 and gave it a try. It seems to lack a native read function (or rather I found no), so you need to add that. It has argument passing and a native load though. Right now it bails out in Narcissus - Rhino doesn't seem to like Narcissus's technique of eval:ing constants. You can work around that temporarily in jsdefs.js by setting var consts = "var ";. If you get a native read in place I wouldn't be surprised if everything else just worked.
> Rhino has a global load() and can, via readFile(path [,
> characterCoding]), read from files, if that's what you mean by a
> "native read"?
It is, thanks. In that case it's just the matter of selecting between readFileSync (node), readFile (Rhino) and read (the rest) at the end of run-shaper.js. I'll get to this later today. It could mean that we can add Rhino to the list of compatible shells.
> I'll get to this later today. It could mean that we can add Rhino to the list of compatible shells.
Now confirmed. I just pushed out a require-refresh where everything is now relative the top-level Shaper directory. Use that version and apply the var-modif to Narcissus manually (I'll include that soon) and Shaper should run just fine in Rhino. And d8, js and node.