Download - API Doc Smackdown

Transcript
Page 1: API Doc Smackdown

API Doc Smackdown

YUI Doc versus JS Doc Toolkit Monday, September 14, 2009 - 2:25-3:25p

Page 2: API Doc Smackdown

API Doc Smackdown

The Yahoo UI (YUI) Library is well known for its excellent documentation. One of its secrets is YUI Doc, a Python application used at build time to generate API documentation for JavaScript code.

But is YUI Doc really better than JS Doc Toolkit? -- an elder application, written in JavaScript, that also generates API documentation. When should you choose one over the other? Which is the better choice for your project?

In this session you will learn:

* How API generators work, and how documentation helps;* When to use YUI Doc and when to use JS Doc Toolkit;* More about alternatives to comment-based documentation.

Page 3: API Doc Smackdown

http://www.slideshare.net/ted.husted

Page 4: API Doc Smackdown

Old School

push RA ; push register A to retain the subtotalpop RB ; pop register B to recall the total

Page 5: API Doc Smackdown

Source Code Stakeholders

Solution ArchitectsProduct ManagersQA EngineersMaintenance EngineersCustomers

Page 6: API Doc Smackdown

Why not doc?

Embedded comments clutter up the codeExternal document is difficult to synchronize

Page 7: API Doc Smackdown

http://java.sun.com/j2se/javadoc/writingdoccomments/

Page 8: API Doc Smackdown

http://java.sun.com/j2se/javadoc/writingdoccomments/

Page 9: API Doc Smackdown

http://www.j2ee.me/javase/7/docs/api/index.html?overview-summary.html

Page 10: API Doc Smackdown

Some IDEs with API Doc Support

Eclipse Aptana (ScriptDoc)

Visual Studio Resharper for VSIDEA IntelliJ

Any others?

Page 11: API Doc Smackdown

http://ndoc.sourceforge.net/

Page 12: API Doc Smackdown

http://sandcastle.codeplex.com/

Page 13: API Doc Smackdown

http://www.codeplex.com/DocProject

Page 14: API Doc Smackdown

http://en.wikipedia.org/wiki/Comparison_of_documentation_generators

Page 15: API Doc Smackdown

http://www.phpdoc.org/

Page 16: API Doc Smackdown

http://rdoc.rubyforge.org/

Page 17: API Doc Smackdown

http://www.birt-exchange.org/documentation/JavaComponents10/JSAPI-JSdoc/

Page 18: API Doc Smackdown

http://developer.yahoo.com/yui/docs/

Page 19: API Doc Smackdown

http://developer.yahoo.com/yui/yuidoc/

Page 20: API Doc Smackdown

http://developer.yahoo.com/yui/yuidoc/

Page 21: API Doc Smackdown

http://developer.yahoo.com/yui/yuidoc/

Page 22: API Doc Smackdown

http://developer.yahoo.com/yui/yuidoc/

Page 23: API Doc Smackdown

http://developer.yahoo.com/yui/yuidoc/

Page 24: API Doc Smackdown

http://developer.yahoo.com/yui/yuidoc/

Page 25: API Doc Smackdown

YUI Doc Pros and Cons

ProsConcise set of tagsUsed by YUI library supported by YUI Team

ConsYUI specific idiomsOvershadowed by YUI Small community

Page 26: API Doc Smackdown

http://developer.yahoo.com/yui/yuidoc/

Page 27: API Doc Smackdown

http://code.google.com/p/jsdoc-toolkit/

Page 28: API Doc Smackdown

http://code.google.com/p/jsdoc-toolkit/w/list

Page 29: API Doc Smackdown

http://code.google.com/p/jsdoc-toolkit/w/list

Page 30: API Doc Smackdown
Page 31: API Doc Smackdown

http://code.google.com/p/jsdoc-toolkit/

Page 32: API Doc Smackdown

http://code.google.com/p/jsdoc-toolkit/

Page 33: API Doc Smackdown
Page 34: API Doc Smackdown

http://docs.jproton.com.br/

Page 35: API Doc Smackdown

