JSDuck - the tool for documenting your Ext JS apps

JSDuck - the tool for documenting your Ext JS apps

Today I'm happy to announce the release of JSDuck 3.0.

The project has grown quite tremendously since the initial 0.1 release almost a year ago. No more is it an alternative documentation generator, but an official one. Therefore I'm closing the old forum thread which has lots of outdated information and start a new fresh one.

Although a lot has changed, the main features of JSDuck have remained the same:

* Support for Markdown, so you can write human-readable comments.

* Strong adherence to the DRY principle, so you don't have to repeat in comments what you already have said in code.

Over time JSDuck has been extended outside the realm of basic API documentation, allowing the creation of guides, examples and other things you see in the official Ext JS 4 documentation.

But for most users, these aren't as useful, so for this 3.0 release I'd like to highlight the latest and greatest API documentation related features:

* Inline examples allow you embed live demos of your components (no more limited to Ext JS 4 components) inside the documentation. No more will you need to create screenshots to show how your component looks like. Simple add an @example tag, and there you have it.

* Custom tags allow you to add support for metadata tags that JSDuck doesn't support natively, like @license, @date, @version.

When I get an image not found warning, there is no indication as to where the image is referenced (i.e. no file or line number).

I am having difficulty with the --images option. How do I specify multiple image folders? I've tried doing
--images=path/to/one/folder/,path/to/another/folder
but it doesn't work. What is the proper delimiter to use?

Also, can you provide an example of the --img option - I have been unable to get it to work.

I have the jsduck executable in a folder (say, c:\jsduck).
I have a folder under that called content (c:\jsduck\content).
In the content folder, I have the welcome.html and json files (for categories, guides and videos), plus another folder called images where I want to put some loose images.
To build, I specify --images=c:\jsduck\content\

In doc-comments, to access a loose image from my images folder, I can specify:
{@img images/someimage.png Sample Image}

But in markdown for a guide, I have to specify:
![Sample image](images/images/someimage.png)

It looks like in the doc output, an images folder is getting created to contain all the images, so my loose images get copied into there under another images folder. But it is curious that it resolves correctly in the doc-comments, but not in the markdown.

References such as the following resolve correctly:
![Another Image](guides/myguide/guideimage.png)

To provide multiple image input directories you should simply use the --images option multiple times:

Code:

jsduck --images /dir/1 --images /dir/2

This option currently only affects {@img} tags inside doc-comments.

I don't really understand why would you specify --images=c:\jsduck\content\ if it's really the c:\jsduck\content\images that contains the images. But anyway...

To link images from guide contained in the same directory as the guide itself, the simple {@img} tags should work: {@img image_name.png}

But I guess the main problem is that you try to share images between comments and guides. That's a very reasonable wish, but unfortunately JSDuck has no support for this at all... besides the ![Sample image](some/path.png) syntax which is Markdown version of simply using the <img> tag, allowing you to link any image on the internet whatsoever.

I'll have to come up with some better approach to support that kind of sharing.

I do have a plan to allow more granular control over which warnings get hidden/shown. But this particular warning should indeed be reworded, as it's more of an ExtJS convention than limitation in JavaScript.