jsduck 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/COPYING +674 -0
- data/README.md +197 -0
- data/Rakefile +23 -0
- data/bin/jsduck +63 -0
- data/jsduck.gemspec +21 -0
- data/lib/jsduck/aggregator.rb +104 -0
- data/lib/jsduck/app.rb +89 -0
- data/lib/jsduck/cfg_table.rb +21 -0
- data/lib/jsduck/class.rb +116 -0
- data/lib/jsduck/doc_formatter.rb +69 -0
- data/lib/jsduck/doc_parser.rb +277 -0
- data/lib/jsduck/event_table.rb +33 -0
- data/lib/jsduck/lexer.rb +193 -0
- data/lib/jsduck/long_params.rb +31 -0
- data/lib/jsduck/merger.rb +286 -0
- data/lib/jsduck/method_table.rb +45 -0
- data/lib/jsduck/page.rb +56 -0
- data/lib/jsduck/parser.rb +195 -0
- data/lib/jsduck/property_table.rb +21 -0
- data/lib/jsduck/short_params.rb +28 -0
- data/lib/jsduck/table.rb +109 -0
- data/lib/jsduck/tree.rb +104 -0
- data/lib/jsduck/tree_icons.rb +19 -0
- data/template/index.html +45 -0
- data/template/resources/TabCloseMenu.js +150 -0
- data/template/resources/block-bottom.gif +0 -0
- data/template/resources/block-top.gif +0 -0
- data/template/resources/class.gif +0 -0
- data/template/resources/cmp.gif +0 -0
- data/template/resources/collapse-all.gif +0 -0
- data/template/resources/config.gif +0 -0
- data/template/resources/css/ext-all.css +6789 -0
- data/template/resources/css/xtheme-gray.css +1654 -0
- data/template/resources/docs.css +359 -0
- data/template/resources/docs.gif +0 -0
- data/template/resources/docs.js +672 -0
- data/template/resources/event.gif +0 -0
- data/template/resources/expand-all.gif +0 -0
- data/template/resources/expand-bg-over.gif +0 -0
- data/template/resources/expand-bg.gif +0 -0
- data/template/resources/expand-members.gif +0 -0
- data/template/resources/ext-all.js +11 -0
- data/template/resources/ext-base.js +7 -0
- data/template/resources/extanim32.gif +0 -0
- data/template/resources/fav.gif +0 -0
- data/template/resources/favicon.ico +0 -0
- data/template/resources/hd-bg.png +0 -0
- data/template/resources/hide-inherited.gif +0 -0
- data/template/resources/images/default/box/corners-blue.gif +0 -0
- data/template/resources/images/default/box/corners.gif +0 -0
- data/template/resources/images/default/box/l-blue.gif +0 -0
- data/template/resources/images/default/box/l.gif +0 -0
- data/template/resources/images/default/box/r-blue.gif +0 -0
- data/template/resources/images/default/box/r.gif +0 -0
- data/template/resources/images/default/box/tb-blue.gif +0 -0
- data/template/resources/images/default/box/tb.gif +0 -0
- data/template/resources/images/default/button/arrow.gif +0 -0
- data/template/resources/images/default/button/btn.gif +0 -0
- data/template/resources/images/default/button/group-cs.gif +0 -0
- data/template/resources/images/default/button/group-lr.gif +0 -0
- data/template/resources/images/default/button/group-tb.gif +0 -0
- data/template/resources/images/default/button/s-arrow-b-noline.gif +0 -0
- data/template/resources/images/default/button/s-arrow-b.gif +0 -0
- data/template/resources/images/default/button/s-arrow-bo.gif +0 -0
- data/template/resources/images/default/button/s-arrow-noline.gif +0 -0
- data/template/resources/images/default/button/s-arrow-o.gif +0 -0
- data/template/resources/images/default/button/s-arrow.gif +0 -0
- data/template/resources/images/default/dd/drop-add.gif +0 -0
- data/template/resources/images/default/dd/drop-no.gif +0 -0
- data/template/resources/images/default/dd/drop-yes.gif +0 -0
- data/template/resources/images/default/editor/tb-sprite.gif +0 -0
- data/template/resources/images/default/form/checkbox.gif +0 -0
- data/template/resources/images/default/form/clear-trigger.gif +0 -0
- data/template/resources/images/default/form/clear-trigger.psd +0 -0
- data/template/resources/images/default/form/date-trigger.gif +0 -0
- data/template/resources/images/default/form/date-trigger.psd +0 -0
- data/template/resources/images/default/form/error-tip-corners.gif +0 -0
- data/template/resources/images/default/form/exclamation.gif +0 -0
- data/template/resources/images/default/form/radio.gif +0 -0
- data/template/resources/images/default/form/search-trigger.gif +0 -0
- data/template/resources/images/default/form/search-trigger.psd +0 -0
- data/template/resources/images/default/form/text-bg.gif +0 -0
- data/template/resources/images/default/form/trigger-square.gif +0 -0
- data/template/resources/images/default/form/trigger-square.psd +0 -0
- data/template/resources/images/default/form/trigger-tpl.gif +0 -0
- data/template/resources/images/default/form/trigger.gif +0 -0
- data/template/resources/images/default/form/trigger.psd +0 -0
- data/template/resources/images/default/gradient-bg.gif +0 -0
- data/template/resources/images/default/grid/arrow-left-white.gif +0 -0
- data/template/resources/images/default/grid/arrow-right-white.gif +0 -0
- data/template/resources/images/default/grid/col-move-bottom.gif +0 -0
- data/template/resources/images/default/grid/col-move-top.gif +0 -0
- data/template/resources/images/default/grid/columns.gif +0 -0
- data/template/resources/images/default/grid/dirty.gif +0 -0
- data/template/resources/images/default/grid/done.gif +0 -0
- data/template/resources/images/default/grid/drop-no.gif +0 -0
- data/template/resources/images/default/grid/drop-yes.gif +0 -0
- data/template/resources/images/default/grid/footer-bg.gif +0 -0
- data/template/resources/images/default/grid/grid-blue-hd.gif +0 -0
- data/template/resources/images/default/grid/grid-blue-split.gif +0 -0
- data/template/resources/images/default/grid/grid-hrow.gif +0 -0
- data/template/resources/images/default/grid/grid-loading.gif +0 -0
- data/template/resources/images/default/grid/grid-split.gif +0 -0
- data/template/resources/images/default/grid/grid-vista-hd.gif +0 -0
- data/template/resources/images/default/grid/grid3-hd-btn.gif +0 -0
- data/template/resources/images/default/grid/grid3-hrow-over.gif +0 -0
- data/template/resources/images/default/grid/grid3-hrow.gif +0 -0
- data/template/resources/images/default/grid/grid3-special-col-bg.gif +0 -0
- data/template/resources/images/default/grid/grid3-special-col-sel-bg.gif +0 -0
- data/template/resources/images/default/grid/group-by.gif +0 -0
- data/template/resources/images/default/grid/group-collapse.gif +0 -0
- data/template/resources/images/default/grid/group-expand-sprite.gif +0 -0
- data/template/resources/images/default/grid/group-expand.gif +0 -0
- data/template/resources/images/default/grid/hd-pop.gif +0 -0
- data/template/resources/images/default/grid/hmenu-asc.gif +0 -0
- data/template/resources/images/default/grid/hmenu-desc.gif +0 -0
- data/template/resources/images/default/grid/hmenu-lock.gif +0 -0
- data/template/resources/images/default/grid/hmenu-lock.png +0 -0
- data/template/resources/images/default/grid/hmenu-unlock.gif +0 -0
- data/template/resources/images/default/grid/hmenu-unlock.png +0 -0
- data/template/resources/images/default/grid/invalid_line.gif +0 -0
- data/template/resources/images/default/grid/loading.gif +0 -0
- data/template/resources/images/default/grid/mso-hd.gif +0 -0
- data/template/resources/images/default/grid/nowait.gif +0 -0
- data/template/resources/images/default/grid/page-first-disabled.gif +0 -0
- data/template/resources/images/default/grid/page-first.gif +0 -0
- data/template/resources/images/default/grid/page-last-disabled.gif +0 -0
- data/template/resources/images/default/grid/page-last.gif +0 -0
- data/template/resources/images/default/grid/page-next-disabled.gif +0 -0
- data/template/resources/images/default/grid/page-next.gif +0 -0
- data/template/resources/images/default/grid/page-prev-disabled.gif +0 -0
- data/template/resources/images/default/grid/page-prev.gif +0 -0
- data/template/resources/images/default/grid/pick-button.gif +0 -0
- data/template/resources/images/default/grid/refresh.gif +0 -0
- data/template/resources/images/default/grid/row-check-sprite.gif +0 -0
- data/template/resources/images/default/grid/row-expand-sprite.gif +0 -0
- data/template/resources/images/default/grid/row-over.gif +0 -0
- data/template/resources/images/default/grid/row-sel.gif +0 -0
- data/template/resources/images/default/grid/sort-hd.gif +0 -0
- data/template/resources/images/default/grid/sort_asc.gif +0 -0
- data/template/resources/images/default/grid/sort_desc.gif +0 -0
- data/template/resources/images/default/grid/wait.gif +0 -0
- data/template/resources/images/default/layout/collapse.gif +0 -0
- data/template/resources/images/default/layout/expand.gif +0 -0
- data/template/resources/images/default/layout/gradient-bg.gif +0 -0
- data/template/resources/images/default/layout/mini-bottom.gif +0 -0
- data/template/resources/images/default/layout/mini-left.gif +0 -0
- data/template/resources/images/default/layout/mini-right.gif +0 -0
- data/template/resources/images/default/layout/mini-top.gif +0 -0
- data/template/resources/images/default/layout/ns-collapse.gif +0 -0
- data/template/resources/images/default/layout/ns-expand.gif +0 -0
- data/template/resources/images/default/layout/panel-close.gif +0 -0
- data/template/resources/images/default/layout/panel-title-bg.gif +0 -0
- data/template/resources/images/default/layout/panel-title-light-bg.gif +0 -0
- data/template/resources/images/default/layout/stick.gif +0 -0
- data/template/resources/images/default/layout/stuck.gif +0 -0
- data/template/resources/images/default/layout/tab-close-on.gif +0 -0
- data/template/resources/images/default/layout/tab-close.gif +0 -0
- data/template/resources/images/default/menu/checked.gif +0 -0
- data/template/resources/images/default/menu/group-checked.gif +0 -0
- data/template/resources/images/default/menu/item-over.gif +0 -0
- data/template/resources/images/default/menu/menu-parent.gif +0 -0
- data/template/resources/images/default/menu/menu.gif +0 -0
- data/template/resources/images/default/menu/unchecked.gif +0 -0
- data/template/resources/images/default/panel/corners-sprite.gif +0 -0
- data/template/resources/images/default/panel/left-right.gif +0 -0
- data/template/resources/images/default/panel/light-hd.gif +0 -0
- data/template/resources/images/default/panel/tool-sprite-tpl.gif +0 -0
- data/template/resources/images/default/panel/tool-sprites.gif +0 -0
- data/template/resources/images/default/panel/tools-sprites-trans.gif +0 -0
- data/template/resources/images/default/panel/top-bottom.gif +0 -0
- data/template/resources/images/default/panel/top-bottom.png +0 -0
- data/template/resources/images/default/panel/white-corners-sprite.gif +0 -0
- data/template/resources/images/default/panel/white-left-right.gif +0 -0
- data/template/resources/images/default/panel/white-top-bottom.gif +0 -0
- data/template/resources/images/default/progress/progress-bg.gif +0 -0
- data/template/resources/images/default/qtip/bg.gif +0 -0
- data/template/resources/images/default/qtip/close.gif +0 -0
- data/template/resources/images/default/qtip/tip-anchor-sprite.gif +0 -0
- data/template/resources/images/default/qtip/tip-sprite.gif +0 -0
- data/template/resources/images/default/s.gif +0 -0
- data/template/resources/images/default/shadow-c.png +0 -0
- data/template/resources/images/default/shadow-lr.png +0 -0
- data/template/resources/images/default/shadow.png +0 -0
- data/template/resources/images/default/shared/blue-loading.gif +0 -0
- data/template/resources/images/default/shared/calendar.gif +0 -0
- data/template/resources/images/default/shared/glass-bg.gif +0 -0
- data/template/resources/images/default/shared/hd-sprite.gif +0 -0
- data/template/resources/images/default/shared/large-loading.gif +0 -0
- data/template/resources/images/default/shared/left-btn.gif +0 -0
- data/template/resources/images/default/shared/loading-balls.gif +0 -0
- data/template/resources/images/default/shared/right-btn.gif +0 -0
- data/template/resources/images/default/shared/warning.gif +0 -0
- data/template/resources/images/default/sizer/e-handle-dark.gif +0 -0
- data/template/resources/images/default/sizer/e-handle.gif +0 -0
- data/template/resources/images/default/sizer/ne-handle-dark.gif +0 -0
- data/template/resources/images/default/sizer/ne-handle.gif +0 -0
- data/template/resources/images/default/sizer/nw-handle-dark.gif +0 -0
- data/template/resources/images/default/sizer/nw-handle.gif +0 -0
- data/template/resources/images/default/sizer/s-handle-dark.gif +0 -0
- data/template/resources/images/default/sizer/s-handle.gif +0 -0
- data/template/resources/images/default/sizer/se-handle-dark.gif +0 -0
- data/template/resources/images/default/sizer/se-handle.gif +0 -0
- data/template/resources/images/default/sizer/square.gif +0 -0
- data/template/resources/images/default/sizer/sw-handle-dark.gif +0 -0
- data/template/resources/images/default/sizer/sw-handle.gif +0 -0
- data/template/resources/images/default/slider/slider-bg.png +0 -0
- data/template/resources/images/default/slider/slider-thumb.png +0 -0
- data/template/resources/images/default/slider/slider-v-bg.png +0 -0
- data/template/resources/images/default/slider/slider-v-thumb.png +0 -0
- data/template/resources/images/default/tabs/scroll-left.gif +0 -0
- data/template/resources/images/default/tabs/scroll-right.gif +0 -0
- data/template/resources/images/default/tabs/scroller-bg.gif +0 -0
- data/template/resources/images/default/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/template/resources/images/default/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/template/resources/images/default/tabs/tab-btm-left-bg.gif +0 -0
- data/template/resources/images/default/tabs/tab-btm-over-left-bg.gif +0 -0
- data/template/resources/images/default/tabs/tab-btm-over-right-bg.gif +0 -0
- data/template/resources/images/default/tabs/tab-btm-right-bg.gif +0 -0
- data/template/resources/images/default/tabs/tab-close.gif +0 -0
- data/template/resources/images/default/tabs/tab-strip-bg.gif +0 -0
- data/template/resources/images/default/tabs/tab-strip-bg.png +0 -0
- data/template/resources/images/default/tabs/tab-strip-btm-bg.gif +0 -0
- data/template/resources/images/default/tabs/tabs-sprite.gif +0 -0
- data/template/resources/images/default/toolbar/bg.gif +0 -0
- data/template/resources/images/default/toolbar/btn-arrow-light.gif +0 -0
- data/template/resources/images/default/toolbar/btn-arrow.gif +0 -0
- data/template/resources/images/default/toolbar/btn-over-bg.gif +0 -0
- data/template/resources/images/default/toolbar/gray-bg.gif +0 -0
- data/template/resources/images/default/toolbar/more.gif +0 -0
- data/template/resources/images/default/toolbar/tb-bg.gif +0 -0
- data/template/resources/images/default/toolbar/tb-btn-sprite.gif +0 -0
- data/template/resources/images/default/toolbar/tb-xl-btn-sprite.gif +0 -0
- data/template/resources/images/default/toolbar/tb-xl-sep.gif +0 -0
- data/template/resources/images/default/tree/arrows.gif +0 -0
- data/template/resources/images/default/tree/drop-add.gif +0 -0
- data/template/resources/images/default/tree/drop-between.gif +0 -0
- data/template/resources/images/default/tree/drop-no.gif +0 -0
- data/template/resources/images/default/tree/drop-over.gif +0 -0
- data/template/resources/images/default/tree/drop-under.gif +0 -0
- data/template/resources/images/default/tree/drop-yes.gif +0 -0
- data/template/resources/images/default/tree/elbow-end-minus-nl.gif +0 -0
- data/template/resources/images/default/tree/elbow-end-minus.gif +0 -0
- data/template/resources/images/default/tree/elbow-end-plus-nl.gif +0 -0
- data/template/resources/images/default/tree/elbow-end-plus.gif +0 -0
- data/template/resources/images/default/tree/elbow-end.gif +0 -0
- data/template/resources/images/default/tree/elbow-line.gif +0 -0
- data/template/resources/images/default/tree/elbow-minus-nl.gif +0 -0
- data/template/resources/images/default/tree/elbow-minus.gif +0 -0
- data/template/resources/images/default/tree/elbow-plus-nl.gif +0 -0
- data/template/resources/images/default/tree/elbow-plus.gif +0 -0
- data/template/resources/images/default/tree/elbow.gif +0 -0
- data/template/resources/images/default/tree/folder-open.gif +0 -0
- data/template/resources/images/default/tree/folder.gif +0 -0
- data/template/resources/images/default/tree/leaf.gif +0 -0
- data/template/resources/images/default/tree/loading.gif +0 -0
- data/template/resources/images/default/tree/s.gif +0 -0
- data/template/resources/images/default/window/icon-error.gif +0 -0
- data/template/resources/images/default/window/icon-info.gif +0 -0
- data/template/resources/images/default/window/icon-question.gif +0 -0
- data/template/resources/images/default/window/icon-warning.gif +0 -0
- data/template/resources/images/default/window/left-corners.png +0 -0
- data/template/resources/images/default/window/left-corners.psd +0 -0
- data/template/resources/images/default/window/left-right.png +0 -0
- data/template/resources/images/default/window/left-right.psd +0 -0
- data/template/resources/images/default/window/right-corners.png +0 -0
- data/template/resources/images/default/window/right-corners.psd +0 -0
- data/template/resources/images/default/window/top-bottom.png +0 -0
- data/template/resources/images/default/window/top-bottom.psd +0 -0
- data/template/resources/images/gray/button/btn-arrow.gif +0 -0
- data/template/resources/images/gray/button/btn-sprite.gif +0 -0
- data/template/resources/images/gray/button/btn.gif +0 -0
- data/template/resources/images/gray/button/group-cs.gif +0 -0
- data/template/resources/images/gray/button/group-lr.gif +0 -0
- data/template/resources/images/gray/button/group-tb.gif +0 -0
- data/template/resources/images/gray/button/s-arrow-bo.gif +0 -0
- data/template/resources/images/gray/button/s-arrow-o.gif +0 -0
- data/template/resources/images/gray/form/clear-trigger.gif +0 -0
- data/template/resources/images/gray/form/date-trigger.gif +0 -0
- data/template/resources/images/gray/form/search-trigger.gif +0 -0
- data/template/resources/images/gray/form/trigger-square.gif +0 -0
- data/template/resources/images/gray/form/trigger.gif +0 -0
- data/template/resources/images/gray/gradient-bg.gif +0 -0
- data/template/resources/images/gray/grid/col-move-bottom.gif +0 -0
- data/template/resources/images/gray/grid/col-move-top.gif +0 -0
- data/template/resources/images/gray/grid/grid3-hd-btn.gif +0 -0
- data/template/resources/images/gray/grid/grid3-hrow-over.gif +0 -0
- data/template/resources/images/gray/grid/grid3-hrow-over2.gif +0 -0
- data/template/resources/images/gray/grid/grid3-hrow.gif +0 -0
- data/template/resources/images/gray/grid/grid3-hrow2.gif +0 -0
- data/template/resources/images/gray/grid/grid3-special-col-bg.gif +0 -0
- data/template/resources/images/gray/grid/grid3-special-col-bg2.gif +0 -0
- data/template/resources/images/gray/grid/grid3-special-col-sel-bg.gif +0 -0
- data/template/resources/images/gray/grid/group-collapse.gif +0 -0
- data/template/resources/images/gray/grid/group-expand-sprite.gif +0 -0
- data/template/resources/images/gray/grid/group-expand.gif +0 -0
- data/template/resources/images/gray/grid/page-first.gif +0 -0
- data/template/resources/images/gray/grid/page-last.gif +0 -0
- data/template/resources/images/gray/grid/page-next.gif +0 -0
- data/template/resources/images/gray/grid/page-prev.gif +0 -0
- data/template/resources/images/gray/grid/refresh.gif +0 -0
- data/template/resources/images/gray/grid/row-expand-sprite.gif +0 -0
- data/template/resources/images/gray/grid/sort_asc.gif +0 -0
- data/template/resources/images/gray/grid/sort_desc.gif +0 -0
- data/template/resources/images/gray/menu/group-checked.gif +0 -0
- data/template/resources/images/gray/menu/item-over-disabled.gif +0 -0
- data/template/resources/images/gray/menu/item-over.gif +0 -0
- data/template/resources/images/gray/menu/menu-parent.gif +0 -0
- data/template/resources/images/gray/panel/corners-sprite.gif +0 -0
- data/template/resources/images/gray/panel/left-right.gif +0 -0
- data/template/resources/images/gray/panel/light-hd.gif +0 -0
- data/template/resources/images/gray/panel/tool-sprite-tpl.gif +0 -0
- data/template/resources/images/gray/panel/tool-sprites.gif +0 -0
- data/template/resources/images/gray/panel/tools-sprites-trans.gif +0 -0
- data/template/resources/images/gray/panel/top-bottom.gif +0 -0
- data/template/resources/images/gray/panel/top-bottom.png +0 -0
- data/template/resources/images/gray/panel/white-corners-sprite.gif +0 -0
- data/template/resources/images/gray/panel/white-left-right.gif +0 -0
- data/template/resources/images/gray/panel/white-top-bottom.gif +0 -0
- data/template/resources/images/gray/progress/progress-bg.gif +0 -0
- data/template/resources/images/gray/qtip/bg.gif +0 -0
- data/template/resources/images/gray/qtip/close.gif +0 -0
- data/template/resources/images/gray/qtip/tip-anchor-sprite.gif +0 -0
- data/template/resources/images/gray/qtip/tip-sprite.gif +0 -0
- data/template/resources/images/gray/s.gif +0 -0
- data/template/resources/images/gray/shared/hd-sprite.gif +0 -0
- data/template/resources/images/gray/shared/left-btn.gif +0 -0
- data/template/resources/images/gray/shared/right-btn.gif +0 -0
- data/template/resources/images/gray/sizer/e-handle.gif +0 -0
- data/template/resources/images/gray/sizer/ne-handle.gif +0 -0
- data/template/resources/images/gray/sizer/nw-handle.gif +0 -0
- data/template/resources/images/gray/sizer/s-handle.gif +0 -0
- data/template/resources/images/gray/sizer/se-handle.gif +0 -0
- data/template/resources/images/gray/sizer/square.gif +0 -0
- data/template/resources/images/gray/sizer/sw-handle.gif +0 -0
- data/template/resources/images/gray/slider/slider-thumb.png +0 -0
- data/template/resources/images/gray/slider/slider-v-thumb.png +0 -0
- data/template/resources/images/gray/tabs/scroll-left.gif +0 -0
- data/template/resources/images/gray/tabs/scroll-right.gif +0 -0
- data/template/resources/images/gray/tabs/scroller-bg.gif +0 -0
- data/template/resources/images/gray/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/template/resources/images/gray/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/template/resources/images/gray/tabs/tab-btm-left-bg.gif +0 -0
- data/template/resources/images/gray/tabs/tab-btm-over-left-bg.gif +0 -0
- data/template/resources/images/gray/tabs/tab-btm-over-right-bg.gif +0 -0
- data/template/resources/images/gray/tabs/tab-btm-right-bg.gif +0 -0
- data/template/resources/images/gray/tabs/tab-close.gif +0 -0
- data/template/resources/images/gray/tabs/tab-strip-bg.gif +0 -0
- data/template/resources/images/gray/tabs/tab-strip-bg.png +0 -0
- data/template/resources/images/gray/tabs/tab-strip-btm-bg.gif +0 -0
- data/template/resources/images/gray/tabs/tabs-sprite.gif +0 -0
- data/template/resources/images/gray/toolbar/bg.gif +0 -0
- data/template/resources/images/gray/toolbar/btn-arrow-light.gif +0 -0
- data/template/resources/images/gray/toolbar/btn-arrow.gif +0 -0
- data/template/resources/images/gray/toolbar/btn-over-bg.gif +0 -0
- data/template/resources/images/gray/toolbar/gray-bg.gif +0 -0
- data/template/resources/images/gray/toolbar/more.gif +0 -0
- data/template/resources/images/gray/toolbar/tb-bg.gif +0 -0
- data/template/resources/images/gray/toolbar/tb-btn-sprite.gif +0 -0
- data/template/resources/images/gray/tree/arrows.gif +0 -0
- data/template/resources/images/gray/tree/elbow-end-minus-nl.gif +0 -0
- data/template/resources/images/gray/tree/elbow-end-minus.gif +0 -0
- data/template/resources/images/gray/tree/elbow-end-plus-nl.gif +0 -0
- data/template/resources/images/gray/tree/elbow-end-plus.gif +0 -0
- data/template/resources/images/gray/window/icon-error.gif +0 -0
- data/template/resources/images/gray/window/icon-info.gif +0 -0
- data/template/resources/images/gray/window/icon-question.gif +0 -0
- data/template/resources/images/gray/window/icon-warning.gif +0 -0
- data/template/resources/images/gray/window/left-corners.png +0 -0
- data/template/resources/images/gray/window/left-corners.pspimage +0 -0
- data/template/resources/images/gray/window/left-right.png +0 -0
- data/template/resources/images/gray/window/right-corners.png +0 -0
- data/template/resources/images/gray/window/top-bottom.png +0 -0
- data/template/resources/inherited.gif +0 -0
- data/template/resources/member-collapsed.gif +0 -0
- data/template/resources/member-expanded.gif +0 -0
- data/template/resources/member-hover.gif +0 -0
- data/template/resources/method.gif +0 -0
- data/template/resources/pkg-closed.gif +0 -0
- data/template/resources/pkg-open.gif +0 -0
- data/template/resources/pkg.gif +0 -0
- data/template/resources/prop.gif +0 -0
- data/template/resources/s.gif +0 -0
- data/template/resources/static.gif +0 -0
- data/template/resources/style.css +302 -0
- data/template/welcome.html +45 -0
- metadata +481 -0
data/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
JsDuck
|
|
2
|
+
======
|
|
3
|
+
|
|
4
|
+
Simple JavaScript Duckumentation generator.
|
|
5
|
+
|
|
6
|
+
,~~.
|
|
7
|
+
( 6 )-_,
|
|
8
|
+
(\___ )=='-'
|
|
9
|
+
\ . ) )
|
|
10
|
+
\ `-' / hjw
|
|
11
|
+
~'`~'`~'`~'`~
|
|
12
|
+
|
|
13
|
+
JsDuck aims to be a better documentation generator for [ExtJS][].
|
|
14
|
+
While it tries to do everything that [ext-doc][] does, it isn't
|
|
15
|
+
satisfied with it and aims to make your life much easier.
|
|
16
|
+
|
|
17
|
+
Basically JsDuck thinks that the following doc-comment really sucks:
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @class Ext.form.TextField
|
|
21
|
+
* @extends Ext.form.Field
|
|
22
|
+
* <p>Basic text field. Can be used as a direct replacement for traditional
|
|
23
|
+
* text inputs, or as the base class for more sophisticated input controls
|
|
24
|
+
* (like {@link Ext.form.TextArea} and {@link Ext.form.ComboBox}).</p>
|
|
25
|
+
* <p><b><u>Validation</u></b></p>
|
|
26
|
+
* <p>The validation procedure is described in the documentation for
|
|
27
|
+
* {@link #validateValue}.</p>
|
|
28
|
+
* <p><b><u>Alter Validation Behavior</u></b></p>
|
|
29
|
+
* <p>Validation behavior for each field can be configured:</p>
|
|
30
|
+
* <div class="mdetail-params"><ul>
|
|
31
|
+
* <li><code>{@link Ext.form.TextField#invalidText invalidText}</code> :
|
|
32
|
+
* the default validation message to show if any validation step above does
|
|
33
|
+
* not provide a message when invalid</li>
|
|
34
|
+
* <li><code>{@link Ext.form.TextField#maskRe maskRe}</code> :
|
|
35
|
+
* filter out keystrokes before any validation occurs</li>
|
|
36
|
+
* <li><code>{@link Ext.form.TextField#stripCharsRe stripCharsRe}</code> :
|
|
37
|
+
* filter characters after being typed in, but before being validated</li>
|
|
38
|
+
* </ul></div>
|
|
39
|
+
*
|
|
40
|
+
* @constructor Creates a new TextField
|
|
41
|
+
* @param {Object} config Configuration options
|
|
42
|
+
*
|
|
43
|
+
* @xtype textfield
|
|
44
|
+
*/
|
|
45
|
+
Ext.form.TextField = Ext.extend(Ext.form.Field, {
|
|
46
|
+
|
|
47
|
+
Not quite so readable is it? The source of ExtJS is filled with
|
|
48
|
+
comments just like that, and when you use ext-doc, you too are forced
|
|
49
|
+
to write such comments.
|
|
50
|
+
|
|
51
|
+
JsDuck does not like it. Although it can handle comments like this,
|
|
52
|
+
it would like that you wrote comments like that instead:
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Basic text field. Can be used as a direct replacement for traditional
|
|
56
|
+
* text inputs, or as the base class for more sophisticated input controls
|
|
57
|
+
* (like {@link Ext.form.TextArea} and {@link Ext.form.ComboBox}).
|
|
58
|
+
*
|
|
59
|
+
* Validation
|
|
60
|
+
* ----------
|
|
61
|
+
*
|
|
62
|
+
* The validation procedure is described in the documentation for
|
|
63
|
+
* {@link #validateValue}.
|
|
64
|
+
*
|
|
65
|
+
* Alter Validation Behavior
|
|
66
|
+
* -------------------------
|
|
67
|
+
*
|
|
68
|
+
* Validation behavior for each field can be configured:
|
|
69
|
+
*
|
|
70
|
+
* - `{@link Ext.form.TextField#invalidText invalidText}` :
|
|
71
|
+
* the default validation message to show if any validation step above
|
|
72
|
+
* does not provide a message when invalid
|
|
73
|
+
* - `{@link Ext.form.TextField#maskRe maskRe}` :
|
|
74
|
+
* filter out keystrokes before any validation occurs
|
|
75
|
+
* - `{@link Ext.form.TextField#stripCharsRe stripCharsRe}` :
|
|
76
|
+
* filter characters after being typed in, but before being validated
|
|
77
|
+
*
|
|
78
|
+
* @xtype textfield
|
|
79
|
+
*/
|
|
80
|
+
Ext.form.TextField = Ext.extend(Ext.form.Field, {
|
|
81
|
+
|
|
82
|
+
As you can see, JsDuck supports formatting comments with friendly
|
|
83
|
+
[Markdown][] syntax. And it can infer several things from the code
|
|
84
|
+
(like @class and @extends in this case), so you don't have to repeat
|
|
85
|
+
yourself. Also the constructor documentation is inherited from parent
|
|
86
|
+
class - so you don't have to restate that it takes a config object
|
|
87
|
+
again.
|
|
88
|
+
|
|
89
|
+
That's basically it. Have fun.
|
|
90
|
+
|
|
91
|
+
[ExtJS]: http://www.sencha.com/products/js/
|
|
92
|
+
[ext-doc]: http://ext-doc.org/
|
|
93
|
+
[Markdown]: http://daringfireball.net/projects/markdown/
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
Getting it
|
|
97
|
+
----------
|
|
98
|
+
|
|
99
|
+
Standard rubygems install should do:
|
|
100
|
+
|
|
101
|
+
$ [sudo] gem install jsduck
|
|
102
|
+
|
|
103
|
+
For hacking fork it from github.
|
|
104
|
+
|
|
105
|
+
$ git clone git://github.com/nene/jsduck.git
|
|
106
|
+
$ cd jsduck
|
|
107
|
+
$ rake --tasks
|
|
108
|
+
|
|
109
|
+
JsDuck depends on [json][] and [RDiscount][] plus [RSpec][] for tests.
|
|
110
|
+
|
|
111
|
+
[json]: http://flori.github.com/json/
|
|
112
|
+
[RDiscount]: https://github.com/rtomayko/rdiscount
|
|
113
|
+
[RSpec]: http://rspec.info/
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
Usage
|
|
117
|
+
-----
|
|
118
|
+
|
|
119
|
+
Just call it from command line with output directory and a list of
|
|
120
|
+
JavaScript files:
|
|
121
|
+
|
|
122
|
+
$ jsduck --verbose --output some/dir your/project/*.js
|
|
123
|
+
|
|
124
|
+
To specify a lot of files you should probably create a script that
|
|
125
|
+
generates a file list and passes it through `xargs` to `jsduck`.
|
|
126
|
+
|
|
127
|
+
For example to generate documentation for ExtJS:
|
|
128
|
+
|
|
129
|
+
$ find ext-3.3.1/src/ -name '*.js' | egrep -v 'locale/|test/|adapter/' | xargs jsduck -v -o output/
|
|
130
|
+
|
|
131
|
+
The `--verbose` flag creates a lot of output, but at least you will
|
|
132
|
+
see that something is happening.
|
|
133
|
+
|
|
134
|
+
Here's how the resulting documentation will look:
|
|
135
|
+
|
|
136
|
+
* [JsDuck generated documentation](http://triin.net/temp/jsduck/)
|
|
137
|
+
* [Official ExtJS documentation](http://dev.sencha.com/deploy/dev/docs/) (for comparison)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
Documentation
|
|
141
|
+
-------------
|
|
142
|
+
|
|
143
|
+
Overview of documenting your code with JsDuck:
|
|
144
|
+
|
|
145
|
+
* [Class](https://github.com/nene/jsduck/wiki/Class)
|
|
146
|
+
* [Constructor](https://github.com/nene/jsduck/wiki/Constructor)
|
|
147
|
+
* [Config options](https://github.com/nene/jsduck/wiki/Cfg)
|
|
148
|
+
* [Properties](https://github.com/nene/jsduck/wiki/Property)
|
|
149
|
+
* [Methods](https://github.com/nene/jsduck/wiki/Method)
|
|
150
|
+
* [Events](https://github.com/nene/jsduck/wiki/Event)
|
|
151
|
+
|
|
152
|
+
More details:
|
|
153
|
+
|
|
154
|
+
* [List of supported @tags][tags]
|
|
155
|
+
* [List of doc-comment errors(?) found in ExtJS source][errors]
|
|
156
|
+
|
|
157
|
+
[tags]: https://github.com/nene/jsduck/wiki/List-of-supported-@tags
|
|
158
|
+
[errors]: https://github.com/nene/jsduck/wiki/List-of-doc-comment-errors(%3F)-found-in-ExtJS-source
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
Features and differences from ext-doc
|
|
162
|
+
-------------------------------------
|
|
163
|
+
|
|
164
|
+
JsDuck has some strong opinions, so some things are intentionally
|
|
165
|
+
missing.
|
|
166
|
+
|
|
167
|
+
* Support for Markdown in comments
|
|
168
|
+
* More things infered from the code
|
|
169
|
+
* No XML configuration file, just command line options
|
|
170
|
+
* Class documentation header doesn't separately list Package and Class -
|
|
171
|
+
these are IMHO redundant.
|
|
172
|
+
* Class documentation header doesn't duplicate toolbar buttons -
|
|
173
|
+
another redundancy
|
|
174
|
+
* Ext.Component has a component icon too, not only its descendants
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
Missing features
|
|
178
|
+
----------------
|
|
179
|
+
|
|
180
|
+
It's still in early beta, so several things supported by ext-doc are
|
|
181
|
+
currently missing:
|
|
182
|
+
|
|
183
|
+
* Links from documentation to source code
|
|
184
|
+
* List of subclasses
|
|
185
|
+
* Tree of parent classes
|
|
186
|
+
* Syntax highlighting of code examples
|
|
187
|
+
* Search, not just searching from official ExtJS documentation
|
|
188
|
+
* Support for custom @tags
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
Copying
|
|
192
|
+
-------
|
|
193
|
+
|
|
194
|
+
JsDuck is distributed under the terms of the GNU General Public License version 3.
|
|
195
|
+
|
|
196
|
+
JsDuck was developed by [Rene Saarsoo](http://triin.net).
|
|
197
|
+
|
data/Rakefile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'rake'
|
|
3
|
+
|
|
4
|
+
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
|
5
|
+
|
|
6
|
+
require 'spec'
|
|
7
|
+
require 'spec/rake/spectask'
|
|
8
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
|
9
|
+
spec.spec_opts = ["--color"]
|
|
10
|
+
spec.spec_files = FileList["spec/**/*_spec.rb"]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc "Build gem locally"
|
|
14
|
+
task :build do
|
|
15
|
+
system "gem build jsduck.gemspec"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
desc "Install gem locally"
|
|
19
|
+
task :install => :build do
|
|
20
|
+
system "gem install --user-install jsduck"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
task :default => :spec
|
data/bin/jsduck
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# JsDuck is free software: you can redistribute it and/or modify it
|
|
3
|
+
# under the terms of the GNU General Public License as published by
|
|
4
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
5
|
+
# (at your option) any later version.
|
|
6
|
+
#
|
|
7
|
+
# JsDuck is distributed in the hope that it will be useful, but
|
|
8
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
# See the GNU General Public License for more details.
|
|
11
|
+
#
|
|
12
|
+
# You should have received a copy of the GNU General Public License
|
|
13
|
+
# along with JsDuck. If not, see <http://www.gnu.org/licenses/>.
|
|
14
|
+
#
|
|
15
|
+
# Copyright 2010 Rene Saarsoo.
|
|
16
|
+
|
|
17
|
+
# For running when gem not installed
|
|
18
|
+
$:.unshift File.dirname(File.dirname(__FILE__)) + "/lib"
|
|
19
|
+
|
|
20
|
+
require 'jsduck/app'
|
|
21
|
+
require 'optparse'
|
|
22
|
+
|
|
23
|
+
app = JsDuck::App.new
|
|
24
|
+
app.template_dir = File.dirname(File.dirname(__FILE__)) + "/template"
|
|
25
|
+
|
|
26
|
+
opts = OptionParser.new do | opts |
|
|
27
|
+
opts.banner = "Usage: jsduck [options] files..."
|
|
28
|
+
|
|
29
|
+
opts.on('-o', '--output=PATH', "Directory to output all this amazing documentation.") do |path|
|
|
30
|
+
app.output_dir = path
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
opts.on('-t', '--template=PATH', "Directory containing doc-browser UI template.") do |path|
|
|
34
|
+
app.template_dir = path
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
opts.on('-v', '--verbose', "This will fill up your console.") do
|
|
38
|
+
app.verbose = true
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
opts.on('-h', '--help', "Prints this help message") do
|
|
42
|
+
puts opts
|
|
43
|
+
exit
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
app.input_files = opts.parse!(ARGV)
|
|
48
|
+
|
|
49
|
+
if app.input_files.length == 0
|
|
50
|
+
puts "You should specify some input files, otherwise there's nothing I can do :("
|
|
51
|
+
exit(1)
|
|
52
|
+
elsif !app.output_dir
|
|
53
|
+
puts "You should also specify an output directory, where I could write all this amazing documentation."
|
|
54
|
+
exit(1)
|
|
55
|
+
elsif File.exists?(app.output_dir) && !File.directory?(app.output_dir)
|
|
56
|
+
puts "Oh noes! The output directory is not really a directory at all :("
|
|
57
|
+
exit(1)
|
|
58
|
+
elsif !File.exists?(File.dirname(app.output_dir))
|
|
59
|
+
puts "Oh noes! The parent directory for #{output_dir} doesn't exist."
|
|
60
|
+
exit(1)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
app.run()
|
data/jsduck.gemspec
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Gem::Specification.new do |s|
|
|
2
|
+
s.required_rubygems_version = ">= 1.3.7"
|
|
3
|
+
|
|
4
|
+
s.name = 'jsduck'
|
|
5
|
+
s.version = '0.1'
|
|
6
|
+
s.date = '2010-12-27'
|
|
7
|
+
s.summary = "Simple JavaScript Duckumentation generator"
|
|
8
|
+
s.description = "Better ext-doc like JavaScript documentation generator for ExtJS"
|
|
9
|
+
s.homepage = "https://github.com/nene/jsduck"
|
|
10
|
+
s.authors = ["Rene Saarsoo"]
|
|
11
|
+
s.email = "nene@triin.net"
|
|
12
|
+
s.rubyforge_project = s.name
|
|
13
|
+
|
|
14
|
+
s.files = `git ls-files`.split("\n").find_all {|file| file !~ /spec.rb$/ }
|
|
15
|
+
s.executables = ["jsduck"]
|
|
16
|
+
|
|
17
|
+
s.add_dependency 'rdiscount'
|
|
18
|
+
s.add_dependency 'json'
|
|
19
|
+
|
|
20
|
+
s.require_path = 'lib'
|
|
21
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
require 'jsduck/parser'
|
|
2
|
+
require 'jsduck/doc_parser'
|
|
3
|
+
require 'jsduck/merger'
|
|
4
|
+
|
|
5
|
+
module JsDuck
|
|
6
|
+
|
|
7
|
+
# Combines JavaScript Parser, DocParser and Merger.
|
|
8
|
+
# Produces array of classes as result.
|
|
9
|
+
class Aggregator
|
|
10
|
+
def initialize
|
|
11
|
+
@documentation = []
|
|
12
|
+
@classes = {}
|
|
13
|
+
@orphans = []
|
|
14
|
+
@current_class = nil
|
|
15
|
+
@doc_parser = DocParser.new
|
|
16
|
+
@merger = Merger.new
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def parse(input)
|
|
20
|
+
@current_class = nil
|
|
21
|
+
Parser.new(input).parse.each do |docset|
|
|
22
|
+
doc = @doc_parser.parse(docset[:comment])
|
|
23
|
+
code = docset[:code]
|
|
24
|
+
register(@merger.merge(doc, code))
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Registers documentation node either as class or as member of
|
|
29
|
+
# some class.
|
|
30
|
+
def register(node)
|
|
31
|
+
if node[:tagname] == :class
|
|
32
|
+
add_class(node)
|
|
33
|
+
else
|
|
34
|
+
add_member(node)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# When class exists, merge it with class node.
|
|
39
|
+
# Otherwise add as new class.
|
|
40
|
+
def add_class(cls)
|
|
41
|
+
old_cls = @classes[cls[:name]]
|
|
42
|
+
if old_cls
|
|
43
|
+
merge_classes(old_cls, cls)
|
|
44
|
+
@current_class = old_cls
|
|
45
|
+
else
|
|
46
|
+
@current_class = cls
|
|
47
|
+
@documentation << cls
|
|
48
|
+
@classes[cls[:name]] = cls
|
|
49
|
+
insert_orphans(cls)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Merges new class-doc into old one.
|
|
54
|
+
def merge_classes(old, new)
|
|
55
|
+
[:extends, :xtype, :singleton, :private].each do |tag|
|
|
56
|
+
old[tag] = old[tag] || new[tag]
|
|
57
|
+
end
|
|
58
|
+
old[:doc] = old[:doc].length > 0 ? old[:doc] : new[:doc]
|
|
59
|
+
old[:cfg] = old[:cfg] + new[:cfg]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Tries to place members into classes where they belong.
|
|
63
|
+
#
|
|
64
|
+
# @member explicitly defines the containing class, but we can meet
|
|
65
|
+
# item with @member=Foo before we actually meet class Foo - in
|
|
66
|
+
# that case we register them as orphans. (Later when we finally
|
|
67
|
+
# meet class Foo, orphans are inserted into it.)
|
|
68
|
+
#
|
|
69
|
+
# Items without @member belong by default to the preceding class.
|
|
70
|
+
# When no class precedes them - they too are orphaned.
|
|
71
|
+
def add_member(node)
|
|
72
|
+
if node[:member]
|
|
73
|
+
if @classes[node[:member]]
|
|
74
|
+
@classes[node[:member]][node[:tagname]] << node
|
|
75
|
+
else
|
|
76
|
+
add_orphan(node)
|
|
77
|
+
end
|
|
78
|
+
elsif @current_class
|
|
79
|
+
node[:member] = @current_class[:name]
|
|
80
|
+
@current_class[ node[:tagname] ] << node
|
|
81
|
+
else
|
|
82
|
+
add_orphan(node)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def add_orphan(node)
|
|
87
|
+
@orphans << node
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Inserts available orphans to class
|
|
91
|
+
def insert_orphans(cls)
|
|
92
|
+
members = @orphans.find_all {|node| node[:member] == cls[:name] }
|
|
93
|
+
members.each do |node|
|
|
94
|
+
cls[node[:tagname]] << node
|
|
95
|
+
@orphans.delete(node)
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def result
|
|
100
|
+
@documentation + @orphans
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
end
|
data/lib/jsduck/app.rb
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'jsduck/aggregator'
|
|
3
|
+
require 'jsduck/class'
|
|
4
|
+
require 'jsduck/tree'
|
|
5
|
+
require 'jsduck/tree_icons'
|
|
6
|
+
require 'jsduck/page'
|
|
7
|
+
require 'json'
|
|
8
|
+
require 'fileutils'
|
|
9
|
+
|
|
10
|
+
module JsDuck
|
|
11
|
+
|
|
12
|
+
# The main application logic of jsduck
|
|
13
|
+
class App
|
|
14
|
+
# These are basically input parameters for app
|
|
15
|
+
attr_accessor :output_dir
|
|
16
|
+
attr_accessor :template_dir
|
|
17
|
+
attr_accessor :input_files
|
|
18
|
+
attr_accessor :verbose
|
|
19
|
+
|
|
20
|
+
def initialize
|
|
21
|
+
@output_dir = nil
|
|
22
|
+
@template_dir = nil
|
|
23
|
+
@input_files = []
|
|
24
|
+
@verbose = false
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Call this after input parameters set
|
|
28
|
+
def run
|
|
29
|
+
classes = filter_classes(parse_files(@input_files))
|
|
30
|
+
copy_template(@template_dir, @output_dir)
|
|
31
|
+
write_tree(@output_dir+"/output/tree.js", classes)
|
|
32
|
+
write_pages(@output_dir+"/output", classes)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Given array of filenames, parses all files and returns array of
|
|
36
|
+
# documented items in all of those files.
|
|
37
|
+
def parse_files(filenames)
|
|
38
|
+
agr = Aggregator.new
|
|
39
|
+
filenames.each do |name|
|
|
40
|
+
puts "Parsing #{name} ..." if @verbose
|
|
41
|
+
agr.parse(IO.read(name))
|
|
42
|
+
end
|
|
43
|
+
agr.result
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Filters out class-documentations, converting them to Class objects.
|
|
47
|
+
# For each other type, prints a warning message and discards it
|
|
48
|
+
def filter_classes(docs)
|
|
49
|
+
classes = {}
|
|
50
|
+
docs.each do |d|
|
|
51
|
+
if d[:tagname] == :class
|
|
52
|
+
classes[d[:name]] = Class.new(d, classes)
|
|
53
|
+
else
|
|
54
|
+
puts "Warning: Ignoring " + d[:tagname].to_s + ": " + (d[:name] || "")
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
classes.values
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Given array of doc-objects, generates namespace tree and writes in
|
|
61
|
+
# in JSON form into a file.
|
|
62
|
+
def write_tree(filename, docs)
|
|
63
|
+
tree = Tree.new.create(docs)
|
|
64
|
+
icons = TreeIcons.new.extract_icons(tree)
|
|
65
|
+
js = "Docs.classData = " + JSON.generate( tree ) + ";"
|
|
66
|
+
js += "Docs.icons = " + JSON.generate( icons ) + ";"
|
|
67
|
+
File.open(filename, 'w') {|f| f.write(js) }
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Writes documentation page for each class
|
|
71
|
+
def write_pages(path, docs)
|
|
72
|
+
docs.each do |cls|
|
|
73
|
+
filename = path + "/" + cls[:name] + ".html"
|
|
74
|
+
puts "Writing to #{filename} ..." if @verbose
|
|
75
|
+
File.open(filename, 'w') {|f| f.write( Page.new(cls).to_html ) }
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def copy_template(template_dir, dir)
|
|
80
|
+
puts "Copying template files to #{dir}..." if @verbose
|
|
81
|
+
if File.exists?(dir)
|
|
82
|
+
FileUtils.rm_r(dir)
|
|
83
|
+
end
|
|
84
|
+
FileUtils.cp_r(template_dir, dir)
|
|
85
|
+
FileUtils.mkdir(dir + "/output")
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
end
|