http://lib.metatype.jp/madtemplate/

Page 36: API Doc Smackdown

http://projects.vinces.ca/jsdocs/

Page 37: API Doc Smackdown

http://code.google.com/p/jsdoc-toolkit/wiki/Templates

Page 38: API Doc Smackdown

http://code.google.com/p/jsdoc-toolkit/wiki/Templates

Page 39: API Doc Smackdown

http://code.google.com/p/jsdoc-toolkit/wiki/Templates

Page 40: API Doc Smackdown

http://developer.yahoo.com/yui/yuidoc/#custom

Page 41: API Doc Smackdown

D:\opt\Yahoo\yuidoc_1.0.0b1\yuidoc\template\main.tmpl

Page 42: API Doc Smackdown

JsDoc Toolkit Pros and Cons

Pros

Deep and broad tab set Used by many projects Well supported

Cons

Sketchy documentationLacks "anchor" projectSole developer

Page 43: API Doc Smackdown

Time for a Test Drive ...

Page 44: API Doc Smackdown

Installing YUI Doc

Python 2.5C:\Python25

SetupTools $python_home\Scripts\easy_install* (executables)

.> easy_install pygments

.> easy_install simplejson

.> easy_install cheetah

YUI Doc Distributionbin/example.batbin/example.sh

Page 45: API Doc Smackdown

http://python.org/download/releases/2.5.4/

Page 46: API Doc Smackdown

http://www.slideshare.net/ted.husted

python-2.5.4.msi

Page 47: API Doc Smackdown

http://www.slideshare.net/ted.husted

http://pypi.python.org/pypi/setuptools

Page 48: API Doc Smackdown

setuptools-0.6c9.win32-py2.5.exe

Page 49: API Doc Smackdown

C:\Python25\Scripts\easy_install

1. easy_install pygments2. easy_install Cheetah3. easy_install simplejson

Page 50: API Doc Smackdown

c:\opt\yahoo\yuidoc_1.0.0b1\yuidoc\bin\example.bat

Page 51: API Doc Smackdown

c:\opt\yahoo\yuidoc_1.0.0b1\yuidoc\bin\example.bat

Page 52: API Doc Smackdown
Page 53: API Doc Smackdown

Installing JsDoc Toolkit

Java 1.5 or 1.6 JsDoc Distribution

appconfjavatemplates

> java -jar jsrun.jar app\run.js -a -t=templates\jsdoc -r app/frame.js app\frame app/handlerout/jsdoc

index.htmlfiles.htmlsymbols\

http://code.google.com/p/jsdoc-toolkit/

Page 54: API Doc Smackdown

file:///D:/opt/GoogleCode/jsdoc_toolkit-2.3.2/jsdoc-toolkit/out/jsdoc/index.html

Page 55: API Doc Smackdown

YUI Doc vs JsDoc Toolkit

YUI Doc ProsConcise set of tabsUsed by YUI library Supported by YUI Team

Js Doc Pros

Deep and broad tag set Used by many projects Well supported

YUI Doc ConsYUI specific idiomsOvershadowed by YUI Small community

Js Doc Cons

Sketchy documentationLacks "anchor" projectSole developer

Page 56: API Doc Smackdown

http://dojodocs.uxebu.com/

Page 57: API Doc Smackdown

http://scriptdoc.org/

Page 58: API Doc Smackdown

Style GuideUse <code> style for keywords and nameUse in-line links economicallyOmit parentheses for the general form of methods and constructorsOkay to use phrases instead of complete sentences, in the interests of brevity.Use 3rd person (descriptive) not 2nd person (prescriptive)Method descriptions begin with a verb phrase.Class/interface/field descriptions can omit the subject and simply state the object. Use "this" instead of "the" when referring to an object created from the current class. Use "this" instead of "the" when referring to an object created from the current class.Avoid Latin.

http://code.google.com/p/jsdoc-toolkit/

Page 59: API Doc Smackdown

Please complete an evaluation.

Page 60: API Doc Smackdown

Questions?

http://www.slideshare.net/ted.husted


Top Related