jsduck 0.6.1 → 2.0.pre
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 +4 -0
- data/README.md +35 -13
- data/Rakefile +129 -0
- data/bin/jsduck +112 -20
- data/jsduck.gemspec +10 -7
- data/lib/jsduck/aggregator.rb +46 -20
- data/lib/jsduck/aliases.rb +39 -0
- data/lib/jsduck/app.rb +123 -51
- data/lib/jsduck/categories.rb +132 -0
- data/lib/jsduck/class.rb +71 -18
- data/lib/jsduck/doc_formatter.rb +61 -26
- data/lib/jsduck/doc_parser.rb +53 -2
- data/lib/jsduck/exporter.rb +14 -15
- data/lib/jsduck/guides.rb +110 -0
- data/lib/jsduck/js_parser.rb +18 -4
- data/lib/jsduck/jsonp.rb +17 -0
- data/lib/jsduck/logger.rb +36 -0
- data/lib/jsduck/merger.rb +69 -51
- data/lib/jsduck/page.rb +1 -1
- data/lib/jsduck/relations.rb +14 -3
- data/lib/jsduck/{members.rb → search_data.rb} +3 -28
- data/lib/jsduck/source_file.rb +4 -4
- data/lib/jsduck/source_writer.rb +2 -2
- data/lib/jsduck/timer.rb +6 -2
- data/lib/jsduck/tree.rb +29 -16
- data/lib/jsduck/tree_icons.rb +1 -1
- data/template/README.md +14 -0
- data/template/app.js +25 -0
- data/template/app/Application.js +53 -0
- data/template/app/Favorites.js +88 -0
- data/template/app/History.js +45 -0
- data/template/app/LocalStore.js +45 -0
- data/template/app/Settings.js +39 -0
- data/template/app/Syntax.js +20 -0
- data/template/app/controller/Classes.js +301 -0
- data/template/app/controller/Search.js +156 -0
- data/template/app/model/Favorite.js +11 -0
- data/template/app/model/Setting.js +11 -0
- data/template/app/store/Favorites.js +7 -0
- data/template/app/store/Search.js +14 -0
- data/template/app/store/Settings.js +7 -0
- data/template/app/view/ClassGrid.js +109 -0
- data/template/app/view/HoverMenu.js +59 -0
- data/template/app/view/HoverMenuButton.js +147 -0
- data/template/app/view/Viewport.js +240 -0
- data/template/app/view/cls/Header.js +47 -0
- data/template/app/view/cls/Overview.js +415 -0
- data/template/app/view/cls/Toolbar.js +199 -0
- data/template/app/view/index/Container.js +63 -0
- data/template/app/view/search/Dropdown.js +53 -0
- data/template/app/view/tree/Tree.js +133 -0
- data/template/favicon.ico +0 -0
- data/template/index.html +32 -37
- data/template/{resources/prettify → prettify}/prettify.css +0 -0
- data/template/{resources/prettify → prettify}/prettify.js +0 -0
- data/template/resources/images/class-m.png +0 -0
- data/template/resources/images/class-sm.png +0 -0
- data/template/resources/images/component-m.png +0 -0
- data/template/resources/images/configs.png +0 -0
- data/template/resources/images/data-package.png +0 -0
- data/template/resources/images/doc-m.png +0 -0
- data/template/resources/images/drag-bar-center.png +0 -0
- data/template/resources/{elbow-end.gif → images/elbow-end.gif} +0 -0
- data/template/resources/images/events.png +0 -0
- data/template/resources/images/expandcollapse.png +0 -0
- data/template/resources/images/guide-icon.png +0 -0
- data/template/resources/images/guides.png +0 -0
- data/template/resources/images/headBG.png +0 -0
- data/template/resources/images/header.gif +0 -0
- data/template/resources/images/icon.png +0 -0
- data/template/resources/images/icons.png +0 -0
- data/template/resources/images/loading-title.png +0 -0
- data/template/resources/images/loading.gif +0 -0
- data/template/resources/{member-collapsed.gif → images/member-collapsed.gif} +0 -0
- data/template/resources/{member-expanded.gif → images/member-expanded.gif} +0 -0
- data/template/resources/{member-hover.gif → images/member-hover.gif} +0 -0
- data/template/resources/images/methods.png +0 -0
- data/template/resources/images/model.png +0 -0
- data/template/resources/images/properties.png +0 -0
- data/template/resources/images/root-lines.png +0 -0
- data/template/resources/images/search-box.png +0 -0
- data/template/resources/images/singleton-m.png +0 -0
- data/template/resources/images/version-tabs.png +0 -0
- data/template/resources/images/x.png +0 -0
- data/template/resources/images/x12.png +0 -0
- metadata +84 -387
- data/lib/jsduck/cfg_table.rb +0 -21
- data/lib/jsduck/event_table.rb +0 -33
- data/lib/jsduck/inheritance_tree.rb +0 -42
- data/lib/jsduck/long_params.rb +0 -30
- data/lib/jsduck/method_table.rb +0 -45
- data/lib/jsduck/property_table.rb +0 -21
- data/lib/jsduck/short_params.rb +0 -24
- data/lib/jsduck/table.rb +0 -121
- data/template/resources/TabCloseMenu.js +0 -150
- 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 +0 -6993
- data/template/resources/css/xtheme-gray.css +0 -1654
- data/template/resources/docs.css +0 -361
- data/template/resources/docs.gif +0 -0
- data/template/resources/docs.js +0 -769
- 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 +0 -11
- data/template/resources/ext-base.js +0 -7
- 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/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 +0 -291
- data/template/welcome.html +0 -45
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -102,7 +102,7 @@ Standard rubygems install should do:
|
|
|
102
102
|
|
|
103
103
|
For hacking fork it from github.
|
|
104
104
|
|
|
105
|
-
$ git clone git://github.com/
|
|
105
|
+
$ git clone git://github.com/senchalabs/jsduck.git
|
|
106
106
|
$ cd jsduck
|
|
107
107
|
$ rake --tasks
|
|
108
108
|
|
|
@@ -152,20 +152,20 @@ Documentation
|
|
|
152
152
|
|
|
153
153
|
Overview of documenting your code with JsDuck:
|
|
154
154
|
|
|
155
|
-
* [Class](https://github.com/
|
|
156
|
-
* [Constructor](https://github.com/
|
|
157
|
-
* [Config options](https://github.com/
|
|
158
|
-
* [Properties](https://github.com/
|
|
159
|
-
* [Methods](https://github.com/
|
|
160
|
-
* [Events](https://github.com/
|
|
155
|
+
* [Class](https://github.com/senchalabs/jsduck/wiki/Class)
|
|
156
|
+
* [Constructor](https://github.com/senchalabs/jsduck/wiki/Constructor)
|
|
157
|
+
* [Config options](https://github.com/senchalabs/jsduck/wiki/Cfg)
|
|
158
|
+
* [Properties](https://github.com/senchalabs/jsduck/wiki/Property)
|
|
159
|
+
* [Methods](https://github.com/senchalabs/jsduck/wiki/Method)
|
|
160
|
+
* [Events](https://github.com/senchalabs/jsduck/wiki/Event)
|
|
161
161
|
|
|
162
162
|
More details:
|
|
163
163
|
|
|
164
164
|
* [List of supported @tags][tags]
|
|
165
165
|
* [List of doc-comment errors(?) found in ExtJS source][errors]
|
|
166
166
|
|
|
167
|
-
[tags]: https://github.com/
|
|
168
|
-
[errors]: https://github.com/
|
|
167
|
+
[tags]: https://github.com/senchalabs/jsduck/wiki/List-of-supported-@tags
|
|
168
|
+
[errors]: https://github.com/senchalabs/jsduck/wiki/List-of-doc-comment-errors(%3F)-found-in-ExtJS-source
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
Features and differences from ext-doc
|
|
@@ -204,10 +204,30 @@ and [Nick Poulden](https://github.com/nick).
|
|
|
204
204
|
Changelog
|
|
205
205
|
---------
|
|
206
206
|
|
|
207
|
-
* 0.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
* 2.0.pre - Prerelease of the Ext4-themed version. Generates docs in
|
|
208
|
+
exactly the same style as the official ExtJS4 docs. Lots and lots
|
|
209
|
+
of changes. But also possibly several bugs. Use the --pre option
|
|
210
|
+
to install:
|
|
211
|
+
|
|
212
|
+
$ gem install --pre jsduck
|
|
213
|
+
|
|
214
|
+
To run it on ExtJS4:
|
|
215
|
+
|
|
216
|
+
$ jsduck --output your/docs/ ext-4.0.2a/src --ignore-global
|
|
217
|
+
|
|
218
|
+
This will generate a lot of warnings. Those should be fixed in some
|
|
219
|
+
upcoming release of ExtJS4. You can disable them with `--no-warnings`.
|
|
220
|
+
Additionally you will need to copy over the images:
|
|
221
|
+
|
|
222
|
+
$ cp -r ext-4.0.2a/docs/doc-resources your/docs/doc-resources
|
|
223
|
+
|
|
224
|
+
You can also get the class-listing to the main page by downloading
|
|
225
|
+
[overviewData.json][] and passing it to JSDuck with:
|
|
226
|
+
|
|
227
|
+
--categories overviewData.json
|
|
228
|
+
|
|
229
|
+
This file should in the future be found inside the ExtJS4 release,
|
|
230
|
+
along with the source code for guides.
|
|
211
231
|
|
|
212
232
|
* 0.6 - JsDuck is now used for creating the official ExtJS4 documentation.
|
|
213
233
|
* Automatic linking of class names found in comments. Instead of writing
|
|
@@ -265,3 +285,5 @@ Changelog
|
|
|
265
285
|
* List of subclasses
|
|
266
286
|
|
|
267
287
|
* 0.1 - initial version.
|
|
288
|
+
|
|
289
|
+
[overviewData.json]: https://raw.github.com/senchalabs/jsduck/3ee0653554da1ddc54576e7df442d08c9a6d22fd/template/overviewData.json
|
data/Rakefile
CHANGED
|
@@ -20,4 +20,133 @@ task :install => :build do
|
|
|
20
20
|
system "gem install --user-install jsduck"
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
def load_sdk_vars
|
|
24
|
+
if File.exists?("sdk-vars.rb")
|
|
25
|
+
require "sdk-vars.rb"
|
|
26
|
+
else
|
|
27
|
+
puts "Error: sdk-vars.rb not found."
|
|
28
|
+
puts
|
|
29
|
+
puts "Please create file sdk-vars.rb and define constants SDK_DIR and OUT_DIR in it."
|
|
30
|
+
puts
|
|
31
|
+
puts "For example:"
|
|
32
|
+
puts
|
|
33
|
+
puts " SDK_DIR='/path/to/SDK'"
|
|
34
|
+
puts " OUT_DIR='/path/to/ouput/dir'"
|
|
35
|
+
puts " EXT_DIR='/path/to/ext/dir'"
|
|
36
|
+
exit 1
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def run_jsduck(extra_options)
|
|
41
|
+
# Pass multiple arguments to system, so we'll take advantage of the built-in escaping
|
|
42
|
+
system(*[
|
|
43
|
+
"ruby", "bin/jsduck",
|
|
44
|
+
# --external=Error to ignore the Error class that Ext.Error extends.
|
|
45
|
+
"--external", "Error",
|
|
46
|
+
"--guides", "#{SDK_DIR}/guides",
|
|
47
|
+
"--guides-order", "getting,class,application,layouts,data,grid,tree,drawing,forms,components,theming,direct",
|
|
48
|
+
"--categories", "#{SDK_DIR}/extjs/doc-resources/categories.json",
|
|
49
|
+
"--output", "#{OUT_DIR}",
|
|
50
|
+
].concat(extra_options))
|
|
51
|
+
|
|
52
|
+
# Finally copy over the images that documentation links to.
|
|
53
|
+
system "cp -r #{SDK_DIR}/extjs/doc-resources #{OUT_DIR}/doc-resources"
|
|
54
|
+
system "cp -r #{SDK_DIR}/platform/doc-resources/* #{OUT_DIR}/doc-resources"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
desc "Run JSDuck on ExtJS SDK"
|
|
58
|
+
task :sdk do
|
|
59
|
+
load_sdk_vars
|
|
60
|
+
run_jsduck([
|
|
61
|
+
"--extjs-path", "extjs/ext-debug.js",
|
|
62
|
+
# to create symbolic links to template files instead of copying them over.
|
|
63
|
+
# Useful for development. Turn off for deployment.
|
|
64
|
+
"--template-links",
|
|
65
|
+
"#{SDK_DIR}/extjs/src",
|
|
66
|
+
"#{SDK_DIR}/platform/src",
|
|
67
|
+
"#{SDK_DIR}/platform/core/src",
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def run_jsduck_export(extra_options, ext_dir)
|
|
72
|
+
load_sdk_vars
|
|
73
|
+
rev = `git rev-parse HEAD`.slice(0, 7)
|
|
74
|
+
|
|
75
|
+
run_jsduck([
|
|
76
|
+
"--title", "Ext JS 4.0.2a API Documentation",
|
|
77
|
+
"--footer", "ExtJS 4.0.2a Documentation from Sencha. Generated with <a href='https://github.com/nene/jsduck'>JSDuck</a> revison #{rev}",
|
|
78
|
+
"#{SDK_DIR}/extjs/src",
|
|
79
|
+
"#{SDK_DIR}/platform/src",
|
|
80
|
+
"#{SDK_DIR}/platform/core/src",
|
|
81
|
+
].concat(extra_options))
|
|
82
|
+
|
|
83
|
+
system "rm #{OUT_DIR}/extjs"
|
|
84
|
+
system "mkdir -p #{OUT_DIR}/extjs/resources/themes/images"
|
|
85
|
+
system "cp #{EXT_DIR}/ext-all.js #{OUT_DIR}/extjs"
|
|
86
|
+
system "cp -r #{ext_dir}/resources/themes/images/default #{OUT_DIR}/extjs/resources/themes/images"
|
|
87
|
+
system "rm -rf #{ext_dir}/resources/sass"
|
|
88
|
+
system "rm -rf #{OUT_DIR}/resources/.sass-cache"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
desc "Run JSDuck on ExtJS SDK to create release version of docs app"
|
|
92
|
+
task :export do
|
|
93
|
+
load_sdk_vars
|
|
94
|
+
run_jsduck_export([
|
|
95
|
+
"--append-html", <<-EOHTML
|
|
96
|
+
<div id="notice-text" style="display: none">
|
|
97
|
+
Use <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a> for up to date documentation and features
|
|
98
|
+
</div>
|
|
99
|
+
EOHTML
|
|
100
|
+
], EXT_DIR)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
desc "Run JSDuck on ExtJS SDK to create live docs app"
|
|
104
|
+
task :live_docs do
|
|
105
|
+
load_sdk_vars
|
|
106
|
+
run_jsduck_export([
|
|
107
|
+
"--append-html", <<-EOHTML
|
|
108
|
+
<script type="text/javascript">
|
|
109
|
+
var _gaq = _gaq || [];
|
|
110
|
+
_gaq.push(['_setAccount', 'UA-1396058-10']);
|
|
111
|
+
_gaq.push(['_trackPageview']);
|
|
112
|
+
(function() {
|
|
113
|
+
var ga = document.createElement('script');
|
|
114
|
+
ga.type = 'text/javascript';
|
|
115
|
+
ga.async = true;
|
|
116
|
+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
117
|
+
var s = document.getElementsByTagName('script')[0];
|
|
118
|
+
s.parentNode.insertBefore(ga, s);
|
|
119
|
+
})();
|
|
120
|
+
|
|
121
|
+
Docs.initEventTracking = function() {
|
|
122
|
+
Docs.App.getController('Classes').addListener({
|
|
123
|
+
showClass: function(cls) {
|
|
124
|
+
_gaq.push(['_trackEvent', 'Classes', 'Show', cls]);
|
|
125
|
+
},
|
|
126
|
+
showMember: function(cls, anchor) {
|
|
127
|
+
_gaq.push(['_trackEvent', 'Classes', 'Member', cls + ' - ' + anchor]);
|
|
128
|
+
},
|
|
129
|
+
showGuide: function(guide) {
|
|
130
|
+
_gaq.push(['_trackEvent', 'Guides', 'Show', guide]);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
</script>
|
|
135
|
+
EOHTML
|
|
136
|
+
], "#{SDK_DIR}/extjs/build/sdk")
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
desc "Run JSDuck on the Docs app itself"
|
|
140
|
+
task :docs do
|
|
141
|
+
load_sdk_vars
|
|
142
|
+
run_jsduck([
|
|
143
|
+
"--template-links",
|
|
144
|
+
"#{SDK_DIR}/extjs/src",
|
|
145
|
+
"#{SDK_DIR}/platform/src",
|
|
146
|
+
"#{SDK_DIR}/platform/core/src",
|
|
147
|
+
"template/app",
|
|
148
|
+
"template/app.js",
|
|
149
|
+
])
|
|
150
|
+
end
|
|
151
|
+
|
|
23
152
|
task :default => :spec
|
data/bin/jsduck
CHANGED
|
@@ -24,57 +24,137 @@ app = JsDuck::App.new
|
|
|
24
24
|
app.template_dir = File.dirname(File.dirname(__FILE__)) + "/template"
|
|
25
25
|
|
|
26
26
|
opts = OptionParser.new do | opts |
|
|
27
|
-
opts.banner = "Usage: jsduck [options] files/dirs
|
|
27
|
+
opts.banner = "Usage: jsduck [options] files/dirs...\n\n"
|
|
28
28
|
|
|
29
|
-
opts.on('-o', '--output=PATH',
|
|
29
|
+
opts.on('-o', '--output=PATH',
|
|
30
|
+
"Directory to output all this amazing documentation.",
|
|
31
|
+
"This option MUST be specified.", " ") do |path|
|
|
30
32
|
app.output_dir = path
|
|
31
33
|
end
|
|
32
34
|
|
|
33
|
-
opts.on('-
|
|
34
|
-
app.
|
|
35
|
+
opts.on('--ignore-global', "Turns off the creation of global class.", " ") do
|
|
36
|
+
app.ignore_global = true
|
|
35
37
|
end
|
|
36
38
|
|
|
37
|
-
opts.on('--
|
|
38
|
-
app.
|
|
39
|
+
opts.on('--private-classes', "Include private classes to docs.", " ") do
|
|
40
|
+
app.show_private_classes = true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
opts.on('--external=CLASSNAME',
|
|
44
|
+
"Declares an external class. When declared as",
|
|
45
|
+
"external, inheriting from this class will not",
|
|
46
|
+
"trigger warnings. Useful when you are extending",
|
|
47
|
+
"a class for which you can not supply source code.", " ") do |classname|
|
|
48
|
+
app.external_classes << classname
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
opts.on('--no-warnings', "Turns off warnings.", " ") do
|
|
52
|
+
app.warnings = false
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
opts.on('-v', '--verbose', "This will fill up your console.", " ") do
|
|
56
|
+
app.verbose = true
|
|
39
57
|
end
|
|
40
58
|
|
|
41
|
-
opts.
|
|
59
|
+
opts.separator "Customizing output:"
|
|
60
|
+
opts.separator ""
|
|
61
|
+
|
|
62
|
+
opts.on('--title=TEXT',
|
|
63
|
+
"Custom title for the documentation app.",
|
|
64
|
+
"Defaults to 'ExtJS API Documentation'", " ") do |text|
|
|
65
|
+
app.title = text
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
opts.on('--footer=TEXT',
|
|
69
|
+
"Custom footer text for the documentation app.",
|
|
70
|
+
"Defaults to: 'Generated with JSDuck.'", " ") do |text|
|
|
71
|
+
app.footer = text
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
opts.on('--append-html=HTML', "Extra code to append to the index.html page.", " ") do |html|
|
|
75
|
+
app.append_html = html
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
opts.on('--guides=PATH', "Path to guides directory.",
|
|
79
|
+
"Each subdirectory of that is treated as a guide",
|
|
80
|
+
"and is expectd to contain a REAME.md file,",
|
|
81
|
+
"which will be converted into a README.js.", " ") do |path|
|
|
82
|
+
app.guides_dir = path
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
opts.on('--guides-order=a,b,c', Array,
|
|
86
|
+
"The order in which the guides should appear. When",
|
|
87
|
+
"a guide name is not specified here, it will be excluded.",
|
|
88
|
+
"You don't have to write the whole name of the guide,",
|
|
89
|
+
"just the beginning of it, as long as it's unique.", " ") do |list|
|
|
90
|
+
app.guides_order = list
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
opts.on('--categories=PATH',
|
|
94
|
+
"Path to JSON file which defines categories for classes.", " ") do |path|
|
|
95
|
+
app.categories_path = path
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
opts.on('--link=TPL',
|
|
99
|
+
"HTML template for replacing {@link}.",
|
|
42
100
|
"Possible placeholders:",
|
|
43
101
|
"%c - full class name (e.g. 'Ext.Panel')",
|
|
44
|
-
"%m - class member name
|
|
45
|
-
"
|
|
102
|
+
"%m - class member name prefixed with member type",
|
|
103
|
+
" (e.g. 'method-urlEncode')",
|
|
104
|
+
"%# - inserts '#' if member name present",
|
|
105
|
+
"%- - inserts '-' if member name present",
|
|
46
106
|
"%a - anchor text for link",
|
|
47
|
-
"Default
|
|
107
|
+
"Default is: '<a href=\"#/api/%c%-%m\" rel=\"%c%-%m\" class=\"docClass\">%a</a>'", " ") do |tpl|
|
|
48
108
|
app.link_tpl = tpl
|
|
49
109
|
end
|
|
50
110
|
|
|
51
|
-
opts.on('--img=TPL',
|
|
111
|
+
opts.on('--img=TPL',
|
|
112
|
+
"HTML template for replacing {@img}.",
|
|
52
113
|
"Possible placeholders:",
|
|
53
114
|
"%u - URL from @img tag (e.g. 'some/path.png')",
|
|
54
115
|
"%a - alt text for image",
|
|
55
|
-
"Default
|
|
116
|
+
"Default is: '<p><img src=\"doc-resources/%u\" alt=\"%a\"></p>'", " ") do |tpl|
|
|
56
117
|
app.img_tpl = tpl
|
|
57
118
|
end
|
|
58
119
|
|
|
120
|
+
opts.on('--json', "Produces JSON export instead of HTML documentation.", " ") do
|
|
121
|
+
app.export = :json
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
opts.separator "Debugging:"
|
|
125
|
+
opts.separator ""
|
|
126
|
+
|
|
59
127
|
# For debugging it's often useful to set --processes=0 to get deterministic results.
|
|
60
|
-
opts.on('-p', '--processes=COUNT',
|
|
128
|
+
opts.on('-p', '--processes=COUNT',
|
|
129
|
+
"The number of parallel processes to use.",
|
|
61
130
|
"Defaults to the number of processors/cores.",
|
|
62
|
-
"Set to 0 to disable parallel processing completely.") do |count|
|
|
131
|
+
"Set to 0 to disable parallel processing completely.", " ") do |count|
|
|
63
132
|
app.processes = count.to_i
|
|
64
133
|
end
|
|
65
134
|
|
|
66
|
-
opts.on('--
|
|
67
|
-
|
|
135
|
+
opts.on('--template=PATH',
|
|
136
|
+
"Directory containing doc-browser UI template.", " ") do |path|
|
|
137
|
+
app.template_dir = path
|
|
68
138
|
end
|
|
69
139
|
|
|
70
|
-
opts.on('-
|
|
71
|
-
|
|
140
|
+
opts.on('--template-links',
|
|
141
|
+
"Instead of copying template files, create symbolic",
|
|
142
|
+
"links. Useful for template files development.",
|
|
143
|
+
"Only works on platforms supporting symbolic links.", " ") do
|
|
144
|
+
app.template_links = true
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
opts.on('--extjs-path=PATH',
|
|
148
|
+
"Path for main ExtJS JavaScript file. Useful for specifying",
|
|
149
|
+
"something different than extjs/ext-all.js", " ") do |path|
|
|
150
|
+
app.extjs_path = path
|
|
72
151
|
end
|
|
73
152
|
|
|
74
|
-
opts.on('-h', '--help', "Prints this help message") do
|
|
153
|
+
opts.on('-h', '--help', "Prints this help message", " ") do
|
|
75
154
|
puts opts
|
|
76
155
|
exit
|
|
77
156
|
end
|
|
157
|
+
|
|
78
158
|
end
|
|
79
159
|
|
|
80
160
|
js_files = []
|
|
@@ -102,7 +182,19 @@ elsif File.exists?(app.output_dir) && !File.directory?(app.output_dir)
|
|
|
102
182
|
puts "Oh noes! The output directory is not really a directory at all :("
|
|
103
183
|
exit(1)
|
|
104
184
|
elsif !File.exists?(File.dirname(app.output_dir))
|
|
105
|
-
puts "Oh noes! The parent directory for #{output_dir} doesn't exist."
|
|
185
|
+
puts "Oh noes! The parent directory for #{app.output_dir} doesn't exist."
|
|
186
|
+
exit(1)
|
|
187
|
+
elsif !File.exists?(app.template_dir + "/extjs")
|
|
188
|
+
puts "Oh noes! The template directory does not contain extjs/ directory :("
|
|
189
|
+
puts "Please copy ExtJS over to template/extjs or create symlink."
|
|
190
|
+
puts "For example:"
|
|
191
|
+
puts " $ cp -r /path/to/ext-4.0.0 " + app.template_dir + "/extjs"
|
|
192
|
+
exit(1)
|
|
193
|
+
elsif !File.exists?(app.template_dir + "/resources/css")
|
|
194
|
+
puts "Oh noes! CSS files for custom ExtJS theme missing :("
|
|
195
|
+
puts "Please compile SASS files in template/resources/sass with compass."
|
|
196
|
+
puts "For example:"
|
|
197
|
+
puts " $ compass compile " + app.template_dir + "/resources/sass"
|
|
106
198
|
exit(1)
|
|
107
199
|
end
|
|
108
200
|
|
data/jsduck.gemspec
CHANGED
|
@@ -2,18 +2,21 @@ Gem::Specification.new do |s|
|
|
|
2
2
|
s.required_rubygems_version = ">= 1.3.7"
|
|
3
3
|
|
|
4
4
|
s.name = 'jsduck'
|
|
5
|
-
s.version = '0.
|
|
6
|
-
s.date = '2011-
|
|
5
|
+
s.version = '2.0.pre'
|
|
6
|
+
s.date = '2011-06-30'
|
|
7
7
|
s.summary = "Simple JavaScript Duckumentation generator"
|
|
8
|
-
s.description = "
|
|
9
|
-
s.homepage = "https://github.com/
|
|
10
|
-
s.authors = ["Rene Saarsoo"]
|
|
11
|
-
s.email = "
|
|
8
|
+
s.description = "Documentation generator for ExtJS 4"
|
|
9
|
+
s.homepage = "https://github.com/senchalabs/jsduck"
|
|
10
|
+
s.authors = ["Rene Saarsoo", "Nick Poulden"]
|
|
11
|
+
s.email = "rene.saarsoo@sencha.com"
|
|
12
12
|
s.rubyforge_project = s.name
|
|
13
13
|
|
|
14
14
|
s.files = `git ls-files`.split("\n").find_all do |file|
|
|
15
|
-
file !~ /spec.rb$/ && file !~ /benchmark/
|
|
15
|
+
file !~ /spec.rb$/ && file !~ /benchmark/ && file !~ /resources\/sass/
|
|
16
16
|
end
|
|
17
|
+
# Add files not in git
|
|
18
|
+
s.files += ['template/extjs/ext-all.js']
|
|
19
|
+
s.files += Dir['template/resources/css/*.css']
|
|
17
20
|
|
|
18
21
|
s.executables = ["jsduck"]
|
|
19
22
|
|
data/lib/jsduck/aggregator.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'jsduck/class'
|
|
2
|
+
|
|
1
3
|
module JsDuck
|
|
2
4
|
|
|
3
5
|
# Combines JavaScript Parser, DocParser and Merger.
|
|
@@ -48,14 +50,16 @@ module JsDuck
|
|
|
48
50
|
|
|
49
51
|
# Merges new class-doc into old one.
|
|
50
52
|
def merge_classes(old, new)
|
|
51
|
-
[:extends, :xtype, :singleton, :private].each do |tag|
|
|
53
|
+
[:extends, :xtype, :singleton, :private, :protected].each do |tag|
|
|
52
54
|
old[tag] = old[tag] || new[tag]
|
|
53
55
|
end
|
|
54
|
-
[:mixins, :alternateClassNames].each do |tag|
|
|
56
|
+
[:mixins, :alternateClassNames, :xtypes].each do |tag|
|
|
55
57
|
old[tag] = old[tag] + new[tag]
|
|
56
58
|
end
|
|
57
59
|
old[:doc] = old[:doc].length > 0 ? old[:doc] : new[:doc]
|
|
58
|
-
|
|
60
|
+
# Additionally the doc-comment can contain configs and constructor
|
|
61
|
+
old[:members][:cfg] += new[:members][:cfg]
|
|
62
|
+
old[:members][:method] += new[:members][:method]
|
|
59
63
|
end
|
|
60
64
|
|
|
61
65
|
# Tries to place members into classes where they belong.
|
|
@@ -68,39 +72,43 @@ module JsDuck
|
|
|
68
72
|
# Items without @member belong by default to the preceding class.
|
|
69
73
|
# When no class precedes them - they too are orphaned.
|
|
70
74
|
def add_member(node)
|
|
71
|
-
if node[:
|
|
72
|
-
if @classes[node[:
|
|
73
|
-
@classes[node[:
|
|
75
|
+
if node[:owner]
|
|
76
|
+
if @classes[node[:owner]]
|
|
77
|
+
add_to_class(@classes[node[:owner]], node)
|
|
74
78
|
else
|
|
75
79
|
add_orphan(node)
|
|
76
80
|
end
|
|
77
81
|
elsif @current_class
|
|
78
|
-
node[:
|
|
79
|
-
@current_class
|
|
82
|
+
node[:owner] = @current_class[:name]
|
|
83
|
+
add_to_class(@current_class, node)
|
|
80
84
|
else
|
|
81
85
|
add_orphan(node)
|
|
82
86
|
end
|
|
83
87
|
end
|
|
84
88
|
|
|
89
|
+
def add_to_class(cls, member)
|
|
90
|
+
cls[member[:static] ? :statics : :members][member[:tagname]] << member
|
|
91
|
+
end
|
|
92
|
+
|
|
85
93
|
def add_orphan(node)
|
|
86
94
|
@orphans << node
|
|
87
95
|
end
|
|
88
96
|
|
|
89
97
|
# Inserts available orphans to class
|
|
90
98
|
def insert_orphans(cls)
|
|
91
|
-
members = @orphans.find_all {|node| node[:
|
|
99
|
+
members = @orphans.find_all {|node| node[:owner] == cls[:name] }
|
|
92
100
|
members.each do |node|
|
|
93
|
-
cls
|
|
101
|
+
add_to_class(cls, node)
|
|
94
102
|
@orphans.delete(node)
|
|
95
103
|
end
|
|
96
104
|
end
|
|
97
105
|
|
|
98
|
-
# Creates classes for orphans that have :
|
|
106
|
+
# Creates classes for orphans that have :owner property defined,
|
|
99
107
|
# and then inserts orphans to these classes.
|
|
100
108
|
def classify_orphans
|
|
101
109
|
@orphans.each do |orph|
|
|
102
|
-
if orph[:
|
|
103
|
-
class_name = orph[:
|
|
110
|
+
if orph[:owner]
|
|
111
|
+
class_name = orph[:owner]
|
|
104
112
|
if !@classes[class_name]
|
|
105
113
|
add_empty_class(class_name)
|
|
106
114
|
end
|
|
@@ -117,7 +125,7 @@ module JsDuck
|
|
|
117
125
|
|
|
118
126
|
add_empty_class("global", "Global variables and functions.")
|
|
119
127
|
@orphans.each do |orph|
|
|
120
|
-
orph[:
|
|
128
|
+
orph[:owner] = "global"
|
|
121
129
|
add_member(orph)
|
|
122
130
|
end
|
|
123
131
|
@orphans = []
|
|
@@ -130,18 +138,36 @@ module JsDuck
|
|
|
130
138
|
:doc => doc,
|
|
131
139
|
:mixins => [],
|
|
132
140
|
:alternateClassNames => [],
|
|
133
|
-
:
|
|
134
|
-
:
|
|
135
|
-
:method => [],
|
|
136
|
-
:event => [],
|
|
137
|
-
:css_var => [],
|
|
138
|
-
:css_mixin => [],
|
|
141
|
+
:members => Class.default_members_hash,
|
|
142
|
+
:statics => Class.default_members_hash,
|
|
139
143
|
:filename => "",
|
|
140
144
|
:html_filename => "",
|
|
141
145
|
:linenr => 0,
|
|
142
146
|
})
|
|
143
147
|
end
|
|
144
148
|
|
|
149
|
+
# Appends Ext4 options parameter to each event parameter list.
|
|
150
|
+
# But only when we are dealing with Ext4 codebase.
|
|
151
|
+
def append_ext4_event_options
|
|
152
|
+
return unless ext4?
|
|
153
|
+
|
|
154
|
+
options = {
|
|
155
|
+
:tagname => :param,
|
|
156
|
+
:name => "options",
|
|
157
|
+
:type => "Object",
|
|
158
|
+
:doc => "The options object passed to {@link Ext.util.Observable#addListener}."
|
|
159
|
+
}
|
|
160
|
+
@classes.each_value do |cls|
|
|
161
|
+
cls[:members][:event].each {|e| e[:params] << options }
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Are we dealing with ExtJS 4?
|
|
166
|
+
# True if any of the classes is defined with Ext.define()
|
|
167
|
+
def ext4?
|
|
168
|
+
@documentation.any? {|cls| cls[:code_type] == :ext_define }
|
|
169
|
+
end
|
|
170
|
+
|
|
145
171
|
def result
|
|
146
172
|
@documentation + @orphans
|
|
147
173
|
end
|