开发者

Javascript API documenting framework with lightweight mark-up

I'm seeking a Javascript API documenting framework with features similar to JSDoc, but would use easy-to-type restructured text or markdown in the code comments (not html)

Bonus: would integrate well with Sphinx. However, I don't want to maintain separate documentation, but generate API documentation from comments.

http://code.google.com/p/jsdoc开发者_JAVA技巧-toolkit/


I finally found JSDuck the most suitable for the task:

https://github.com/senchalabs/jsduck


InvisibleJS supports markdown and a variety of other formats.

Also take a look at docco.


JSDoc 3 now supports markdown by a plugin. You can configure markdown support by adding the line

"plugins": [ "plugins/markdown" ],

to your configuration JSON file.

Now, starting JSDoc with -c conf.json will enable markdown support.


For those who still searching for a markdown plugin for jsdoc-toolkit, please have a look at plug-ins called 'smartdown' in the following links

https://github.com/sproutcore/docs

(More reference on syntax : http://guides.sproutcore.com/documentation_guidelines.html)

I tried it with sphinx through the following templates (jsdoc-toolkit-rst-template, jsdoc-for-sphinx), and it works flawlessly.


For very light-weight markup, check out yamdog. It parses comment blocks for Markdown and YAML. Unlike javadoc-based alternatives like JSDoc and Dox, yamdog does not have any magic keywords for you to memorize. Therefore, it prevents the comments beginning to look like another kind of code. It might not be as feature-rich and well-integrated as JSDoc but still it does the job and keeps things simple. Sphinx integration is not on the roadmap for now, unfortunately. Disclaimer: I am the maintainer.

Here is an example of a yamdog comment block from tapspace lib:

// tapspace.Point:polarOffset(distance, angle)
//
// Get the point at the given *distance* at the *angle*.
//
// Parameters:
//   distance
//     a number on the basis or a Distance.
//   angle
//     a number in radians on the basis or a Direction.
//
// Return
//   a Point
//

Only thing yamdog needs is the comment block to start with a certain string, like "tapspace" in this case. Rest is up to you as long as it is valid YAML/Markdown. Typing Markdown can be tedious too, so see yamdog decorators for easy ways to include tables of contents, automatic links, and more.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