├── .npmignore ├── tests ├── input │ ├── folders1 │ │ ├── yuidoc.json │ │ └── one │ │ │ └── two │ │ │ └── yuidoc.json │ ├── folders3 │ │ ├── yuidoc.json │ │ ├── one │ │ │ ├── two │ │ │ │ └── yuidoc.json │ │ │ └── package.json │ │ └── package.json │ ├── folders4 │ │ └── one │ │ │ ├── yuidoc.json │ │ │ └── two │ │ │ ├── yuidoc.json │ │ │ └── package.json │ ├── folders5 │ │ ├── two │ │ │ ├── yuidoc.json │ │ │ └── package.json │ │ └── one │ │ │ └── three │ │ │ └── yuidoc.json │ ├── globbing │ │ ├── shallow │ │ │ └── yui │ │ │ │ └── src │ │ │ │ └── example │ │ │ │ └── example.js │ │ └── deep │ │ │ ├── deep │ │ │ └── sub │ │ │ │ └── yui │ │ │ │ └── src │ │ │ │ └── example │ │ │ │ └── example.js │ │ │ └── shallow │ │ │ └── yui │ │ │ └── src │ │ │ └── example │ │ │ └── example.js │ ├── folders2 │ │ ├── one │ │ │ └── two │ │ │ │ └── yuidoc.json │ │ └── package.json │ ├── namespace │ │ └── ns.js │ ├── coffee │ │ └── test.coffee │ ├── test2 │ │ ├── slashes.js │ │ ├── namespace.js │ │ └── dump │ │ │ └── dump.js │ ├── charts │ │ ├── Chart.js │ │ ├── RectGroup.js │ │ ├── DiamondGroup.js │ │ ├── EllipseGroup.js │ │ ├── StackedAreaSplineSeries.js │ │ ├── StackedLineSeries.js │ │ ├── StackedMarkerSeries.js │ │ ├── StackedSplineSeries.js │ │ ├── ComboSplineSeries.js │ │ ├── StackedAreaSeries.js │ │ ├── AreaSplineSeries.js │ │ ├── CircleGroup.js │ │ ├── StackedComboSplineSeries.js │ │ ├── StackingUtil.js │ │ ├── StackedComboSeries.js │ │ ├── AreaSeries.js │ │ ├── SplineSeries.js │ │ ├── StackedAxis.js │ │ ├── Renderer.js │ │ ├── LineSeries.js │ │ ├── CurveUtil.js │ │ ├── MarkerSeries.js │ │ ├── PieChartLegend.js │ │ ├── Gridlines.js │ │ └── ShapeGroup.js │ ├── test │ │ ├── anim.js │ │ └── test.js │ └── inherit │ │ └── examplemodule.js ├── lib │ └── davglass.js ├── parser_coffee.js └── utils.js ├── .travis.yml ├── output ├── assets │ ├── favicon.png │ └── vendor │ │ └── prettify │ │ ├── prettify-min.css │ │ └── prettify.css └── api │ ├── assets │ ├── css │ │ ├── logo.png │ │ └── external-small.png │ ├── favicon.png │ ├── img │ │ └── spinner.gif │ ├── index.html │ ├── js │ │ ├── yui-prettify.js │ │ ├── api-filter.js │ │ └── api-search.js │ └── vendor │ │ └── prettify │ │ └── prettify-min.css │ ├── classes │ ├── index.html │ ├── CLI.html │ └── Main.html │ ├── files │ ├── index.html │ └── lib_cli.js.html │ ├── modules │ └── index.html │ ├── api.js │ └── index.html ├── conf └── docs │ ├── assets │ ├── favicon.png │ └── vendor │ │ └── prettify │ │ ├── prettify-min.css │ │ └── prettify.css │ ├── project.json │ ├── index.mustache │ └── layouts │ └── main.mustache ├── .gitignore ├── themes ├── default │ ├── assets │ │ ├── css │ │ │ ├── logo.png │ │ │ └── external-small.png │ │ ├── favicon.png │ │ ├── img │ │ │ └── spinner.gif │ │ ├── index.html │ │ ├── js │ │ │ ├── yui-prettify.js │ │ │ ├── api-filter.js │ │ │ └── api-search.js │ │ └── vendor │ │ │ └── prettify │ │ │ └── prettify-min.css │ ├── theme.json │ ├── layouts │ │ ├── xhr.handlebars │ │ └── main.handlebars │ └── partials │ │ ├── files.handlebars │ │ ├── options.handlebars │ │ ├── index.handlebars │ │ ├── sidebar.handlebars │ │ ├── module.handlebars │ │ ├── props.handlebars │ │ ├── events.handlebars │ │ └── attrs.handlebars └── simple │ ├── assets │ ├── css │ │ ├── logo.png │ │ └── external-small.png │ ├── js │ │ ├── yui-prettify.js │ │ └── tabs.js │ └── vendor │ │ └── prettify │ │ └── prettify-min.css │ ├── partials │ ├── index.handlebars │ ├── files.handlebars │ ├── props.handlebars │ ├── module.handlebars │ ├── events.handlebars │ ├── attrs.handlebars │ ├── classes.handlebars │ ├── method.handlebars │ └── sidebar.handlebars │ ├── theme.json │ └── layouts │ └── main.handlebars ├── scripts ├── help.sh ├── test.sh ├── docs.sh ├── report.js ├── versions.js └── prep.sh ├── docs ├── themes │ ├── component.json │ └── index.mustache ├── args │ ├── component.json │ └── partials │ │ └── help.mustache └── syntax │ └── component.json ├── Makefile ├── DEVELOPMENT.md ├── LICENSE ├── lib ├── cli.js ├── docview.js ├── project.js ├── help.js ├── index.js └── options.js ├── README.md └── package.json /.npmignore: -------------------------------------------------------------------------------- 1 | .git 2 | sandbox 3 | -------------------------------------------------------------------------------- /tests/input/folders1/yuidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuidoc-root" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders3/yuidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuidoc-root" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders4/one/yuidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuidoc-one" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders5/two/yuidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuidoc-two" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/globbing/shallow/yui/src/example/example.js: -------------------------------------------------------------------------------- 1 | // Sample content 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | -------------------------------------------------------------------------------- /tests/input/folders1/one/two/yuidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuidoc-two" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders2/one/two/yuidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuidoc-two" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "package-root" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders3/one/two/yuidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuidoc-two" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "package-root" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders4/one/two/yuidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuidoc-two" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders5/one/three/yuidoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuidoc-three" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/globbing/deep/deep/sub/yui/src/example/example.js: -------------------------------------------------------------------------------- 1 | // Sample content 2 | -------------------------------------------------------------------------------- /tests/input/globbing/deep/shallow/yui/src/example/example.js: -------------------------------------------------------------------------------- 1 | // Sample content 2 | -------------------------------------------------------------------------------- /tests/input/folders3/one/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "package-one" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders4/one/two/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "package-two" 3 | } 4 | -------------------------------------------------------------------------------- /tests/input/folders5/two/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "package-two" 3 | } 4 | -------------------------------------------------------------------------------- /output/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/output/assets/favicon.png -------------------------------------------------------------------------------- /conf/docs/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/conf/docs/assets/favicon.png -------------------------------------------------------------------------------- /output/api/assets/css/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/output/api/assets/css/logo.png -------------------------------------------------------------------------------- /output/api/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/output/api/assets/favicon.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | out 3 | node_modules 4 | coverage 5 | ddc 6 | npm-debug.log 7 | tests/input/test-linked 8 | -------------------------------------------------------------------------------- /output/api/assets/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/output/api/assets/img/spinner.gif -------------------------------------------------------------------------------- /themes/default/assets/css/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/themes/default/assets/css/logo.png -------------------------------------------------------------------------------- /themes/default/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/themes/default/assets/favicon.png -------------------------------------------------------------------------------- /themes/simple/assets/css/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/themes/simple/assets/css/logo.png -------------------------------------------------------------------------------- /themes/default/assets/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/themes/default/assets/img/spinner.gif -------------------------------------------------------------------------------- /output/api/assets/css/external-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/output/api/assets/css/external-small.png -------------------------------------------------------------------------------- /scripts/help.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname "$0")" 4 | 5 | ../lib/cli.js --help 2> ../docs/args/partials/help.mustache 6 | -------------------------------------------------------------------------------- /themes/default/assets/css/external-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/themes/default/assets/css/external-small.png -------------------------------------------------------------------------------- /themes/simple/assets/css/external-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apm/yuidoc/master/themes/simple/assets/css/external-small.png -------------------------------------------------------------------------------- /themes/simple/partials/index.handlebars: -------------------------------------------------------------------------------- 1 |

API Docs - Main Index

2 |

Something smart and pretty should probably go here.

3 | -------------------------------------------------------------------------------- /tests/lib/davglass.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | davglass: function(str) { 3 | return 'DAVGLASS_WAS_HERE::' + str; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /themes/simple/partials/files.handlebars: -------------------------------------------------------------------------------- 1 |

{{fileName}}

2 | 3 |
4 | {{fileData}}
5 | 
6 | 7 | -------------------------------------------------------------------------------- /conf/docs/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "YUIDoc - Javascript Documentation Tool", 3 | "version": "0.3.45", 4 | "yuiSeedUrl": "http://yui.yahooapis.com/3.5.1/build/yui/yui.js" 5 | } -------------------------------------------------------------------------------- /themes/default/theme.json: -------------------------------------------------------------------------------- 1 | { 2 | "yuiGridsUrl": "http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css", 3 | "yuiSeedUrl": "http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js" 4 | } 5 | -------------------------------------------------------------------------------- /themes/default/layouts/xhr.handlebars: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{>layout_content}} 4 |
5 |
6 | 7 | 8 | -------------------------------------------------------------------------------- /themes/default/partials/files.handlebars: -------------------------------------------------------------------------------- 1 |

File: {{fileName}}

2 | 3 |
4 |
5 | {{fileData}}
6 |     
7 |
8 | -------------------------------------------------------------------------------- /themes/simple/theme.json: -------------------------------------------------------------------------------- 1 | { 2 | "yuiGridsUrl": "http://yui.yahooapis.com/3.8.0pr2/build/cssgrids/cssgrids-min.css", 3 | "yuiSeedUrl": "http://yui.yahooapis.com/combo?3.8.0pr2/build/yui/yui-min.js" 4 | } 5 | -------------------------------------------------------------------------------- /tests/input/namespace/ns.js: -------------------------------------------------------------------------------- 1 | /** 2 | Test Class 3 | @class Bar 4 | @namespace Foo 5 | @module foobar 6 | @main foobar 7 | */ 8 | 9 | /** 10 | Test Method 11 | @method Baz 12 | @namespace Foo.Bar 13 | */ 14 | -------------------------------------------------------------------------------- /docs/themes/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "themes", 3 | "displayName": "YUIDoc Themes", 4 | "description": "How to modify the default YUIDoc theme.", 5 | "author" : "davglass", 6 | "projectBase": "../" 7 | } 8 | -------------------------------------------------------------------------------- /docs/args/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "args", 3 | "displayName": "Using YUIDoc", 4 | "description": "Understanding YUIDoc command line arguments and usage.", 5 | "author" : "davglass", 6 | "projectBase": "../" 7 | } 8 | -------------------------------------------------------------------------------- /docs/syntax/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "syntax", 3 | "displayName": "YUIDoc Syntax Reference", 4 | "description": "Detailed instructions for writing YUIDoc comment blocks.", 5 | "author" : "davglass", 6 | "projectBase": "../" 7 | } 8 | -------------------------------------------------------------------------------- /tests/input/coffee/test.coffee: -------------------------------------------------------------------------------- 1 | 2 | ###* 3 | # The test project 4 | # @project tester 5 | # @title The Tester 6 | # @icon http://a.img 7 | # @url http://one.url 8 | # @url http://two.url 9 | # @author admo 10 | # @contributor davglass 11 | # @contributor entropy 12 | ### 13 | -------------------------------------------------------------------------------- /output/api/assets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Redirector 5 | 6 | 7 | 8 | Click here to redirect 9 | 10 | 11 | -------------------------------------------------------------------------------- /output/api/classes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Redirector 5 | 6 | 7 | 8 | Click here to redirect 9 | 10 | 11 | -------------------------------------------------------------------------------- /output/api/files/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Redirector 5 | 6 | 7 | 8 | Click here to redirect 9 | 10 | 11 | -------------------------------------------------------------------------------- /output/api/modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Redirector 5 | 6 | 7 | 8 | Click here to redirect 9 | 10 | 11 | -------------------------------------------------------------------------------- /themes/default/assets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Redirector 5 | 6 | 7 | 8 | Click here to redirect 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/input/test2/slashes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a module with slashes in the name 3 | * @module myapp/views/index 4 | */ 5 | 6 | /** 7 | * This is the main class 8 | * @class Main 9 | * @constructor 10 | */ 11 | 12 | /** 13 | * Static Property 14 | * @property STATIC 15 | * @static 16 | */ 17 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | npm -g i . 3 | 4 | version: 5 | ./scripts/versions.js 6 | 7 | help: 8 | ./scripts/help.sh 9 | 10 | doc: 11 | ./node_modules/.bin/selleck --out ./output/ 12 | 13 | clean: 14 | rm -rRf ./output/* 15 | 16 | api: 17 | ./lib/cli.js 18 | 19 | docs: clean help doc api 20 | 21 | deploydocs: version 22 | ./scripts/docs.sh 23 | 24 | test: 25 | ./scripts/test.sh 26 | 27 | .PHONY: docs clean 28 | -------------------------------------------------------------------------------- /tests/input/charts/Chart.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The Chart class is the basic application used to create a chart. 3 | * 4 | * @module charts 5 | * @class Chart 6 | * @constructor 7 | */ 8 | function Chart(cfg) 9 | { 10 | if(cfg.type != "pie") 11 | { 12 | return new Y.CartesianChart(cfg); 13 | } 14 | else 15 | { 16 | return new Y.PieChart(cfg); 17 | } 18 | } 19 | Y.Chart = Chart; 20 | -------------------------------------------------------------------------------- /scripts/test.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | cd "$(dirname "$0")" 4 | 5 | ./prep.sh 6 | cd ../tests/ 7 | wait 8 | cd ./input 9 | if [ -L ./test-linked ]; then 10 | rm ./test-linked; 11 | fi 12 | ln -sf ./test2 ./test-linked 13 | wait 14 | cd ../ 15 | wait 16 | ../node_modules/.bin/yuitest \ 17 | ./parser.js \ 18 | ./parser_coffee.js \ 19 | ./builder.js \ 20 | ./options.js \ 21 | ./utils.js \ 22 | ./files.js 23 | 24 | exit $? 25 | 26 | -------------------------------------------------------------------------------- /scripts/docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname "$0")" 4 | 5 | out=../../yuidoc-pages 6 | 7 | cd $out 8 | 9 | out=`pwd` 10 | 11 | cd - 12 | 13 | if [ ! -d $out ]; then 14 | 15 | echo "Could not find $out" 16 | exit; 17 | fi 18 | 19 | echo "Deploying Doc Files to Github Pages" 20 | 21 | cd ../ 22 | wait 23 | make docs 24 | wait 25 | rm -rRf $out/* 26 | wait 27 | cp -R output/* $out/ 28 | wait 29 | echo "Doc Deploy Complete, checkin and push now." 30 | -------------------------------------------------------------------------------- /themes/simple/partials/props.handlebars: -------------------------------------------------------------------------------- 1 | 2 |
3 | `{{name}}` <{{#crossLink type}}{{/crossLink}}>{{#if final}} (final){{/if}}{{#if static}} (static){{/if}}
4 | `{{file}}:{{line}}` 5 | {{{propertyDescription}}} 6 | {{#if example}} 7 |
Example
8 | {{{example}}} 9 | {{/if}} 10 |
11 | -------------------------------------------------------------------------------- /scripts/report.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var istanbul = require('istanbul'); 4 | var fs = require('fs'); 5 | var path = require('path'); 6 | var json = JSON.parse(fs.readFileSync(path.join(__dirname, '../coverage/test-coverage.json'))); 7 | 8 | var collect = new istanbul.Collector(), 9 | report = istanbul.Report.create('text'), 10 | summary = istanbul.Report.create('text-summary'); 11 | 12 | collect.add(json); 13 | 14 | report.writeReport(collect); 15 | summary.writeReport(collect); 16 | -------------------------------------------------------------------------------- /scripts/versions.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var path = require('path'), 4 | fs = require('fs'), 5 | package = require(path.join(__dirname, '../', 'package.json')), 6 | version = package.version, 7 | doc = path.join(__dirname, '../', 'conf', 'docs', 'project.json'); 8 | 9 | console.log('[version]', version); 10 | console.log('[doc]', doc); 11 | 12 | var docJSON = require(doc); 13 | 14 | docJSON.version = version; 15 | 16 | fs.writeFileSync(doc, JSON.stringify(docJSON, null, 2)); 17 | console.log('[done]'); 18 | -------------------------------------------------------------------------------- /scripts/prep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname "$0")" 4 | 5 | if [ ! -d ../node_modules ]; then 6 | echo "Dependencies are not installed, installing" 7 | cd ../ && npm install --loglevel silent && cd ./scripts 8 | fi 9 | 10 | if [ ! -x ../node_modules/.bin/yuitest ]; then 11 | echo "YUITest is not installed, installing" 12 | cd ../ && npm install --loglevel silent && cd ./scripts 13 | fi 14 | 15 | if [ -d ../tests/out ]; then 16 | echo "Prior out directory found, removing." 17 | rm -rRf ../tests/out/ 18 | fi 19 | -------------------------------------------------------------------------------- /tests/input/test2/namespace.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @module P.storage 3 | */ 4 | 5 | /** 6 | * @class Store 7 | * @constructor 8 | * @namespace P.storage 9 | */ 10 | // definition of Store and Store.prototype 11 | 12 | /** 13 | * @class LocalStore 14 | * @constructor 15 | * @extends P.storage.Store 16 | * @namespace P.storage 17 | */ 18 | // definition of LocalStore and LocalStore.prototype 19 | 20 | /** 21 | * @class storage 22 | * @namespace P 23 | */ 24 | 25 | /** 26 | * @private 27 | * @property {Array} _storageMechanisms 28 | * @static 29 | */ 30 | -------------------------------------------------------------------------------- /tests/input/test/anim.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is the Anim MODULE description 3 | * @main anim 4 | * @module anim 5 | */ 6 | 7 | /** 8 | * This is the Anim Class description 9 | * @class Anim 10 | */ 11 | 12 | /** 13 | * The easing module provides methods for customizing 14 | * how an animation behaves during each run. 15 | * @class Easing 16 | * @submodule anim-easing 17 | */ 18 | 19 | 20 | /** 21 | * FOO FOO FOO FOO FOO The easing module provides methods for customizing 22 | * @class EasingFoo 23 | * @submodule anim-easing-foo 24 | */ 25 | 26 | 27 | -------------------------------------------------------------------------------- /output/api/assets/js/yui-prettify.js: -------------------------------------------------------------------------------- 1 | YUI().use('node', function(Y) { 2 | var code = Y.all('.prettyprint.linenums'); 3 | if (code.size()) { 4 | code.each(function(c) { 5 | var lis = c.all('ol li'), 6 | l = 1; 7 | lis.each(function(n) { 8 | n.prepend(''); 9 | l++; 10 | }); 11 | }); 12 | var h = location.hash; 13 | location.hash = ''; 14 | h = h.replace('LINE_', 'LINENUM_'); 15 | location.hash = h; 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /themes/default/assets/js/yui-prettify.js: -------------------------------------------------------------------------------- 1 | YUI().use('node', function(Y) { 2 | var code = Y.all('.prettyprint.linenums'); 3 | if (code.size()) { 4 | code.each(function(c) { 5 | var lis = c.all('ol li'), 6 | l = 1; 7 | lis.each(function(n) { 8 | n.prepend(''); 9 | l++; 10 | }); 11 | }); 12 | var h = location.hash; 13 | location.hash = ''; 14 | h = h.replace('LINE_', 'LINENUM_'); 15 | location.hash = h; 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /themes/simple/assets/js/yui-prettify.js: -------------------------------------------------------------------------------- 1 | YUI().use('node', function(Y) { 2 | var code = Y.all('.prettyprint.linenums'); 3 | if (code.size()) { 4 | code.each(function(c) { 5 | var lis = c.all('ol li'), 6 | l = 1; 7 | lis.each(function(n) { 8 | n.prepend(''); 9 | l++; 10 | }); 11 | }); 12 | var h = location.hash; 13 | location.hash = ''; 14 | h = h.replace('LINE_', 'LINENUM_'); 15 | location.hash = h; 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /output/assets/vendor/prettify/prettify-min.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /conf/docs/assets/vendor/prettify/prettify-min.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /output/api/assets/vendor/prettify/prettify-min.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /themes/simple/assets/vendor/prettify/prettify-min.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /themes/default/assets/vendor/prettify/prettify-min.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /tests/input/charts/RectGroup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Abstract class for creating groups of rects with the same styles and dimensions. 3 | * 4 | * @module graphics 5 | * @class GroupRect 6 | * @constructor 7 | */ 8 | RectGroup = function(cfg) 9 | { 10 | RectGroup.superclass.constructor.apply(this, arguments); 11 | }; 12 | 13 | RectGroup.NAME = "rectGroup"; 14 | 15 | Y.extend(RectGroup, Y.ShapeGroup, { 16 | /** 17 | * Updates the rect. 18 | * 19 | * @method _draw 20 | * @private 21 | */ 22 | drawShape: function(cfg) 23 | { 24 | this.drawRect(cfg.x, cfg.y, cfg.width, cfg.height); 25 | } 26 | }); 27 | 28 | RectGroup.ATTRS = Y.ShapeGroup.ATTRS; 29 | Y.RectGroup = RectGroup; 30 | -------------------------------------------------------------------------------- /themes/default/partials/options.handlebars: -------------------------------------------------------------------------------- 1 |
2 | Show: 3 | 7 | 8 | 12 | 13 | 17 | 21 | 22 |
23 | 24 | -------------------------------------------------------------------------------- /tests/input/charts/DiamondGroup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Abstract class for creating groups of diamonds with the same styles and dimensions. 3 | * 4 | * @module graphics 5 | * @class GroupDiamond 6 | * @constructor 7 | */ 8 | DiamondGroup = function(cfg) 9 | { 10 | DiamondGroup.superclass.constructor.apply(this, arguments); 11 | }; 12 | 13 | DiamondGroup.NAME = "diamondGroup"; 14 | 15 | Y.extend(DiamondGroup, Y.ShapeGroup, { 16 | /** 17 | * Updates the diamond. 18 | * 19 | * @method _draw 20 | * @private 21 | */ 22 | drawShape: function(cfg) 23 | { 24 | this.drawDiamond(cfg.x, cfg.y, cfg.width, cfg.height); 25 | } 26 | }); 27 | 28 | DiamondGroup.ATTRS = Y.ShapeGroup.ATTRS; 29 | Y.DiamondGroup = DiamondGroup; 30 | -------------------------------------------------------------------------------- /tests/input/charts/EllipseGroup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Abstract class for creating groups of diamonds with the same styles and dimensions. 3 | * 4 | * @module graphics 5 | * @class EllipseGroup 6 | * @constructor 7 | */ 8 | EllipseGroup = function(cfg) 9 | { 10 | EllipseGroup.superclass.constructor.apply(this, arguments); 11 | }; 12 | 13 | EllipseGroup.NAME = "diamondGroup"; 14 | 15 | Y.extend(EllipseGroup, Y.ShapeGroup, { 16 | /** 17 | * Updates the diamond. 18 | * 19 | * @method _draw 20 | * @private 21 | */ 22 | drawShape: function(cfg) 23 | { 24 | this.drawEllipse(cfg.x, cfg.y, cfg.width, cfg.height); 25 | } 26 | }); 27 | 28 | EllipseGroup.ATTRS = Y.ShapeGroup.ATTRS; 29 | Y.EllipseGroup = EllipseGroup; 30 | -------------------------------------------------------------------------------- /output/api/api.js: -------------------------------------------------------------------------------- 1 | YUI.add("yuidoc-meta", function(Y) { 2 | Y.YUIDoc = { meta: { 3 | "classes": [ 4 | "CLI", 5 | "DocBuilder", 6 | "DocParser", 7 | "DocView", 8 | "Files", 9 | "Help", 10 | "Main", 11 | "Options", 12 | "Server", 13 | "Utils", 14 | "YUIDoc" 15 | ], 16 | "modules": [ 17 | "yuidoc" 18 | ], 19 | "allModules": [ 20 | { 21 | "displayName": "yuidoc", 22 | "name": "yuidoc", 23 | "description": "This is the __module__ description for the `YUIDoc` module.\n\n var options = {\n paths: [ './lib' ],\n outdir: './out'\n };\n\n var Y = require('yuidocjs');\n var json = (new Y.YUIDoc(options)).run();" 24 | } 25 | ] 26 | } }; 27 | }); -------------------------------------------------------------------------------- /themes/default/partials/index.handlebars: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | Browse to a module or class using the sidebar to view its API documentation. 5 |

6 | 7 |

Keyboard Shortcuts

8 | 9 | 18 |
19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /themes/simple/partials/module.handlebars: -------------------------------------------------------------------------------- 1 | 2 |

{{moduleName}}

3 |
{{{moduleDescription}}}
4 | 5 |
6 |
7 | {{#if moduleClasses}} 8 |

This module has the following classes:

9 | 14 | {{/if}} 15 |
16 |
17 | {{#if subModules}} 18 |

This module has the following submodules:

19 | 24 | {{/if}} 25 |
26 |
27 |

28 | Module description found: `{{file}}:{{line}}` 29 | -------------------------------------------------------------------------------- /themes/default/partials/sidebar.handlebars: -------------------------------------------------------------------------------- 1 |
2 |

APIs

3 |
4 | 8 | 9 |
10 | 11 |
12 | 13 |
14 | 19 | 20 | 25 |
26 |
27 |
28 | -------------------------------------------------------------------------------- /tests/input/charts/StackedAreaSplineSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * StackedAreaSplineSeries creates a stacked area chart with points data points connected by a curve. 3 | * 4 | * @module charts 5 | * @class StackedAreaSplineSeries 6 | * @constructor 7 | * @extends AreaSeries 8 | * @uses CurveUtil 9 | * @uses StackingUtil 10 | */ 11 | Y.StackedAreaSplineSeries = Y.Base.create("stackedAreaSplineSeries", Y.AreaSeries, [Y.CurveUtil, Y.StackingUtil], { 12 | /** 13 | * @protected 14 | * 15 | * Draws the series. 16 | * 17 | * @method drawSeries 18 | */ 19 | drawSeries: function() 20 | { 21 | this._stackCoordinates(); 22 | this.drawStackedAreaSpline(); 23 | } 24 | }, { 25 | ATTRS : { 26 | /** 27 | * Read-only attribute indicating the type of series. 28 | * 29 | * @attribute type 30 | * @type String 31 | * @default stackedAreaSpline 32 | */ 33 | type: { 34 | value:"stackedAreaSpline" 35 | } 36 | } 37 | }); 38 | 39 | -------------------------------------------------------------------------------- /DEVELOPMENT.md: -------------------------------------------------------------------------------- 1 | YUIDoc Development 2 | ================== 3 | 4 | If you want to work on the default theme or need to work on the parser/builder, here's the steps: 5 | 6 | * git clone git://github.com/yui/yuidoc.git (or your fork) 7 | * cd yuidoc 8 | * sudo npm link 9 | 10 | This will link `yuidoc` into the global `/usr/local/lib/node_modules` folder. 11 | This basically installs it globally as a link to this source directory. 12 | 13 | Now all changes you make to the current source tree are available in the global `yuidoc` executable. 14 | No need to reinstall the app to test your changes. 15 | 16 | How to Run Unit Tests 17 | --------------------- 18 | git clone https://github.com/yui/yuidoc.git 19 | cd yuidoc 20 | ./scripts/test.sh 21 | 22 | Server Mode 23 | ----------- 24 | 25 | For performance, the handlbars templates are cached from the first request. So you will have to 26 | terminate the server and relaunch it before you can see your changes. 27 | 28 | Assets should not be cached, so they should still serve new files on each request. This way you can 29 | modify the JS/CSS files on the fly. 30 | -------------------------------------------------------------------------------- /tests/input/charts/StackedLineSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * StackedLineSeries creates line graphs in which the different series are stacked along a value axis 3 | * to indicate their contribution to a cumulative total. 4 | * 5 | * @module charts 6 | * @class StackedLineSeries 7 | * @constructor 8 | * @extends LineSeries 9 | * @uses StackingUtil 10 | */ 11 | Y.StackedLineSeries = Y.Base.create("stackedLineSeries", Y.LineSeries, [Y.StackingUtil], { 12 | /** 13 | * @protected 14 | * 15 | * Calculates the coordinates for the series. Overrides base implementation. 16 | * 17 | * @method setAreaData 18 | */ 19 | setAreaData: function() 20 | { 21 | Y.StackedLineSeries.superclass.setAreaData.apply(this); 22 | this._stackCoordinates.apply(this); 23 | } 24 | }, { 25 | ATTRS: { 26 | /** 27 | * Read-only attribute indicating the type of series. 28 | * 29 | * @attribute type 30 | * @type String 31 | * @default stackedLine 32 | */ 33 | type: { 34 | value:"stackedLine" 35 | } 36 | } 37 | }); 38 | -------------------------------------------------------------------------------- /tests/input/charts/StackedMarkerSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * StackedMarkerSeries plots markers with different series stacked along the value axis to indicate each 3 | * series' contribution to a cumulative total. 4 | * 5 | * @module charts 6 | * @class StackedMarkerSeries 7 | * @constructor 8 | * @extends MarkerSeries 9 | * @extends StackingUtil 10 | */ 11 | Y.StackedMarkerSeries = Y.Base.create("stackedMarkerSeries", Y.MarkerSeries, [Y.StackingUtil], { 12 | /** 13 | * @protected 14 | * 15 | * Calculates the coordinates for the series. Overrides base implementation. 16 | * 17 | * @method setAreaData 18 | */ 19 | setAreaData: function() 20 | { 21 | Y.StackedMarkerSeries.superclass.setAreaData.apply(this); 22 | this._stackCoordinates.apply(this); 23 | } 24 | }, { 25 | ATTRS: { 26 | /** 27 | * Read-only attribute indicating the type of series. 28 | * 29 | * @attribute type 30 | * @type String 31 | * @default stackedMarker 32 | */ 33 | type: { 34 | value:"stackedMarker" 35 | } 36 | } 37 | }); 38 | 39 | -------------------------------------------------------------------------------- /tests/input/charts/StackedSplineSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * StackedSplineSeries creates spline graphs in which the different series are stacked along a value axis 3 | * to indicate their contribution to a cumulative total. 4 | * 5 | * @module charts 6 | * @class StackedSplineSeries 7 | * @constructor 8 | * @extends SplineSeries 9 | * @extends StackingUtil 10 | */ 11 | Y.StackedSplineSeries = Y.Base.create("stackedSplineSeries", Y.SplineSeries, [Y.StackingUtil], { 12 | /** 13 | * @protected 14 | * 15 | * Calculates the coordinates for the series. Overrides base implementation. 16 | * 17 | * @method setAreaData 18 | */ 19 | setAreaData: function() 20 | { 21 | Y.StackedSplineSeries.superclass.setAreaData.apply(this); 22 | this._stackCoordinates.apply(this); 23 | } 24 | }, { 25 | ATTRS: { 26 | /** 27 | * Read-only attribute indicating the type of series. 28 | * 29 | * @attribute type 30 | * @type String 31 | * @default stackedSpline 32 | */ 33 | type: { 34 | value:"stackedSpline" 35 | } 36 | } 37 | }); 38 | 39 | -------------------------------------------------------------------------------- /tests/input/charts/ComboSplineSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The ComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Each 3 | * series type has a corresponding boolean attribute indicating if it is rendered. By default, splines and plots 4 | * are rendered and areaspline is not. 5 | * 6 | * @module charts 7 | * @class ComboSplineSeries 8 | * @extends ComboSeries 9 | * @extends CurveUtil 10 | * @constructor 11 | */ 12 | Y.ComboSplineSeries = Y.Base.create("comboSplineSeries", Y.ComboSeries, [Y.CurveUtil], { 13 | /** 14 | * @protected 15 | * 16 | * Draws the series. 17 | * 18 | * @method drawSeries 19 | */ 20 | drawSeries: function() 21 | { 22 | if(this.get("showAreaFill")) 23 | { 24 | this.drawAreaSpline(); 25 | } 26 | if(this.get("showLines")) 27 | { 28 | this.drawSpline(); 29 | } 30 | if(this.get("showMarkers")) 31 | { 32 | this.drawPlots(); 33 | } 34 | } 35 | }, { 36 | ATTRS: { 37 | /** 38 | * Read-only attribute indicating the type of series. 39 | * 40 | * @attribute type 41 | * @type String 42 | * @default comboSpline 43 | */ 44 | type: { 45 | value : "comboSpline" 46 | } 47 | } 48 | }); 49 | -------------------------------------------------------------------------------- /tests/input/charts/StackedAreaSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * StackedAreaSeries area fills to display data showing its contribution to a whole. 3 | * 4 | * @module charts 5 | * @class StackedAreaSeries 6 | * @constructor 7 | * @param {Object} config (optional) Configuration parameters for the Chart. 8 | * @extends AreaSeries 9 | * @uses StackingUtil 10 | */ 11 | Y.StackedAreaSeries = Y.Base.create("stackedAreaSeries", Y.AreaSeries, [Y.StackingUtil], { 12 | /** 13 | * @protected 14 | * 15 | * Calculates the coordinates for the series. Overrides base implementation. 16 | * 17 | * @method setAreaData 18 | */ 19 | setAreaData: function() 20 | { 21 | Y.StackedAreaSeries.superclass.setAreaData.apply(this); 22 | this._stackCoordinates.apply(this); 23 | }, 24 | 25 | /** 26 | * @protected 27 | * 28 | * Draws the series 29 | * 30 | * @method drawSeries 31 | */ 32 | drawSeries: function() 33 | { 34 | this.drawFill.apply(this, this._getStackedClosingPoints()); 35 | } 36 | }, { 37 | ATTRS: { 38 | /** 39 | * Read-only attribute indicating the type of series. 40 | * 41 | * @attribute type 42 | * @type String 43 | * @default stackedArea 44 | */ 45 | type: { 46 | value:"stackedArea" 47 | } 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /themes/simple/layouts/main.handlebars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{htmlTitle}} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |

{{title}}

17 |
18 |
19 | API Docs for: {{projectVersion}} 20 |
21 |
22 |
23 | 24 | 27 | 28 |
29 |
{{>layout_content}}
30 |
31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /themes/simple/partials/events.handlebars: -------------------------------------------------------------------------------- 1 | 2 |
3 | `{{name}}` {{#if type}}<{{#crossLink type}}{{/crossLink}}>{{/if}} 4 | {{#if extended_from}}`/* Extended from {{extended_from}} */`{{/if}} 5 | {{#if overwritten_from}}`/* Overwritten from {{name}} */`{{/if}} 6 |
7 | `{{file}}:{{line}}` 8 | {{{eventDescription}}} 9 | {{#if params}} 10 | Extra event object properties: 11 | 33 | {{/if}} 34 |
35 | 36 | -------------------------------------------------------------------------------- /themes/simple/assets/js/tabs.js: -------------------------------------------------------------------------------- 1 | YUI({ 2 | insertBefore: 'site_styles' 3 | }).use('tabview', function(Y) { 4 | var classdocs = Y.one('#classdocs'), 5 | tabviewIndexTable = {}; 6 | if (classdocs) { 7 | if (classdocs.all('li').size()) { 8 | var tabview = new Y.TabView({ srcNode: classdocs }); 9 | tabview.render(); 10 | classdocs.all('li a').each(function (item, index) { 11 | var hash = item.get(['hash']); 12 | type = hash.substring(1); 13 | if (!tabviewIndexTable[type]) { 14 | tabviewIndexTable[type] = index; 15 | } 16 | }) 17 | Y.all('.sidebox.on-page').each(function (item, index) { 18 | var children = item.all('li a'); 19 | children.each(function (cItem, cIndex) { 20 | return function () { 21 | var handleClick = function (e) { 22 | var node = Y.one(this), 23 | hash = node.get(['hash']), 24 | hashValue = hash.substring(1).split('_'), 25 | type = hashValue.shift(), 26 | ogKey = hashValue.join('_'); // in case the hash had other underscores 27 | if (tabviewIndexTable[type] > -1 && tabviewIndexTable[type] !== currentTab) { 28 | currentTab = tabviewIndexTable[type]; 29 | tabview.selectChild(tabviewIndexTable[type]); 30 | } 31 | } 32 | Y.on('click', handleClick, cItem) 33 | }() 34 | }) 35 | }); 36 | } 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /themes/simple/partials/attrs.handlebars: -------------------------------------------------------------------------------- 1 | 2 |
3 | `{{name}}` {{#if type}}<{{#crossLink type}}{{/crossLink}}>{{/if}} 4 | {{#if extended_from}}`/* Extended from {{extended_from}} */`{{/if}} 5 | {{#if overwritten_from}}`/* Overwritten from {{name}} */`{{/if}} 6 |
7 | `{{file}}:{{line}}` 8 | {{{attrDescription}}} 9 | {{#if emit}} 10 |
11 | Fires: `{{name}}Change(e)` 12 |

Fires when the value for the configuration attribute `{{name}}` is changed. You can listen for the event using the `on` method if you wish to be notified before the attribute's value has changed, or using the `after` method if you wish to be notified after the attribute's value has changed.

13 | Parameters:
14 | `e` <EventFacade> An Event Facade object with the following attribute specific properties added: 15 | 21 |
22 | {{/if}} 23 |
24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011 Yahoo! Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the Yahoo! Inc. nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | 26 | -------------------------------------------------------------------------------- /lib/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Copyright (c) 2011, Yahoo! Inc. All rights reserved. 5 | Code licensed under the BSD License: 6 | http://yuilibrary.com/license/ 7 | */ 8 | 9 | /** 10 | * Parses the arguments, creates the options and passes them to `Y.YUIDoc` and then `Y.DocBuilder`. 11 | * @class CLI 12 | * @module yuidoc 13 | */ 14 | 15 | /*global Y:true */ 16 | var Y = require('./index'); 17 | 18 | var options = Y.Options(Y.Array(process.argv, 2)); 19 | 20 | Y.log('Starting YUIDoc@' + Y.packageInfo.version + ' using YUI@' + Y.version + ' with NodeJS@' + process.versions.node, 'info', 'yuidoc'); 21 | 22 | var starttime = (new Date()).getTime(); 23 | 24 | options = Y.Project.init(options); 25 | 26 | Y.log('Starting YUIDoc with the following options:', 'info', 'yuidoc'); 27 | var opts = Y.clone(options); 28 | if (opts.paths && opts.paths.length && (opts.paths.length > 10)) { 29 | opts.paths = [].concat(opts.paths.slice(0, 5), [''], options.paths.slice(-5)); 30 | } 31 | Y.log(opts, 'info', 'yuidoc'); 32 | 33 | if (options.server) { 34 | Y.Server.start(options); 35 | } else { 36 | var json = (new Y.YUIDoc(options)).run(); 37 | if (json === null) { 38 | return; 39 | } 40 | options = Y.Project.mix(json, options); 41 | 42 | if (!options.parseOnly) { 43 | var builder = new Y.DocBuilder(options, json); 44 | builder.compile(function () { 45 | var endtime = (new Date()).getTime(); 46 | Y.log('Completed in ' + ((endtime - starttime) / 1000) + ' seconds', 'info', 'yuidoc'); 47 | }); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /output/api/assets/js/api-filter.js: -------------------------------------------------------------------------------- 1 | YUI.add('api-filter', function (Y) { 2 | 3 | Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], { 4 | // -- Initializer ---------------------------------------------------------- 5 | initializer: function () { 6 | this._bindUIACBase(); 7 | this._syncUIACBase(); 8 | }, 9 | getDisplayName: function(name) { 10 | 11 | Y.each(Y.YUIDoc.meta.allModules, function(i) { 12 | if (i.name === name && i.displayName) { 13 | name = i.displayName; 14 | } 15 | }); 16 | 17 | return name; 18 | } 19 | 20 | }, { 21 | // -- Attributes ----------------------------------------------------------- 22 | ATTRS: { 23 | resultHighlighter: { 24 | value: 'phraseMatch' 25 | }, 26 | 27 | // May be set to "classes" or "modules". 28 | queryType: { 29 | value: 'classes' 30 | }, 31 | 32 | source: { 33 | valueFn: function() { 34 | var self = this; 35 | return function(q) { 36 | var data = Y.YUIDoc.meta[self.get('queryType')], 37 | out = []; 38 | Y.each(data, function(v) { 39 | if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) { 40 | out.push(v); 41 | } 42 | }); 43 | return out; 44 | }; 45 | } 46 | } 47 | } 48 | }); 49 | 50 | }, '3.4.0', {requires: [ 51 | 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources' 52 | ]}); 53 | -------------------------------------------------------------------------------- /themes/default/assets/js/api-filter.js: -------------------------------------------------------------------------------- 1 | YUI.add('api-filter', function (Y) { 2 | 3 | Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], { 4 | // -- Initializer ---------------------------------------------------------- 5 | initializer: function () { 6 | this._bindUIACBase(); 7 | this._syncUIACBase(); 8 | }, 9 | getDisplayName: function(name) { 10 | 11 | Y.each(Y.YUIDoc.meta.allModules, function(i) { 12 | if (i.name === name && i.displayName) { 13 | name = i.displayName; 14 | } 15 | }); 16 | 17 | return name; 18 | } 19 | 20 | }, { 21 | // -- Attributes ----------------------------------------------------------- 22 | ATTRS: { 23 | resultHighlighter: { 24 | value: 'phraseMatch' 25 | }, 26 | 27 | // May be set to "classes" or "modules". 28 | queryType: { 29 | value: 'classes' 30 | }, 31 | 32 | source: { 33 | valueFn: function() { 34 | var self = this; 35 | return function(q) { 36 | var data = Y.YUIDoc.meta[self.get('queryType')], 37 | out = []; 38 | Y.each(data, function(v) { 39 | if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) { 40 | out.push(v); 41 | } 42 | }); 43 | return out; 44 | }; 45 | } 46 | } 47 | } 48 | }); 49 | 50 | }, '3.4.0', {requires: [ 51 | 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources' 52 | ]}); 53 | -------------------------------------------------------------------------------- /tests/input/charts/AreaSplineSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * AreaSplineSeries renders an area graph with data points connected by a curve. 3 | * 4 | * @module charts 5 | * @class AreaSplineSeries 6 | * @constructor 7 | * @extends CartesianSeries 8 | * @uses Fills 9 | * @uses CurveUtil 10 | */ 11 | Y.AreaSplineSeries = Y.Base.create("areaSplineSeries", Y.CartesianSeries, [Y.Fills, Y.CurveUtil], { 12 | /** 13 | * @protected 14 | * 15 | * Draws the series. 16 | * 17 | * @method drawSeries 18 | */ 19 | drawSeries: function() 20 | { 21 | this.drawAreaSpline(); 22 | } 23 | }, { 24 | ATTRS : { 25 | /** 26 | * Read-only attribute indicating the type of series. 27 | * 28 | * @attribute type 29 | * @type String 30 | * @default areaSpline 31 | */ 32 | type: { 33 | value:"areaSpline" 34 | } 35 | 36 | /** 37 | * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values: 38 | * 39 | *
40 | *
color
The color of the fill. The default value is determined by the order of the series on the graph. The color will be 41 | * retrieved from the following array: 42 | * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]` 43 | *
44 | *
alpha
Number between 0 and 1 that indicates the opacity of the fill. The default value is 1
45 | *
46 | * 47 | * @attribute styles 48 | * @type Object 49 | */ 50 | } 51 | }); 52 | 53 | -------------------------------------------------------------------------------- /tests/input/charts/CircleGroup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Abstract class for creating groups of circles with the same styles and dimensions. 3 | * 4 | * @module graphics 5 | * @class GroupCircle 6 | * @constructor 7 | */ 8 | CircleGroup = function(cfg) 9 | { 10 | CircleGroup.superclass.constructor.apply(this, arguments); 11 | }; 12 | 13 | CircleGroup.NAME = "circleGroup"; 14 | 15 | Y.extend(CircleGroup, Y.ShapeGroup, { 16 | /** 17 | * Algorithm for drawing shape. 18 | * 19 | * @method drawShape 20 | * @param {Object} cfg Parameters used to draw the shape. 21 | */ 22 | drawShape: function(cfg) 23 | { 24 | this.drawCircle(cfg.x, cfg.y, cfg.radius); 25 | } 26 | }); 27 | 28 | CircleGroup.ATTRS = Y.merge(Y.ShapeGroup.ATTRS, { 29 | dimensions: { 30 | getter: function() 31 | { 32 | var dimensions = this._dimensions, 33 | radius, 34 | yRadius, 35 | width, 36 | height; 37 | if(dimensions.hasOwnProperty("radius")) 38 | { 39 | return dimensions; 40 | } 41 | else 42 | { 43 | width = dimensions.width; 44 | height = dimensions.height; 45 | radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5); 46 | yRadius = radius; 47 | return { 48 | width: width, 49 | height: height, 50 | radius: radius, 51 | yRadius: yRadius 52 | }; 53 | } 54 | } 55 | } 56 | }); 57 | 58 | CircleGroup.ATTRS = Y.ShapeGroup.ATTRS; 59 | Y.CircleGroup = CircleGroup; 60 | -------------------------------------------------------------------------------- /tests/input/charts/StackedComboSplineSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The StackedComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Series 3 | * are stacked along the value axis to indicate each series contribution to a cumulative total. Each 4 | * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are 5 | * rendered. 6 | * 7 | * @module charts 8 | * @class StackedComboSplineSeries 9 | * @extends StackedComboSeries 10 | * @uses CurveUtil 11 | * @constructor 12 | */ 13 | Y.StackedComboSplineSeries = Y.Base.create("stackedComboSplineSeries", Y.StackedComboSeries, [Y.CurveUtil], { 14 | /** 15 | * @protected 16 | * 17 | * Draws the series. 18 | * 19 | * @method drawSeries 20 | */ 21 | drawSeries: function() 22 | { 23 | if(this.get("showAreaFill")) 24 | { 25 | this.drawStackedAreaSpline(); 26 | } 27 | if(this.get("showLines")) 28 | { 29 | this.drawSpline(); 30 | } 31 | if(this.get("showMarkers")) 32 | { 33 | this.drawPlots(); 34 | } 35 | } 36 | }, { 37 | ATTRS: { 38 | /** 39 | * Read-only attribute indicating the type of series. 40 | * 41 | * @attribute type 42 | * @type String 43 | * @default stackedComboSpline 44 | */ 45 | type : { 46 | value : "stackedComboSpline" 47 | }, 48 | 49 | /** 50 | * Indicates whether a fill is displayed. 51 | * 52 | * @attribute showAreaFill 53 | * @type Boolean 54 | * @default true 55 | */ 56 | showAreaFill: { 57 | value: true 58 | } 59 | } 60 | }); 61 | -------------------------------------------------------------------------------- /output/assets/vendor/prettify/prettify.css: -------------------------------------------------------------------------------- 1 | /* Pretty printing styles. Used with prettify.js. */ 2 | 3 | /* SPAN elements with the classes below are added by prettyprint. */ 4 | .pln { color: #000 } /* plain text */ 5 | 6 | @media screen { 7 | .str { color: #080 } /* string content */ 8 | .kwd { color: #008 } /* a keyword */ 9 | .com { color: #800 } /* a comment */ 10 | .typ { color: #606 } /* a type name */ 11 | .lit { color: #066 } /* a literal value */ 12 | /* punctuation, lisp open bracket, lisp close bracket */ 13 | .pun, .opn, .clo { color: #660 } 14 | .tag { color: #008 } /* a markup tag name */ 15 | .atn { color: #606 } /* a markup attribute name */ 16 | .atv { color: #080 } /* a markup attribute value */ 17 | .dec, .var { color: #606 } /* a declaration; a variable name */ 18 | .fun { color: red } /* a function name */ 19 | } 20 | 21 | /* Use higher contrast and text-weight for printable form. */ 22 | @media print, projection { 23 | .str { color: #060 } 24 | .kwd { color: #006; font-weight: bold } 25 | .com { color: #600; font-style: italic } 26 | .typ { color: #404; font-weight: bold } 27 | .lit { color: #044 } 28 | .pun, .opn, .clo { color: #440 } 29 | .tag { color: #006; font-weight: bold } 30 | .atn { color: #404 } 31 | .atv { color: #060 } 32 | } 33 | 34 | /* Put a border around prettyprinted code snippets. */ 35 | pre.prettyprint { padding: 2px; border: 1px solid #888 } 36 | 37 | /* Specify class=linenums on a pre to get line numbering */ 38 | ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ 39 | li.L0, 40 | li.L1, 41 | li.L2, 42 | li.L3, 43 | li.L5, 44 | li.L6, 45 | li.L7, 46 | li.L8 { list-style-type: none } 47 | /* Alternate shading for lines */ 48 | li.L1, 49 | li.L3, 50 | li.L5, 51 | li.L7, 52 | li.L9 { background: #eee } 53 | -------------------------------------------------------------------------------- /conf/docs/assets/vendor/prettify/prettify.css: -------------------------------------------------------------------------------- 1 | /* Pretty printing styles. Used with prettify.js. */ 2 | 3 | /* SPAN elements with the classes below are added by prettyprint. */ 4 | .pln { color: #000 } /* plain text */ 5 | 6 | @media screen { 7 | .str { color: #080 } /* string content */ 8 | .kwd { color: #008 } /* a keyword */ 9 | .com { color: #800 } /* a comment */ 10 | .typ { color: #606 } /* a type name */ 11 | .lit { color: #066 } /* a literal value */ 12 | /* punctuation, lisp open bracket, lisp close bracket */ 13 | .pun, .opn, .clo { color: #660 } 14 | .tag { color: #008 } /* a markup tag name */ 15 | .atn { color: #606 } /* a markup attribute name */ 16 | .atv { color: #080 } /* a markup attribute value */ 17 | .dec, .var { color: #606 } /* a declaration; a variable name */ 18 | .fun { color: red } /* a function name */ 19 | } 20 | 21 | /* Use higher contrast and text-weight for printable form. */ 22 | @media print, projection { 23 | .str { color: #060 } 24 | .kwd { color: #006; font-weight: bold } 25 | .com { color: #600; font-style: italic } 26 | .typ { color: #404; font-weight: bold } 27 | .lit { color: #044 } 28 | .pun, .opn, .clo { color: #440 } 29 | .tag { color: #006; font-weight: bold } 30 | .atn { color: #404 } 31 | .atv { color: #060 } 32 | } 33 | 34 | /* Put a border around prettyprinted code snippets. */ 35 | pre.prettyprint { padding: 2px; border: 1px solid #888 } 36 | 37 | /* Specify class=linenums on a pre to get line numbering */ 38 | ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ 39 | li.L0, 40 | li.L1, 41 | li.L2, 42 | li.L3, 43 | li.L5, 44 | li.L6, 45 | li.L7, 46 | li.L8 { list-style-type: none } 47 | /* Alternate shading for lines */ 48 | li.L1, 49 | li.L3, 50 | li.L5, 51 | li.L7, 52 | li.L9 { background: #eee } 53 | -------------------------------------------------------------------------------- /lib/docview.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Yahoo! Inc. All rights reserved. 3 | Code licensed under the BSD License: 4 | http://yuilibrary.com/license/ 5 | */ 6 | YUI.add('docview', function (Y) { 7 | 8 | /* 9 | Selleck 10 | Copyright (c) 2011 Yahoo! Inc. 11 | Licensed under the BSD License. 12 | */ 13 | 14 | /** 15 | View class borrowed from [Selleck](https://github.com/rgrove/selleck) 16 | The view class is a **`handlebars`** template helper. 17 | @class DocView 18 | @constructor 19 | @param {Object} data Meta data to use in this template 20 | @param {String} templateName The name of the template file to render. 21 | **/ 22 | function DocView(data, templateName) { 23 | this.templateName = templateName; 24 | Y.mix(this, data); 25 | } 26 | 27 | DocView.prototype = { 28 | /** 29 | * **Mustache** `lambda` method for setting the HTML title 30 | * @method htmlTitle 31 | */ 32 | htmlTitle: function () { 33 | var name = this.displayName || this.name, 34 | title = name; 35 | 36 | if (title) { 37 | if (this.projectName) { 38 | title += ' - ' + this.projectName; 39 | } 40 | } else { 41 | title = this.projectName; 42 | } 43 | 44 | return title; 45 | }, 46 | 47 | /** 48 | * **Mustache** `lambda` method for setting the title 49 | * @method title 50 | */ 51 | title: function () { 52 | var name = this.displayName || this.name, 53 | title = this.projectName; 54 | 55 | if (name) { 56 | title += ': ' + name; 57 | } 58 | 59 | return title; 60 | } 61 | }; 62 | 63 | Y.DocView = DocView; 64 | }); 65 | -------------------------------------------------------------------------------- /tests/input/charts/StackingUtil.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility class used for creating stacked series. 3 | * 4 | * @module charts 5 | * @class StackingUtil 6 | * @constructor 7 | */ 8 | function StackingUtil(){} 9 | 10 | StackingUtil.prototype = { 11 | /** 12 | * @protected 13 | * 14 | * Adjusts coordinate values for stacked series. 15 | * 16 | * @method _stackCoordinates 17 | */ 18 | _stackCoordinates: function() 19 | { 20 | var direction = this.get("direction"), 21 | order = this.get("order"), 22 | type = this.get("type"), 23 | graph = this.get("graph"), 24 | h = graph.get("height"), 25 | seriesCollection = graph.seriesTypes[type], 26 | i = 0, 27 | len, 28 | xcoords = this.get("xcoords"), 29 | ycoords = this.get("ycoords"), 30 | prevXCoords, 31 | prevYCoords; 32 | if(order === 0) 33 | { 34 | return; 35 | } 36 | prevXCoords = seriesCollection[order - 1].get("xcoords").concat(); 37 | prevYCoords = seriesCollection[order - 1].get("ycoords").concat(); 38 | if(direction === "vertical") 39 | { 40 | len = prevXCoords.length; 41 | for(; i < len; ++i) 42 | { 43 | if(!isNaN(prevXCoords[i]) && !isNaN(xcoords[i])) 44 | { 45 | xcoords[i] += prevXCoords[i]; 46 | } 47 | } 48 | } 49 | else 50 | { 51 | len = prevYCoords.length; 52 | for(; i < len; ++i) 53 | { 54 | if(!isNaN(prevYCoords[i]) && !isNaN(ycoords[i])) 55 | { 56 | ycoords[i] = prevYCoords[i] - (h - ycoords[i]); 57 | } 58 | } 59 | } 60 | } 61 | }; 62 | Y.StackingUtil = StackingUtil; 63 | -------------------------------------------------------------------------------- /themes/simple/partials/classes.handlebars: -------------------------------------------------------------------------------- 1 |

Class {{moduleName}}

2 | {{#if uses}} 3 | Uses: 4 | {{#each uses}} 5 | {{this}} 6 | {{/each}} 7 |
8 | {{/if}} 9 | {{#if extension_for}} 10 | Extension For: 11 | {{#each extension_for}} 12 | {{this}} 13 | {{/each}} 14 |
15 | {{/if}} 16 | {{#if extends}} 17 | Extends: {{#crossLink extends}}{{/crossLink}}
18 | {{/if}} 19 | Class defined in: `{{file}}:{{line}}` 20 |
{{{classDescription}}}
21 | 22 | {{#if is_constructor}} 23 | {{#is_constructor}} 24 | {{>method}} 25 | {{/is_constructor}} 26 | {{/if}} 27 | 28 |
29 | 43 |
44 | {{#if methods}} 45 |
46 | {{#methods}} 47 | {{>method}} 48 | {{/methods}} 49 |
50 | {{/if}} 51 | {{#if properties}} 52 |
53 | {{#properties}} 54 | {{>props}} 55 | {{/properties}} 56 |
57 | {{/if}} 58 | {{#if attrs}} 59 |
60 | {{#attrs}} 61 | {{>attrs}} 62 | {{/attrs}} 63 |
64 | {{/if}} 65 | {{#if events}} 66 |
67 | {{#events}} 68 | {{>events}} 69 | {{/events}} 70 |
71 | {{/if}} 72 |
73 |
74 | -------------------------------------------------------------------------------- /lib/project.js: -------------------------------------------------------------------------------- 1 | YUI.add('project', function (Y) { 2 | 3 | Y.Project = { 4 | mix: function (json, options) { 5 | if (json.project) { 6 | options = Y.merge(options, json.project); 7 | } 8 | 9 | if (options.title && !options.name) { 10 | options.name = options.title; 11 | } 12 | 13 | return options; 14 | }, 15 | init: function (options) { 16 | var project = {}; 17 | if (options.configfile) { 18 | project = Y.Files.getJSON(options.configfile); 19 | } else { 20 | Y.log('Scanning for yuidoc.json file.', 'info', 'yuidoc'); 21 | project = Y.getProjectData(); 22 | if (!project) { 23 | project = {}; 24 | } 25 | } 26 | 27 | if (project.options && Object.keys(project.options).length) { 28 | options = Y.merge(project.options, options); 29 | delete project.options; 30 | options.project = project; 31 | } 32 | 33 | if (options.version && options.project) { 34 | options.project.version = options.version; 35 | delete options.version; 36 | } 37 | 38 | if (!options.outdir) { 39 | options.outdir = './out'; 40 | } 41 | 42 | options.paths = Y.validatePaths(options.paths, options.ignorePaths); 43 | 44 | if (!options.paths.length) { 45 | Y.log('Paths argument was empty', 'warn', 'yuidoc'); 46 | Y.showHelp(); 47 | process.exit(1); 48 | } 49 | 50 | if (typeof options.tabtospace === 'number') { 51 | /*jshint onevar:false */ 52 | options.tabspace = ''; 53 | for (var s = 0; s < options.tabtospace; s++) { 54 | options.tabspace += ' '; 55 | } 56 | } 57 | 58 | return options; 59 | } 60 | }; 61 | 62 | }); 63 | -------------------------------------------------------------------------------- /tests/input/charts/StackedComboSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The StackedComboSeries class renders a combination of lines, plots and area fills in a single series. Series 3 | * are stacked along the value axis to indicate each series contribution to a cumulative total. Each 4 | * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are 5 | * rendered. 6 | * 7 | * @module charts 8 | * @class StackedComboSeries 9 | * @extends ComboSeries 10 | * @uses StackingUtil 11 | * @constructor 12 | */ 13 | Y.StackedComboSeries = Y.Base.create("stackedComboSeries", Y.ComboSeries, [Y.StackingUtil], { 14 | /** 15 | * @protected 16 | * 17 | * Calculates the coordinates for the series. Overrides base implementation. 18 | * 19 | * @method setAreaData 20 | */ 21 | setAreaData: function() 22 | { 23 | Y.StackedComboSeries.superclass.setAreaData.apply(this); 24 | this._stackCoordinates.apply(this); 25 | }, 26 | 27 | /** 28 | * @protected 29 | * 30 | * Draws the series. 31 | * 32 | * @method drawSeries 33 | */ 34 | drawSeries: function() 35 | { 36 | if(this.get("showAreaFill")) 37 | { 38 | this.drawFill.apply(this, this._getStackedClosingPoints()); 39 | } 40 | if(this.get("showLines")) 41 | { 42 | this.drawLines(); 43 | } 44 | if(this.get("showMarkers")) 45 | { 46 | this.drawPlots(); 47 | } 48 | } 49 | 50 | }, { 51 | ATTRS : { 52 | /** 53 | * Read-only attribute indicating the type of series. 54 | * 55 | * @attribute type 56 | * @type String 57 | * @default stackedCombo 58 | */ 59 | type: { 60 | value: "stackedCombo" 61 | }, 62 | 63 | /** 64 | * Indicates whether a fill is displayed. 65 | * 66 | * @attribute showAreaFill 67 | * @type Boolean 68 | * @default true 69 | */ 70 | showAreaFill: { 71 | value: true 72 | } 73 | } 74 | }); 75 | -------------------------------------------------------------------------------- /themes/default/layouts/main.handlebars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{htmlTitle}} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 | {{#if projectLogo}} 18 |

19 | {{else}} 20 |

21 | {{/if}} 22 |
23 |
24 | API Docs for: {{projectVersion}} 25 |
26 |
27 |
28 | 29 |
30 | 33 |
34 |
35 | {{>options}} 36 |
37 |
38 |
39 | {{>layout_content}} 40 |
41 |
42 |
43 |
44 |
45 |
46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /tests/parser_coffee.js: -------------------------------------------------------------------------------- 1 | /*global Y:true */ 2 | var YUITest = require('yuitest'), 3 | Assert = YUITest.Assert, 4 | path = require('path'), 5 | Y = require(path.join(__dirname, '../', 'lib', 'index')); 6 | 7 | //Move to the test dir before running the tests. 8 | process.chdir(__dirname); 9 | 10 | var suite = new YUITest.TestSuite({ 11 | name: 'Coffee Parser Test Suite', 12 | setUp: function () { 13 | var json = (new Y.YUIDoc({ 14 | quiet: true, 15 | paths: ['input/'], 16 | outdir: './out', 17 | extension: '.coffee', 18 | syntaxtype: 'coffee' 19 | })).run(); 20 | 21 | this.project = json.project; 22 | this.data = json; 23 | } 24 | }); 25 | 26 | suite.add(new YUITest.TestCase({ 27 | name: "Project Data", 28 | setUp: function () { 29 | this.project = suite.project; 30 | this.data = suite.data; 31 | }, 32 | findByName: function (name, cl) { 33 | var items = this.data.classitems, 34 | ret; 35 | 36 | items.forEach(function (i) { 37 | if (i.name === name && i.class === cl) { 38 | ret = i; 39 | } 40 | }); 41 | 42 | return ret; 43 | }, 44 | 'test: project data': function () { 45 | Assert.areSame(path.normalize('input/coffee/test.coffee'), this.project.file, 'Project data loaded from wrong file'); 46 | Assert.areSame(2, this.project.line, 'Line number is off'); 47 | Assert.areSame('The test project', this.project.description, 'Description not set properly'); 48 | Assert.areSame('The Tester', this.project.title, 'Title not set'); 49 | Assert.areSame('admo', this.project.author, 'Author not set'); 50 | Assert.areSame('entropy', this.project.contributor, 'Contributor not set'); 51 | Assert.areSame('http://a.img', this.project.icon[0], 'Icon not set'); 52 | Assert.areSame(1, this.project.icon.length, 'Found wring number of icons'); 53 | Assert.areSame(2, this.project.url.length, 'Found wrong number of urls'); 54 | Assert.areSame('http://one.url', this.project.url[0], 'URL #1 is wrong'); 55 | Assert.areSame('http://two.url', this.project.url[1], 'URL #2 is wrong'); 56 | } 57 | })); 58 | 59 | YUITest.TestRunner.add(suite); 60 | -------------------------------------------------------------------------------- /docs/args/partials/help.mustache: -------------------------------------------------------------------------------- 1 | 2 | YUI Doc generates API documentation from a modified JavaDoc syntax. 3 | 4 | Current version (0.3.47) 5 | 6 | Usage: yuidoc 7 | 8 | Common Options: 9 | -c, --config, --configfile A JSON config file to provide configuration data. 10 | You can also create a yuidoc.json file and place it 11 | anywhere under your source tree and YUI Doc will find it 12 | and use it. 13 | -e, --extension The list of file extensions to parse 14 | for api documentation. (defaults to .js) 15 | -x, --exclude Directories to exclude from parsing 16 | (defaults to '.DS_Store,.svn,CVS,.git,build_rollup_tmp,build_tmp') 17 | -v, --version Show the current YUIDoc version 18 | --project-version Set the doc version for the template 19 | -N, --no-color Turn off terminal colors (for automation) 20 | -C, --no-code Turn off code generation (don't include source files in output) 21 | -n, --norecurse Do not recurse directories (default is to recurse) 22 | -S, --selleck Look for Selleck component data and attach to API meta data 23 | -V, --view Dump the Handlebars.js view data instead of writing template files 24 | -p, --parse-only Only parse the API docs and create the JSON data, do not render templates 25 | -o, --outdir Path to put the generated files (defaults to ./out) 26 | -t, --themedir Path to a custom theme directory containing Handlebars templates 27 | -H, --helpers Require these file and add Handlebars helpers. See docs for more information 28 | --charset CHARSET Use this as the default charset for all file operations. Defaults to 'utf8' 29 | -h, --help Show this help 30 | -q, --quiet Supress logging output 31 | -T, --theme Choose one of the built in themes (default is default) 32 | --syntaxtype Choose comment syntax type (default is js) 33 | --server Fire up the YUIDoc server for faster API doc developement. Pass optional port to listen on. (default is 3000) 34 | --lint Lint your docs, will print parser warnings and exit code 1 if there are any 35 | 36 | Supply a list of paths (shell globbing is handy here) 37 | 38 | -------------------------------------------------------------------------------- /themes/simple/partials/method.handlebars: -------------------------------------------------------------------------------- 1 | 2 |
3 | {{#if final}}final {{/if}}{{#if returnType}}{{#crossLink returnType}}{{/crossLink}} {{/if}}`{{name}}`( `{{paramsList}} ` ) {{#if access}}`/* {{access}} method */`{{/if}} 4 |
5 | 6 | {{#if overwritten_from}} 7 | Defined in {{overwritten_from/class}} but overwritten locally: 8 | {{else}} 9 | {{#if extended_from}} Defined in {{extended_from}}: {{/if}} 10 | {{/if}} 11 | `{{file}}:{{line}}` 12 |
13 | {{{methodDescription}}} 14 | {{#if params}} 15 | Parameters: 16 |
    17 | {{#params}} 18 |
  • 19 | {{#if optional}} 20 | `[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]` <{{#crossLink type}}{{/crossLink}}> 21 | {{else}} 22 | `{{name}}` <{{#crossLink type}}{{/crossLink}}> 23 | {{/if}} 24 | {{#if multiple}} 25 | (*..n) 26 | {{/if}} 27 | {{{description}}} 28 | {{#if props}} 29 |
      30 | {{#props}} 31 |
    • `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{{description}}} 32 | {{#if props}} 33 |
        34 | {{#props}} 35 |
      • `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{{description}}}
      • 36 | {{/props}} 37 |
      38 | {{/if}} 39 |
    • 40 | {{/props}} 41 |
    42 | {{/if}} 43 |
  • 44 | {{/params}} 45 |
46 | {{/if}} 47 | {{#if return}} 48 | {{#return}} 49 |
Returns: {{#if type}}<{{#crossLink type}}{{/crossLink}}> {{/if}}{{{description}}}
50 | {{/return}} 51 | {{/if}} 52 | {{#if example}} 53 |
Example
54 | {{{example}}} 55 | {{/if}} 56 |
57 | -------------------------------------------------------------------------------- /tests/input/charts/AreaSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The AreaSeries class renders quantitative data on a graph by creating a fill between 0 3 | * and the relevant data points. 4 | * 5 | * @module charts 6 | * @class AreaSeries 7 | * @extends CartesianSeries 8 | * @uses Fills 9 | * @constructor 10 | */ 11 | Y.AreaSeries = Y.Base.create("areaSeries", Y.CartesianSeries, [Y.Fills], { 12 | /** 13 | * @protected 14 | * 15 | * Renders the series. 16 | * 17 | * @method drawSeries 18 | */ 19 | drawSeries: function() 20 | { 21 | this.drawFill.apply(this, this._getClosingPoints()); 22 | }, 23 | 24 | /** 25 | * @protected 26 | * 27 | * Method used by `styles` setter. Overrides base implementation. 28 | * 29 | * @method _setStyles 30 | * @param {Object} newStyles Hash of properties to update. 31 | * @return Object 32 | */ 33 | _setStyles: function(val) 34 | { 35 | if(!val.area) 36 | { 37 | val = {area:val}; 38 | } 39 | return Y.AreaSeries.superclass._setStyles.apply(this, [val]); 40 | }, 41 | 42 | /** 43 | * @protected 44 | * 45 | * Gets the default value for the `styles` attribute. Overrides 46 | * base implementation. 47 | * 48 | * @method _getDefaultStyles 49 | * @return Object 50 | */ 51 | _getDefaultStyles: function() 52 | { 53 | var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles()); 54 | return styles; 55 | } 56 | }, 57 | { 58 | ATTRS: { 59 | /** 60 | * Read-only attribute indicating the type of series. 61 | * 62 | * @attribute type 63 | * @type String 64 | * @default area 65 | */ 66 | type: { 67 | value:"area" 68 | } 69 | 70 | /** 71 | * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values: 72 | * 73 | *
74 | *
color
The color of the fill. The default value is determined by the order of the series on the graph. The color will be 75 | * retrieved from the following array: 76 | * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]` 77 | *
78 | *
alpha
Number between 0 and 1 that indicates the opacity of the fill. The default value is 1
79 | *
80 | * 81 | * @attribute styles 82 | * @type Object 83 | */ 84 | } 85 | }); 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /themes/default/partials/module.handlebars: -------------------------------------------------------------------------------- 1 |

{{name}} Module

2 |
3 | {{#extra}} 4 | {{#selleck}} 5 | User Guide & Examples 6 | {{/selleck}} 7 | {{/extra}} 8 | 9 | {{#if requires}} 10 |
11 | Requires 12 |
    13 | {{#requires}} 14 |
  • {{#crossLinkModule .}}{{/crossLinkModule}}
  • 15 | {{/requires}} 16 |
17 |
18 | {{/if}} 19 | 20 | {{#if foundAt}} 21 |
22 | Defined in: `{{{file}}}:{{{line}}}` 23 |
24 | {{/if}} 25 | 26 | {{#if since}} 27 |

Available since {{since}}

28 | {{/if}} 29 |
30 | 31 | {{#if deprecated}} 32 |
33 |

34 | {{#if deprecationMessage}} 35 | Deprecated: {{deprecationMessage}} 36 | {{else}} 37 | This module is deprecated. 38 | {{/if}} 39 |

40 |
41 | {{/if}} 42 | 43 |
44 | {{{moduleDescription}}} 45 |
46 | 47 | {{#example}} 48 |
49 |

Example:

50 |
51 | {{{.}}} 52 |
53 |
54 | {{/example}} 55 | 56 |
57 |
58 | {{#if moduleClasses}} 59 |

This module provides the following classes:

60 | 61 | 70 | {{/if}} 71 |
72 | 73 |
74 | {{#if subModules}} 75 |

This module is a rollup of the following modules:

76 | 77 | 90 | {{/if}} 91 |
92 |
93 | -------------------------------------------------------------------------------- /tests/input/charts/SplineSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SplineSeries renders a graph with data points connected by a curve. 3 | * 4 | * @module charts 5 | * @class SplineSeries 6 | * @constructor 7 | * @extends CartesianSeries 8 | * @uses CurveUtil 9 | * @uses Lines 10 | */ 11 | Y.SplineSeries = Y.Base.create("splineSeries", Y.LineSeries, [Y.CurveUtil, Y.Lines], { 12 | /** 13 | * @protected 14 | * 15 | * Draws the series. 16 | * 17 | * @method drawSeries 18 | */ 19 | drawSeries: function() 20 | { 21 | this.drawSpline(); 22 | } 23 | }, { 24 | ATTRS : { 25 | /** 26 | * Read-only attribute indicating the type of series. 27 | * 28 | * @attribute type 29 | * @type String 30 | * @default spline 31 | */ 32 | type : { 33 | value:"spline" 34 | } 35 | 36 | /** 37 | * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values: 38 | *
39 | *
color
The color of the line. The default value is determined by the order of the series on the graph. The color will be 40 | * retrieved from the following array: 41 | * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]` 42 | *
weight
Number that indicates the width of the line. The default value is 6.
43 | *
alpha
Number between 0 and 1 that indicates the opacity of the line. The default value is 1.
44 | *
lineType
Indicates whether the line is solid or dashed. The default value is solid.
45 | *
dashLength
When the `lineType` is dashed, indicates the length of the dash. The default value is 10.
46 | *
gapSpace
When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.
47 | *
connectDiscontinuousPoints
Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.
48 | *
discontinuousType
Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.
49 | *
discontinuousDashLength
When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.
50 | *
discontinuousGapSpace
When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.
51 | *
52 | * 53 | * @attribute styles 54 | * @type Object 55 | */ 56 | } 57 | }); 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /tests/input/charts/StackedAxis.js: -------------------------------------------------------------------------------- 1 | /** 2 | * StackedAxis manages stacked numeric data on an axis. 3 | * 4 | * @module charts 5 | * @class StackedAxis 6 | * @constructor 7 | * @param {Object} config (optional) Configuration parameters for the Chart. 8 | * @extends NumericAxis 9 | */ 10 | function StackedAxis(config) 11 | { 12 | StackedAxis.superclass.constructor.apply(this, arguments); 13 | } 14 | 15 | StackedAxis.NAME = "stackedAxis"; 16 | 17 | 18 | Y.extend(StackedAxis, Y.NumericAxis, 19 | { 20 | /** 21 | * Calculates the maximum and minimum values for the `Axis`. 22 | * 23 | * @method _updateMinAndMax 24 | * @private 25 | */ 26 | _updateMinAndMax: function() 27 | { 28 | var max = 0, 29 | min = 0, 30 | pos = 0, 31 | neg = 0, 32 | len = 0, 33 | i = 0, 34 | key, 35 | num, 36 | keys = this.get("keys"), 37 | setMin = this.get("setMin"), 38 | setMax = this.get("setMax"); 39 | 40 | for(key in keys) 41 | { 42 | if(keys.hasOwnProperty(key)) 43 | { 44 | len = Math.max(len, keys[key].length); 45 | } 46 | } 47 | for(; i < len; ++i) 48 | { 49 | pos = 0; 50 | neg = 0; 51 | for(key in keys) 52 | { 53 | if(keys.hasOwnProperty(key)) 54 | { 55 | num = keys[key][i]; 56 | if(isNaN(num)) 57 | { 58 | continue; 59 | } 60 | if(num >= 0) 61 | { 62 | pos += num; 63 | } 64 | else 65 | { 66 | neg += num; 67 | } 68 | } 69 | } 70 | if(pos > 0) 71 | { 72 | max = Math.max(max, pos); 73 | } 74 | else 75 | { 76 | max = Math.max(max, neg); 77 | } 78 | if(neg < 0) 79 | { 80 | min = Math.min(min, neg); 81 | } 82 | else 83 | { 84 | min = Math.min(min, pos); 85 | } 86 | } 87 | this._actualMaximum = max; 88 | this._actualMinimum = min; 89 | if(setMax) 90 | { 91 | max = this._setMaximum; 92 | } 93 | if(setMin) 94 | { 95 | min = this._setMinimum; 96 | } 97 | this._roundMinAndMax(min, max, setMin, setMax); 98 | } 99 | }); 100 | 101 | Y.StackedAxis = StackedAxis; 102 | 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | YUIDoc Doc parser 2 | ================= 3 | 4 | YUIDoc is a [Node.js](http://nodejs.org/) application used at build time to 5 | generate API documentation for JavaScript code. YUIDoc is comment-driven and supports a wide 6 | range of JavaScript coding styles. The output of YUI Doc is API documentation formatted as a 7 | set of HTML pages including information about methods, properties, custom events and 8 | inheritance for JavaScript objects. YUIDoc was orignally written for the YUI Project; 9 | it uses YUI JavaScript and CSS in the generated files and it supports common YUI 10 | conventions like Custom Events. That said, it can be used easily and productively on non-YUI code. 11 | 12 | Current Build Status 13 | -------------------- 14 | 15 | [![Build Status](https://secure.travis-ci.org/yui/yuidoc.png?branch=master)](http://travis-ci.org/yui/yuidoc) 16 | 17 | Installation 18 | ------------ 19 | 20 | npm -g i yuidocjs 21 | 22 | 23 | Documentation 24 | ------------- 25 | 26 | * [User Guides](http://yui.github.com/yuidoc/) 27 | * [API Docs](http://yui.github.com/yuidoc/api/) 28 | * [Support Mailing List](https://groups.google.com/forum/#!forum/yuidoc) 29 | 30 | Released under the YUI BSD License 31 | ---------------------------------- 32 | 33 | Copyright 2012 Yahoo! Inc. 34 | All rights reserved. 35 | 36 | Redistribution and use in source and binary forms, with or without 37 | modification, are permitted provided that the following conditions are met: 38 | 39 | * Redistributions of source code must retain the above copyright 40 | notice, this list of conditions and the following disclaimer. 41 | * Redistributions in binary form must reproduce the above copyright 42 | notice, this list of conditions and the following disclaimer in the 43 | documentation and/or other materials provided with the distribution. 44 | * Neither the name of the Yahoo! Inc. nor the 45 | names of its contributors may be used to endorse or promote products 46 | derived from this software without specific prior written permission. 47 | 48 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 49 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 50 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 51 | DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY 52 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 53 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 54 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 55 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 56 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 57 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 58 | -------------------------------------------------------------------------------- /themes/simple/partials/sidebar.handlebars: -------------------------------------------------------------------------------- 1 | 21 | 22 | 34 | 35 | {{#if methods}} 36 | 48 | {{/if}} 49 | 50 | {{#if events}} 51 | 63 | {{/if}} 64 | 65 | {{#if props}} 66 | 78 | {{/if}} 79 | 80 | {{#if attributes}} 81 | 93 | {{/if}} 94 | 95 | {{#if fileTree}} 96 | 104 | {{/if}} 105 | 106 | -------------------------------------------------------------------------------- /conf/docs/index.mustache: -------------------------------------------------------------------------------- 1 |

Welcome to YUIDoc {{version}}!

2 | 3 |
4 |

YUIDoc is a Node.js application that 5 | generates API documentation from comments in source, using a syntax similar 6 | to tools like Javadoc and Doxygen. YUIDoc provides:

7 | 8 |
    9 |
  • Live previews. YUIDoc includes a 10 | standalone doc server, 11 | making it trivial to preview your docs as you write.
  • 12 |
  • Modern markup. YUIDoc's generated documentation is an 13 | attractive, 14 | functional web application with real URLs and graceful 15 | fallbacks for spiders and other agents that can't run JavaScript.
  • 16 |
  • Wide language support. YUIDoc was originally designed for 17 | the YUI project, but it is not 18 | tied to any particular library or programming language. 19 | You can use it with any language that supports 20 | `/* */` comment blocks.
  • 21 |
22 |

23 |
24 | 25 |

Installation and Usage

26 | 27 |
    28 |
  1. Download and install Node.js
  2. 29 |
  3. Run `npm -g install yuidocjs`.
  4. 30 |
  5. Run `yuidoc .` at the top of your JS source tree.
  6. 31 |
32 | 33 |

That's it! For more information about running the `yuidoc` commandline tool, 34 | refer to "Using YUIDoc".

35 | 36 |

User Guides

37 | 38 |
    39 | {{#components}} 40 | {{#meta}} 41 |
  • {{displayName}} — {{description}}
  • 42 | {{/meta}} 43 | {{/components}} 44 |
45 | 46 |

Example YUIDoc Comment Blocks

47 | 48 |

YUIDoc parses a modified form of JSDoc tags. 49 | This section provides a taste of some of the more common constructs in YUIDoc. 50 | For more information, refer to the "YUIDoc Syntax Reference".

51 | 52 |

Example Class Block

53 | ``` 54 | /** 55 | * This is the description for my class. 56 | * 57 | * @class MyClass 58 | * @constructor 59 | */ 60 | ``` 61 |

Example Method Block

62 | ``` 63 | /** 64 | * My method description. Like other pieces of your comment blocks, 65 | * this can span multiple lines. 66 | * 67 | * @method methodName 68 | * @param {String} foo Argument 1 69 | * @param {Object} config A config object 70 | * @param {String} config.name The name on the config object 71 | * @param {Function} config.callback A callback function on the config object 72 | * @param {Boolean} [extra=false] Do extra, optional work 73 | * @return {Boolean} Returns true on success 74 | */ 75 | ``` 76 | 77 |

Example Property Block

78 | ``` 79 | /** 80 | * My property description. Like other pieces of your comment blocks, 81 | * this can span multiple lines. 82 | * 83 | * @property propertyName 84 | * @type {Object} 85 | * @default "foo" 86 | */ 87 | ``` 88 | -------------------------------------------------------------------------------- /tests/utils.js: -------------------------------------------------------------------------------- 1 | /*global Y:true */ 2 | var YUITest = require('yuitest'), 3 | Assert = YUITest.Assert, 4 | path = require('path'), 5 | Y = require(path.join(__dirname, '../', 'lib', 'index')); 6 | 7 | var suite = new YUITest.TestSuite({ 8 | name: 'Utils Test Suite' 9 | }); 10 | 11 | suite.add(new YUITest.TestCase({ 12 | name: 'getProjectData Folder Priority', 13 | 'test: Nearest Folder Priority': function () { 14 | var d = Y.getProjectData('input/folders1'); 15 | Assert.areEqual('yuidoc-root', d.name, 'must use nearest yuidoc.json first'); 16 | }, 17 | 'test: Finds package.json': function () { 18 | var d = Y.getProjectData('input/folders2'); 19 | Assert.areEqual('yuidoc-two', d.name, 'used deep yuidoc.json'); 20 | Assert.areEqual('package-root', d.description, 'used shallow package.json'); 21 | }, 22 | 'test: Finds package.json in same folder as yuidoc.json': function () { 23 | var d = Y.getProjectData('input/folders3'); 24 | Assert.areEqual('yuidoc-root', d.name, 'used deep yuidoc.json'); 25 | Assert.areEqual('package-root', d.description, 'used deep package.json'); 26 | }, 27 | 'test: Ignores package.json in deeper folder than yuidoc.json': function () { 28 | var d = Y.getProjectData('input/folders4'); 29 | Assert.areEqual('yuidoc-one', d.name, 'used deep yuidoc.json'); 30 | Assert.isUndefined(d.description, 'used deep package.json'); 31 | }, 32 | 'test: Must be breadth-first': function () { 33 | var d = Y.getProjectData('input/folders5'); 34 | Assert.areEqual('yuidoc-two', d.name, 'used wrong yuidoc.json'); 35 | Assert.areEqual('package-two', d.description, 'used wrong package.json'); 36 | } 37 | })); 38 | 39 | suite.add(new YUITest.TestCase({ 40 | name: 'validatePaths', 41 | 'test: path globs': function () { 42 | var options; 43 | 44 | process.chdir(path.join(__dirname, 'input/globbing')); 45 | 46 | // Simulate a path provided by a configuration... 47 | // first with a String path 48 | options = { 49 | paths: '**/yui/src/*' 50 | }; 51 | options = Y.Project.init(options); 52 | 53 | Assert.isArray(options.paths, 'Failed to set path'); 54 | Assert.areSame(3, options.paths.length, 'Failed to retrieve all path options'); 55 | 56 | // then with an Array of path 57 | options = { 58 | paths: [ 59 | '**/yui/src/*' 60 | ] 61 | }; 62 | options = Y.Project.init(options); 63 | 64 | Assert.isArray(options.paths, 'Failed to set path'); 65 | Assert.areSame(3, options.paths.length, 'Failed to retrieve all path options'); 66 | 67 | 68 | // Test with a path as passed to Y.Options 69 | options = Y.Options([ 70 | '**/yui/src/*' 71 | ]); 72 | options = Y.Project.init(options); 73 | 74 | Assert.isArray(options.paths, 'Failed to set path'); 75 | Assert.areSame(3, options.paths.length, 'Failed to retrieve all path options'); 76 | } 77 | })); 78 | 79 | YUITest.TestRunner.add(suite); 80 | -------------------------------------------------------------------------------- /tests/input/charts/Renderer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The Renderer class is a base class for chart components that use the `styles` 3 | * attribute. 4 | * 5 | * @module charts 6 | * @class Renderer 7 | * @constructor 8 | */ 9 | function Renderer(){} 10 | 11 | Renderer.ATTRS = { 12 | /** 13 | * Style properties for class 14 | * 15 | * @attribute styles 16 | * @type Object 17 | */ 18 | styles: 19 | { 20 | getter: function() 21 | { 22 | this._styles = this._styles || this._getDefaultStyles(); 23 | return this._styles; 24 | }, 25 | 26 | setter: function(val) 27 | { 28 | this._styles = this._setStyles(val); 29 | } 30 | }, 31 | 32 | /** 33 | * The graphic in which drawings will be rendered. 34 | * 35 | * @attribute graphic 36 | * @type Graphic 37 | */ 38 | graphic: {} 39 | }; 40 | Renderer.NAME = "renderer"; 41 | 42 | Renderer.prototype = { 43 | /** 44 | * Storage for `styles` attribute. 45 | * 46 | * @property _styles 47 | * @type Object 48 | * @private 49 | */ 50 | _styles: null, 51 | 52 | /** 53 | * Method used by `styles` setter. 54 | * 55 | * @method _setStyles 56 | * @param {Object} newStyles Hash of properties to update. 57 | * @return Object 58 | * @protected 59 | */ 60 | _setStyles: function(newstyles) 61 | { 62 | var styles = this.get("styles"); 63 | return this._mergeStyles(newstyles, styles); 64 | }, 65 | 66 | /** 67 | * Merges to object literals so that only specified properties are 68 | * overwritten. 69 | * 70 | * @method _mergeStyles 71 | * @param {Object} a Hash of new styles 72 | * @param {Object} b Hash of original styles 73 | * @return Object 74 | * @protected 75 | */ 76 | _mergeStyles: function(a, b) 77 | { 78 | if(!b) 79 | { 80 | b = {}; 81 | } 82 | var newstyles = Y.merge(b, {}); 83 | Y.Object.each(a, function(value, key, a) 84 | { 85 | if(b.hasOwnProperty(key) && Y_Lang.isObject(value) && !Y_Lang.isFunction(value) && !Y_Lang.isArray(value)) 86 | { 87 | newstyles[key] = this._mergeStyles(value, b[key]); 88 | } 89 | else 90 | { 91 | newstyles[key] = value; 92 | } 93 | }, this); 94 | return newstyles; 95 | }, 96 | 97 | /** 98 | * Gets the default value for the `styles` attribute. 99 | * 100 | * @method _getDefaultStyles 101 | * @return Object 102 | * @protected 103 | */ 104 | _getDefaultStyles: function() 105 | { 106 | return {padding:{ 107 | top:0, 108 | right: 0, 109 | bottom: 0, 110 | left: 0 111 | }}; 112 | } 113 | }; 114 | 115 | Y.augment(Renderer, Y.Attribute); 116 | Y.Renderer = Renderer; 117 | 118 | -------------------------------------------------------------------------------- /output/api/assets/js/api-search.js: -------------------------------------------------------------------------------- 1 | YUI.add('api-search', function (Y) { 2 | 3 | var Lang = Y.Lang, 4 | Node = Y.Node, 5 | YArray = Y.Array; 6 | 7 | Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { 8 | // -- Public Properties ---------------------------------------------------- 9 | RESULT_TEMPLATE: 10 | '
  • ' + 11 | '' + 12 | '

    {name}

    ' + 13 | '{resultType}' + 14 | '
    {description}
    ' + 15 | '{class}' + 16 | '
    ' + 17 | '
  • ', 18 | 19 | // -- Initializer ---------------------------------------------------------- 20 | initializer: function () { 21 | this._bindUIACBase(); 22 | this._syncUIACBase(); 23 | }, 24 | 25 | // -- Protected Methods ---------------------------------------------------- 26 | _apiResultFilter: function (query, results) { 27 | // Filter components out of the results. 28 | return YArray.filter(results, function (result) { 29 | return result.raw.resultType === 'component' ? false : result; 30 | }); 31 | }, 32 | 33 | _apiResultFormatter: function (query, results) { 34 | return YArray.map(results, function (result) { 35 | var raw = Y.merge(result.raw), // create a copy 36 | desc = raw.description || ''; 37 | 38 | // Convert description to text and truncate it if necessary. 39 | desc = Node.create('
    ' + desc + '
    ').get('text'); 40 | 41 | if (desc.length > 65) { 42 | desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; 43 | } else { 44 | desc = Y.Escape.html(desc); 45 | } 46 | 47 | raw['class'] || (raw['class'] = ''); 48 | raw.description = desc; 49 | 50 | // Use the highlighted result name. 51 | raw.name = result.highlighted; 52 | 53 | return Lang.sub(this.RESULT_TEMPLATE, raw); 54 | }, this); 55 | }, 56 | 57 | _apiTextLocator: function (result) { 58 | return result.displayName || result.name; 59 | } 60 | }, { 61 | // -- Attributes ----------------------------------------------------------- 62 | ATTRS: { 63 | resultFormatter: { 64 | valueFn: function () { 65 | return this._apiResultFormatter; 66 | } 67 | }, 68 | 69 | resultFilters: { 70 | valueFn: function () { 71 | return this._apiResultFilter; 72 | } 73 | }, 74 | 75 | resultHighlighter: { 76 | value: 'phraseMatch' 77 | }, 78 | 79 | resultListLocator: { 80 | value: 'data.results' 81 | }, 82 | 83 | resultTextLocator: { 84 | valueFn: function () { 85 | return this._apiTextLocator; 86 | } 87 | }, 88 | 89 | source: { 90 | value: '/api/v1/search?q={query}&count={maxResults}' 91 | } 92 | } 93 | }); 94 | 95 | }, '3.4.0', {requires: [ 96 | 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', 97 | 'escape' 98 | ]}); 99 | -------------------------------------------------------------------------------- /themes/default/assets/js/api-search.js: -------------------------------------------------------------------------------- 1 | YUI.add('api-search', function (Y) { 2 | 3 | var Lang = Y.Lang, 4 | Node = Y.Node, 5 | YArray = Y.Array; 6 | 7 | Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { 8 | // -- Public Properties ---------------------------------------------------- 9 | RESULT_TEMPLATE: 10 | '
  • ' + 11 | '' + 12 | '

    {name}

    ' + 13 | '{resultType}' + 14 | '
    {description}
    ' + 15 | '{class}' + 16 | '
    ' + 17 | '
  • ', 18 | 19 | // -- Initializer ---------------------------------------------------------- 20 | initializer: function () { 21 | this._bindUIACBase(); 22 | this._syncUIACBase(); 23 | }, 24 | 25 | // -- Protected Methods ---------------------------------------------------- 26 | _apiResultFilter: function (query, results) { 27 | // Filter components out of the results. 28 | return YArray.filter(results, function (result) { 29 | return result.raw.resultType === 'component' ? false : result; 30 | }); 31 | }, 32 | 33 | _apiResultFormatter: function (query, results) { 34 | return YArray.map(results, function (result) { 35 | var raw = Y.merge(result.raw), // create a copy 36 | desc = raw.description || ''; 37 | 38 | // Convert description to text and truncate it if necessary. 39 | desc = Node.create('
    ' + desc + '
    ').get('text'); 40 | 41 | if (desc.length > 65) { 42 | desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; 43 | } else { 44 | desc = Y.Escape.html(desc); 45 | } 46 | 47 | raw['class'] || (raw['class'] = ''); 48 | raw.description = desc; 49 | 50 | // Use the highlighted result name. 51 | raw.name = result.highlighted; 52 | 53 | return Lang.sub(this.RESULT_TEMPLATE, raw); 54 | }, this); 55 | }, 56 | 57 | _apiTextLocator: function (result) { 58 | return result.displayName || result.name; 59 | } 60 | }, { 61 | // -- Attributes ----------------------------------------------------------- 62 | ATTRS: { 63 | resultFormatter: { 64 | valueFn: function () { 65 | return this._apiResultFormatter; 66 | } 67 | }, 68 | 69 | resultFilters: { 70 | valueFn: function () { 71 | return this._apiResultFilter; 72 | } 73 | }, 74 | 75 | resultHighlighter: { 76 | value: 'phraseMatch' 77 | }, 78 | 79 | resultListLocator: { 80 | value: 'data.results' 81 | }, 82 | 83 | resultTextLocator: { 84 | valueFn: function () { 85 | return this._apiTextLocator; 86 | } 87 | }, 88 | 89 | source: { 90 | value: '/api/v1/search?q={query}&count={maxResults}' 91 | } 92 | } 93 | }); 94 | 95 | }, '3.4.0', {requires: [ 96 | 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', 97 | 'escape' 98 | ]}); 99 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuidocjs", 3 | "version": "0.3.48", 4 | "description": "YUIDoc, YUI's JavaScript Documentation engine.", 5 | "author": "Dav Glass ", 6 | "bugs": { "url" : "http://github.com/yui/yuidoc/issues" }, 7 | "contributors": [ 8 | { "name": "Adam Moore", "email": "amoore@gmail.com" }, 9 | { "name": "Ryan Grove", "email": "ryan@wonko.com" }, 10 | { "name": "Eric Ferraiuolo", "email": "eferraiuolo@gmail.com" }, 11 | { "name": "Felipe Gasper", "email": "felipe@cpanel.net" }, 12 | { "name": "Evan Goer", "email": "evan@goer.org" }, 13 | { "name": "Alberto Gragera", "email": "albgra@gmail.com" }, 14 | { "name": "Pat Cavit", "email": "pcavit@gmail.com" }, 15 | { "name": "Kazuhito Hokamura", "email": "k.hokamura@gmail.com" }, 16 | { "name": "prodaea", "email": "rlee@etherealnation.net" }, 17 | { "name": "Wei Wang", "email": "weiwang85@gmail.com" }, 18 | { "name": "Thomas Boyt", "email": "me@thomasboyt.com" } 19 | ], 20 | "engines": { 21 | "node" : ">=0.4.0" 22 | }, 23 | "keywords": [ 24 | "yui", 25 | "jsdoc", 26 | "coffeescript", 27 | "api", 28 | "documentation", 29 | "javadoc", 30 | "docs", 31 | "apidocs" 32 | ], 33 | "main": "./lib/index", 34 | "bin" : { "yuidoc" : "./lib/cli.js" }, 35 | "dependencies": { 36 | "yui": "3.14.1", 37 | "rimraf": "2.x", 38 | "marked": "~0.2.8", 39 | "minimatch": "~0.2.11", 40 | "graceful-fs": "2.x", 41 | "express": "~3.1.2" 42 | }, 43 | "devDependencies": { 44 | "jshint": "2.4.x", 45 | "ytestrunner": "~0.3.3", 46 | "yuitest": ">=0.7.3", 47 | "selleck": "~0.1", 48 | "istanbul": "0.2.x" 49 | }, 50 | "scripts": { 51 | "pretest": "jshint ./lib/*.js ./tests/*.js", 52 | "test": "istanbul cover --print=both --yui ytestrunner -- --include ./tests/options.js --include ./tests/builder.js --include ./tests/parser.js --include ./tests/parser_coffee.js --include ./tests/files.js" 53 | }, 54 | "preferGlobal": "true", 55 | "licenses":[ 56 | { 57 | "type" : "BSD", 58 | "url" : "https://github.com/yui/yuidoc/blob/master/LICENSE" 59 | } 60 | ], 61 | "repository": { 62 | "type":"git", 63 | "url":"http://github.com/yui/yuidoc.git" 64 | }, 65 | "jshintConfig": { 66 | "bitwise" : true, 67 | "browser" : true, 68 | "curly" : true, 69 | "eqeqeq" : true, 70 | "forin" : true, 71 | "immed" : true, 72 | "latedef" : "nofunc", 73 | "laxbreak" : true, 74 | "maxerr" : 500, 75 | "maxlen" : 150, 76 | "newcap" : true, 77 | "noarg" : true, 78 | "node" : true, 79 | "noempty" : true, 80 | "onevar" : true, 81 | "trailing" : true, 82 | "undef" : true, 83 | "unused" : "vars", 84 | "yui" : true 85 | }, 86 | "yuidoc": { 87 | "name": "YUIDoc", 88 | "logo": "http://yuilibrary.com/img/yui-logo.png", 89 | "options": { 90 | "external": { 91 | "data": "http://yuilibrary.com/yui/docs/api/data.json" 92 | }, 93 | "linkNatives": "true", 94 | "attributesEmit": "true", 95 | "paths": [ 96 | "./lib" 97 | ], 98 | "outdir": "./output/api" 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /tests/input/charts/LineSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The LineSeries class renders quantitative data on a graph by connecting relevant data points. 3 | * 4 | * @module charts 5 | * @class LineSeries 6 | * @extends CartesianSeries 7 | * @uses Lines 8 | * @constructor 9 | */ 10 | Y.LineSeries = Y.Base.create("lineSeries", Y.CartesianSeries, [Y.Lines], { 11 | /** 12 | * @protected 13 | * 14 | * @method drawSeries 15 | */ 16 | drawSeries: function() 17 | { 18 | this.drawLines(); 19 | }, 20 | 21 | /** 22 | * @protected 23 | * 24 | * Method used by `styles` setter. Overrides base implementation. 25 | * 26 | * @method _setStyles 27 | * @param {Object} newStyles Hash of properties to update. 28 | * @return Object 29 | */ 30 | _setStyles: function(val) 31 | { 32 | if(!val.line) 33 | { 34 | val = {line:val}; 35 | } 36 | return Y.LineSeries.superclass._setStyles.apply(this, [val]); 37 | }, 38 | 39 | /** 40 | * @protected 41 | * 42 | * Gets the default value for the `styles` attribute. Overrides 43 | * base implementation. 44 | * 45 | * @method _getDefaultStyles 46 | * @return Object 47 | */ 48 | _getDefaultStyles: function() 49 | { 50 | var styles = this._mergeStyles({line:this._getLineDefaults()}, Y.LineSeries.superclass._getDefaultStyles()); 51 | return styles; 52 | } 53 | }, 54 | { 55 | ATTRS: { 56 | /** 57 | * Read-only attribute indicating the type of series. 58 | * 59 | * @attribute type 60 | * @type String 61 | * @default line 62 | */ 63 | type: { 64 | value:"line" 65 | } 66 | 67 | /** 68 | * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values: 69 | *
    70 | *
    color
    The color of the line. The default value is determined by the order of the series on the graph. The color will be 71 | * retrieved from the following array: 72 | * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]` 73 | *
    weight
    Number that indicates the width of the line. The default value is 6.
    74 | *
    alpha
    Number between 0 and 1 that indicates the opacity of the line. The default value is 1.
    75 | *
    lineType
    Indicates whether the line is solid or dashed. The default value is solid.
    76 | *
    dashLength
    When the `lineType` is dashed, indicates the length of the dash. The default value is 10.
    77 | *
    gapSpace
    When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.
    78 | *
    connectDiscontinuousPoints
    Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.
    79 | *
    discontinuousType
    Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.
    80 | *
    discontinuousDashLength
    When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.
    81 | *
    discontinuousGapSpace
    When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.
    82 | *
    83 | * 84 | * @attribute styles 85 | * @type Object 86 | */ 87 | } 88 | }); 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /tests/input/charts/CurveUtil.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility class used for calculating curve points. 3 | * 4 | * @module charts 5 | * @class CurveUtil 6 | * @constructor 7 | */ 8 | function CurveUtil() 9 | { 10 | } 11 | 12 | CurveUtil.prototype = { 13 | /** 14 | * Creates an array of start, end and control points for splines. 15 | * 16 | * @method getCurveControlPoints 17 | * @param {Array} xcoords Collection of x-coordinates used for calculate the curves 18 | * @param {Array} ycoords Collection of y-coordinates used for calculate the curves 19 | * @return Object 20 | * @protected 21 | */ 22 | getCurveControlPoints: function(xcoords, ycoords) 23 | { 24 | var outpoints = [], 25 | i = 1, 26 | l = xcoords.length - 1, 27 | xvals = [], 28 | yvals = []; 29 | 30 | 31 | // Too few points, need at least two 32 | if (l < 1) 33 | { 34 | return null; 35 | } 36 | 37 | outpoints[0] = { 38 | startx: xcoords[0], 39 | starty: ycoords[0], 40 | endx: xcoords[1], 41 | endy: ycoords[1] 42 | }; 43 | 44 | // Special case, the Bezier should be a straight line 45 | if (l === 1) 46 | { 47 | outpoints[0].ctrlx1 = (2.0*xcoords[0] + xcoords[1])/3.0; 48 | outpoints[0].ctrly2 = (2.0*ycoords[0] + ycoords[1])/3.0; 49 | outpoints[0].ctrlx2 = 2.0*outpoints[0].ctrlx1 - xcoords[0]; 50 | outpoints[0].ctrly2 = 2.0*outpoints[0].ctrly1 - ycoords[0]; 51 | return outpoints; 52 | } 53 | 54 | for (; i < l; ++i) 55 | { 56 | outpoints.push({startx: Math.round(xcoords[i]), starty: Math.round(ycoords[i]), endx: Math.round(xcoords[i+1]), endy: Math.round(ycoords[i+1])}); 57 | xvals[i] = 4.0 * xcoords[i] + 2*xcoords[i+1]; 58 | yvals[i] = 4.0*ycoords[i] + 2*ycoords[i+1]; 59 | } 60 | 61 | xvals[0] = xcoords[0] + (2.0 * xcoords[1]); 62 | xvals[l-1] = (8.0 * xcoords[l-1] + xcoords[l]) / 2.0; 63 | xvals = this.getControlPoints(xvals.concat()); 64 | yvals[0] = ycoords[0] + (2.0 * ycoords[1]); 65 | yvals[l-1] = (8.0 * ycoords[l-1] + ycoords[l]) / 2.0; 66 | yvals = this.getControlPoints(yvals.concat()); 67 | 68 | for (i = 0; i < l; ++i) 69 | { 70 | outpoints[i].ctrlx1 = Math.round(xvals[i]); 71 | outpoints[i].ctrly1 = Math.round(yvals[i]); 72 | 73 | if (i < l-1) 74 | { 75 | outpoints[i].ctrlx2 = Math.round(2*xcoords[i+1] - xvals[i+1]); 76 | outpoints[i].ctrly2 = Math.round(2*ycoords[i+1] - yvals[i+1]); 77 | } 78 | else 79 | { 80 | outpoints[i].ctrlx2 = Math.round((xcoords[l] + xvals[l-1])/2); 81 | outpoints[i].ctrly2 = Math.round((ycoords[l] + yvals[l-1])/2); 82 | } 83 | } 84 | 85 | return outpoints; 86 | }, 87 | 88 | /** 89 | * Gets the control points for the curve. 90 | * 91 | * @method getControlPoints 92 | * @param {Array} vals Collection of values coords used to generate control points. 93 | * @return Array 94 | * @private 95 | */ 96 | getControlPoints: function(vals) 97 | { 98 | var l = vals.length, 99 | x = [], 100 | tmp = [], 101 | b = 2.0, 102 | i = 1; 103 | x[0] = vals[0] / b; 104 | for (; i < l; ++i) 105 | { 106 | tmp[i] = 1/b; 107 | b = (i < l-1 ? 4.0 : 3.5) - tmp[i]; 108 | x[i] = (vals[i] - x[i-1]) / b; 109 | } 110 | 111 | for (i = 1; i < l; ++i) 112 | { 113 | x[l-i-1] -= tmp[l-i] * x[l-i]; 114 | } 115 | 116 | return x; 117 | } 118 | }; 119 | Y.CurveUtil = CurveUtil; 120 | -------------------------------------------------------------------------------- /lib/help.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Yahoo! Inc. All rights reserved. 3 | Code licensed under the BSD License: 4 | http://yuilibrary.com/license/ 5 | */ 6 | YUI.add('help', function (Y) { 7 | 8 | /** 9 | * Shows the help text 10 | * @module yuidoc 11 | * @class Help 12 | */ 13 | 14 | /** 15 | * The help text to display 16 | * @private 17 | * @property help 18 | * @type Array 19 | */ 20 | var help = [ 21 | "", 22 | "YUI Doc generates API documentation from a modified JavaDoc syntax.", 23 | "", 24 | "Current version ({VERSION})", 25 | "", 26 | "Usage: yuidoc ", 27 | "", 28 | "Common Options:", 29 | " -c, --config, --configfile A JSON config file to provide configuration data.", 30 | " You can also create a yuidoc.json file and place it", 31 | " anywhere under your source tree and YUI Doc will find it", 32 | " and use it.", 33 | " -e, --extension The list of file extensions to parse ", 34 | " for api documentation. (defaults to .js)", 35 | " -x, --exclude Directories to exclude from parsing ", 36 | " (defaults to '.DS_Store,.svn,CVS,.git,build_rollup_tmp,build_tmp')", 37 | " -v, --version Show the current YUIDoc version", 38 | " --project-version Set the doc version for the template", 39 | " -N, --no-color Turn off terminal colors (for automation)", 40 | " -C, --no-code Turn off code generation (don't include source files in output)", 41 | " -n, --norecurse Do not recurse directories (default is to recurse)", 42 | " -S, --selleck Look for Selleck component data and attach to API meta data", 43 | " -V, --view Dump the Handlebars.js view data instead of writing template files", 44 | " -p, --parse-only Only parse the API docs and create the JSON data, do not render templates", 45 | " -o, --outdir Path to put the generated files (defaults to ./out)", 46 | " -t, --themedir Path to a custom theme directory containing Handlebars templates", 47 | " -H, --helpers Require these file and add Handlebars helpers. See docs for more information", 48 | " --charset CHARSET Use this as the default charset for all file operations. Defaults to 'utf8'", 49 | " -h, --help Show this help", 50 | " -q, --quiet Supress logging output", 51 | " -T, --theme Choose one of the built in themes (default is default)", 52 | " --syntaxtype Choose comment syntax type (default is js)", 53 | " --server Fire up the YUIDoc server for faster API doc developement. Pass optional port to listen on. (default is 3000)", 54 | " --lint Lint your docs, will print parser warnings and exit code 1 if there are any", 55 | "", 56 | " Supply a list of paths (shell globbing is handy here)", 57 | "", 58 | ].join('\n'); 59 | 60 | /** 61 | * Render the help message as a string 62 | * @method renderHelp 63 | * @return {String} The help screen to display 64 | */ 65 | Y.renderHelp = function () { 66 | return Y.Lang.sub(help, { 67 | VERSION: Y.packageInfo.version 68 | }); 69 | }; 70 | /** 71 | * Display the help message, write it to the screen and exit 72 | * @method showHelp 73 | */ 74 | Y.showHelp = function () { 75 | console.error(Y.renderHelp()); 76 | process.exit(0); //Shouldn't exit one on help 77 | }; 78 | }); 79 | -------------------------------------------------------------------------------- /tests/input/test2/dump/dump.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a simple string representation of the object or array. 3 | * Other types of objects will be returned unprocessed. Arrays 4 | * are expected to be indexed. Use object notation for 5 | * associative arrays. 6 | * 7 | * If included, the dump method is added to the YUI instance. 8 | * 9 | * @module dump 10 | */ 11 | 12 | var L = Y.Lang, 13 | OBJ = '{...}', 14 | FUN = 'f(){...}', 15 | COMMA = ', ', 16 | ARROW = ' => ', 17 | 18 | /** 19 | * The following methods are added to the YUI instance 20 | * @class YUI~dump 21 | */ 22 | 23 | /** 24 | * Returns a simple string representation of the object or array. 25 | * Other types of objects will be returned unprocessed. Arrays 26 | * are expected to be indexed. Use object notation for 27 | * associative arrays. 28 | * 29 | * This method is in the 'dump' module, which is not bundled with 30 | * the core YUI object 31 | * 32 | * @method dump 33 | * @param {object} o The object to dump. 34 | * @param {int} d How deep to recurse child objects, default 3. 35 | * @return {string} the dump result. 36 | */ 37 | dump = function(o, d) { 38 | var i, len, s = [], type = L.type(o); 39 | 40 | // Cast non-objects to string 41 | // Skip dates because the std toString is what we want 42 | // Skip HTMLElement-like objects because trying to dump 43 | // an element will cause an unhandled exception in FF 2.x 44 | if (!L.isObject(o)) { 45 | return o + ''; 46 | } else if (type == 'date') { 47 | return o; 48 | } else if (o.nodeType && o.tagName) { 49 | return o.tagName + '#' + o.id; 50 | } else if (o.document && o.navigator) { 51 | return 'window'; 52 | } else if (o.location && o.body) { 53 | return 'document'; 54 | } else if (type == 'function') { 55 | return FUN; 56 | } 57 | 58 | // dig into child objects the depth specifed. Default 3 59 | d = (L.isNumber(d)) ? d : 3; 60 | 61 | // arrays [1, 2, 3] 62 | if (type == 'array') { 63 | s.push('['); 64 | for (i = 0, len = o.length; i < len; i = i + 1) { 65 | if (L.isObject(o[i])) { 66 | s.push((d > 0) ? L.dump(o[i], d - 1) : OBJ); 67 | } else { 68 | s.push(o[i]); 69 | } 70 | s.push(COMMA); 71 | } 72 | if (s.length > 1) { 73 | s.pop(); 74 | } 75 | s.push(']'); 76 | // regexp /foo/ 77 | } else if (type == 'regexp') { 78 | s.push(o.toString()); 79 | // objects {k1 => v1, k2 => v2} 80 | } else { 81 | s.push('{'); 82 | for (i in o) { 83 | if (o.hasOwnProperty(i)) { 84 | try { 85 | s.push(i + ARROW); 86 | if (L.isObject(o[i])) { 87 | s.push((d > 0) ? L.dump(o[i], d - 1) : OBJ); 88 | } else { 89 | s.push(o[i]); 90 | } 91 | s.push(COMMA); 92 | } catch (e) { 93 | s.push('Error: ' + e.message); 94 | } 95 | } 96 | } 97 | if (s.length > 1) { 98 | s.pop(); 99 | } 100 | s.push('}'); 101 | } 102 | 103 | return s.join(''); 104 | }; 105 | 106 | Y.dump = dump; 107 | L.dump = dump; 108 | 109 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Yahoo! Inc. All rights reserved. 3 | Code licensed under the BSD License: 4 | http://yuilibrary.com/license/ 5 | */ 6 | /*global YUI:true, Y:true */ 7 | /** 8 | Module creates the YUI instance with the required modules, uses them and exports the **Y** to be used 9 | by the _CLI class_ or by extenders: `require('yuidocjs');` 10 | You can use it like this: 11 | 12 | var options = { 13 | paths: [ './lib' ], 14 | outdir: './out' 15 | }; 16 | 17 | var Y = require('yuidocjs'); 18 | var json = (new Y.YUIDoc(options)).run(); 19 | 20 | @class Main 21 | @exports {YUI} Y A YUI instance 22 | @module yuidoc 23 | */ 24 | //Hacking in debug support 25 | var args = process.argv.slice(2); 26 | var debug = false; 27 | 28 | args.forEach(function (item) { 29 | if (item.toLowerCase() === '--debug') { 30 | debug = true; 31 | } 32 | }); 33 | 34 | var YUI = require('yui' + (debug ? '/debug' : '')).YUI, 35 | path = require('path'), 36 | fs = require('graceful-fs'), 37 | metaPath = path.join(__dirname, '../', 'package.json'); 38 | 39 | 40 | process.on('uncaughtException', function (msg) { 41 | var meta = JSON.parse(fs.readFileSync(metaPath)), 42 | inst = YUI(), 43 | useColor = (Y ? Y.config.useColor : false); 44 | 45 | inst.applyConfig({ 46 | debug: true, 47 | useColor: useColor 48 | }); 49 | 50 | inst.log('--------------------------------------------------------------------------', 'error'); 51 | inst.log('An uncaught YUIDoc error has occurred, stack trace given below', 'error'); 52 | inst.log('--------------------------------------------------------------------------', 'error'); 53 | inst.log(msg.stack || msg.message || msg, 'error'); 54 | inst.log('--------------------------------------------------------------------------', 'error'); 55 | inst.log('Node.js version: ' + process.version, 'error'); 56 | inst.log('YUI version: ' + YUI.version, 'error'); 57 | inst.log('YUIDoc version: ' + meta.version, 'error'); 58 | inst.log('Please file all tickets here: ' + meta.bugs.url, 'error'); 59 | inst.log('--------------------------------------------------------------------------', 'error'); 60 | 61 | process.exit(1); 62 | }); 63 | 64 | var Y = YUI({ 65 | modules: { 66 | help: { 67 | fullpath: path.join(__dirname, 'help.js') 68 | }, 69 | options: { 70 | fullpath: path.join(__dirname, 'options.js') 71 | }, 72 | docparser: { 73 | fullpath: path.join(__dirname, 'docparser.js'), 74 | requires: ['base-base', 'json-stringify'] 75 | }, 76 | yuidoc: { 77 | fullpath: path.join(__dirname, 'yuidoc.js') 78 | }, 79 | 'doc-builder': { 80 | fullpath: path.join(__dirname, 'builder.js'), 81 | requires: ['parallel', 'handlebars'] 82 | }, 83 | utils: { 84 | fullpath: path.join(__dirname, 'utils.js') 85 | }, 86 | files: { 87 | fullpath: path.join(__dirname, 'files.js') 88 | }, 89 | docview: { 90 | fullpath: path.join(__dirname, 'docview.js') 91 | }, 92 | server: { 93 | fullpath: path.join(__dirname, 'server.js') 94 | }, 95 | project: { 96 | fullpath: path.join(__dirname, 'project.js') 97 | } 98 | }, 99 | logExclude: { 100 | attribute: true, 101 | handlebars: true 102 | }, 103 | useSync: true 104 | }).use('utils', 'docparser', 'yuidoc', 'doc-builder', 'docview', 'files', 'help', 'options', 'server', 'project'); 105 | 106 | Y.packageInfo = Y.Files.getJSON(metaPath); 107 | 108 | module.exports = Y; 109 | -------------------------------------------------------------------------------- /tests/input/inherit/examplemodule.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is my example module 3 | * @module ExampleModule 4 | * @example 5 | * 6 | * var bar; 7 | * 8 | */ 9 | 10 | YUI.add('examplemodule', function (Y) { 11 | Y.namespace('mywidget'); 12 | 13 | /** 14 | * Superclass description.
    This is a second line too. 15 | * 16 | * @constructor 17 | * @class SuperWidget 18 | * @extends Widget 19 | * @namespace mywidget 20 | * @example 21 | * 22 | * var bar; 23 | * 24 | */ 25 | Y.mywidget.superwidget = Y.Base.create("mysuperwidget", Y.Widget, [], { 26 | 27 | /** 28 | * Supermethod description.
    This is a second line. 29 | * 30 | * @method myMethod 31 | * @async 32 | */ 33 | myMethod: function () {} 34 | 35 | /** 36 | * Overwritten method see {{#crossLink "mywidget.SuperWidget"}}{{/crossLink}} 37 | * also see {{#crossLink "mywidget.SuperWidget/myMethod"}}{{/crossLink}} 38 | * This is also a test {{#davglass "Foo"}}{{/davglass}} 39 | * @method getTargets2 40 | * @example 41 | * 42 | * var bar; 43 | * 44 | */ 45 | 46 | /** 47 | * Overwritten method see {{#crossLink "mywidget.SuperWidget"}}{{/crossLink}} 48 | * also see {{#crossLink "mywidget.SuperWidget/myMethod"}}{{/crossLink}} 49 | * This is also a test {{#davglass "Foo"}}{{/davglass}} 50 | * 51 | * ```javascript 52 | * 53 | * var test = "hello from a code block!"; 54 | * 55 | * ``` 56 | * 57 | * @method getTargets3 58 | * @example 59 | * 60 | * var bar; 61 | * 62 | */ 63 | 64 | /** 65 | * Override Attribute 66 | * @attribute focused2 67 | * @optional 68 | */ 69 | 70 | /** 71 | * Override Attribute 72 | * @attribute focused3 73 | * @required 74 | */ 75 | 76 | /** 77 | * Override Property 78 | * @property name2 79 | * @type String 80 | */ 81 | 82 | /** 83 | * Override Event 84 | * @event init2 85 | */ 86 | 87 | }, { 88 | 89 | }); 90 | 91 | /** 92 | * Subclass description. 93 | * 94 | * @constructor 95 | * @namespace mywidget 96 | * @class SubWidget 97 | * @extends mywidget.SuperWidget 98 | */ 99 | Y.mywidget.superwidget = Y.Base.create("mysuperwidget", Y.mywidget.superwidget, [], { 100 | 101 | /** 102 | * Submethod description. 103 | * 104 | * @method myMethod 105 | * @param {boolean} d Foo 106 | */ 107 | myMethod: function () {} 108 | 109 | }, { 110 | 111 | }); 112 | 113 | /** 114 | * Subclass description. 115 | * 116 | * @constructor 117 | * @namespace mywidget 118 | * @class SubWidget2 119 | * @extends Accordion 120 | */ 121 | }); 122 | -------------------------------------------------------------------------------- /docs/themes/index.mustache: -------------------------------------------------------------------------------- 1 |

    2 | YUIDoc uses Handlebars.js to render its templates. 3 | For easy customization, YUIDoc's default templates provide a specific set of file overrides. 4 |

    5 | 6 |

    Directories

    7 | 8 |

    9 | The default theme consists of `assets/`, `layouts/` and `partials/` directories, 10 | along with a `theme.json` file that describes theme-related variables, 11 | such as the JS and CSS to load. 12 |

    13 | 14 | ```terminal 15 | 16 | themes/ 17 | default/ 18 | assets/ //Project assets, css, js 19 | layouts/ 20 | *.handlebars //Handlebars files for layouts 21 | partials/ 22 | *.handlebars //Handlebars files for partials 23 | theme.json //JSON file with theme variables 24 | ``` 25 | 26 |

    Layouts

    27 | 28 |

    29 | A YUIDoc template has two primary layout files: `main.handlebars` and `xhr.handlebars`. 30 |

    31 | 32 | 33 | 34 | 35 | 40 | 41 | 42 | 43 | 48 | 49 |
    `main` 36 | Provides a complete wrapper around every rendered page. 37 | `main.handlebars` includes the full HTML header and footer markup, CSS, and JS 38 | for every YUIDoc API page. 39 |
    `xhr` 44 | Provides a smaller layout for the built-in doc server to use when requesting an individual page via XHR. 45 | This enables the browser to refresh just the content pane and avoid loading the complete markup for the entire page. 46 | The `xhr` template enables YUIDoc to progressively enhance the API documentation in an efficient manner. 47 |
    50 | 51 |

    Partials

    52 | 53 |

    54 | For each section of the layout that derives from parsed YUIDoc comment data, 55 | YUIDoc provides a Handlebars partial. 56 |

    57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 |
    `index`Renders the main index content.
    `sidebar`Renders the tabview containing the lists of classes and modules.
    `options`Renders the filter options at the top of the page, which enable the user to hide and show private methods, inherited methods, and so on.
    `attrs`Renders documentation for an individual YUI Attribute.
    `classes`Renders documentation for an individual class.
    `events`Renders documentation for an individual event.
    `files`Renders the API's source files.
    `method`Renders documentation for an individual method.
    `module`Renders documentation for an individual module.
    `props`Renders documentation for an individual property.
    100 | 101 | 102 |

    Overriding a Partial/Layout

    103 | 104 |

    105 | YUIDoc's `--themedir` option specifies a directory containing 106 | layouts and partials that override the default theme. For example: 107 |

    108 | 109 | ```terminal 110 | $ yuidoc --themedir ./mytheme 111 | ``` 112 | 113 |

    114 | causes YUIDoc to inspect the directory `./mytheme` for template overrides. 115 | If this directory contains an override such as `./mytheme/partials/method.handlebars`, 116 | YUI will parse its internal templates first, then apply the custom `method.handlebars` partial. 117 | If a theme has no explicit override for a given template file, 118 | YUIDoc simply falls back to using the default layout or partial. 119 |

    120 | -------------------------------------------------------------------------------- /tests/input/charts/MarkerSeries.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The MarkerSeries class renders quantitative data by plotting relevant data points 3 | * on a graph. 4 | * 5 | * @module charts 6 | * @class MarkerSeries 7 | * @extends CartesianSeries 8 | * @uses Plots 9 | * @constructor 10 | */ 11 | Y.MarkerSeries = Y.Base.create("markerSeries", Y.CartesianSeries, [Y.Plots], { 12 | /** 13 | * @protected 14 | * 15 | * Draws the series. 16 | * 17 | * @method drawSeries 18 | */ 19 | drawSeries: function() 20 | { 21 | this.drawPlots(); 22 | }, 23 | 24 | /** 25 | * @protected 26 | * 27 | * Method used by `styles` setter. Overrides base implementation. 28 | * 29 | * @method _setStyles 30 | * @param {Object} newStyles Hash of properties to update. 31 | * @return Object 32 | */ 33 | _setStyles: function(val) 34 | { 35 | if(!val.marker) 36 | { 37 | val = {marker:val}; 38 | } 39 | val = this._parseMarkerStyles(val); 40 | return Y.MarkerSeries.superclass._mergeStyles.apply(this, [val, this._getDefaultStyles()]); 41 | }, 42 | 43 | /** 44 | * @protected 45 | * 46 | * Gets the default value for the `styles` attribute. Overrides 47 | * base implementation. 48 | * 49 | * @method _getDefaultStyles 50 | * @return Object 51 | */ 52 | _getDefaultStyles: function() 53 | { 54 | var styles = this._mergeStyles({marker:this._getPlotDefaults()}, Y.MarkerSeries.superclass._getDefaultStyles()); 55 | return styles; 56 | } 57 | },{ 58 | ATTRS : { 59 | /** 60 | * Read-only attribute indicating the type of series. 61 | * 62 | * @attribute type 63 | * @type String 64 | * @default marker 65 | */ 66 | type: { 67 | value:"marker" 68 | } 69 | 70 | /** 71 | * Style properties used for drawing markers. This attribute is inherited from `Renderer`. Below are the default values: 72 | *
    73 | *
    fill
    A hash containing the following values: 74 | *
    75 | *
    color
    Color of the fill. The default value is determined by the order of the series on the graph. The color 76 | * will be retrieved from the below array:
    77 | * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]` 78 | *
    79 | *
    alpha
    Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.
    80 | *
    81 | *
    82 | *
    border
    A hash containing the following values: 83 | *
    84 | *
    color
    Color of the border. The default value is determined by the order of the series on the graph. The color 85 | * will be retrieved from the below array:
    86 | * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]` 87 | *
    alpha
    Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.
    88 | *
    weight
    Number indicating the width of the border. The default value is 1.
    89 | *
    90 | *
    91 | *
    width
    indicates the width of the marker. The default value is 10.
    92 | *
    height
    indicates the height of the marker The default value is 10.
    93 | *
    over
    hash containing styles for markers when highlighted by a `mouseover` event. The default 94 | * values for each style is null. When an over style is not set, the non-over value will be used. For example, 95 | * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.
    96 | *
    97 | * 98 | * @attribute styles 99 | * @type Object 100 | */ 101 | } 102 | }); 103 | 104 | -------------------------------------------------------------------------------- /themes/default/partials/props.handlebars: -------------------------------------------------------------------------------- 1 |
    2 |

    {{name}}

    3 | {{#crossLink type}}{{/crossLink}} 4 | 5 | {{#if deprecated}} 6 | deprecated 7 | {{/if}} 8 | 9 | {{#if access}} 10 | {{access}} 11 | {{/if}} 12 | 13 | {{#if final}} 14 | final 15 | {{/if}} 16 | 17 | {{#if static}} 18 | static 19 | {{/if}} 20 | 21 |
    22 | {{#if overwritten_from}} 23 |

    Inherited from 24 | 25 | {{overwritten_from/class}} 26 | 27 | {{#if foundAt}} 28 | but overwritten in 29 | {{/if}} 30 | {{else}} 31 | {{#if extended_from}} 32 |

    Inherited from 33 | {{extended_from}}: 34 | {{else}} 35 | {{#providedBy}} 36 |

    Provided by the {{.}} module.

    37 | {{/providedBy}} 38 |

    39 | {{#if foundAt}} 40 | Defined in 41 | {{/if}} 42 | {{/if}} 43 | {{/if}} 44 | {{#if foundAt}} 45 | `{{{file}}}:{{{line}}}` 46 | {{/if}} 47 |

    48 | 49 | {{#if deprecationMessage}} 50 |

    Deprecated: {{deprecationMessage}}

    51 | {{/if}} 52 | 53 | {{#if since}} 54 |

    Available since {{since}}

    55 | {{/if}} 56 |
    57 | 58 |
    59 | {{{propertyDescription}}} 60 |
    61 | 62 | {{#if default}} 63 |

    Default: {{default}}

    64 | {{/if}} 65 | 66 | {{#example}} 67 |
    68 |

    Example:

    69 | 70 |
    71 | {{{.}}} 72 |
    73 |
    74 | {{/example}} 75 | 76 | {{#if subprops}} 77 |

    Sub-properties:

    78 | 79 |
      80 | {{#subprops}} 81 |
    • 82 | {{#if optional}} 83 | [{{name}}{{#if optdefault}}={{optdefault}}{{/if}}] 84 | {{#crossLink type}}{{/crossLink}} 85 | optional 86 | {{else}} 87 | {{name}} 88 | {{#crossLink type}}{{/crossLink}} 89 | {{/if}} 90 | 91 |
      92 | {{{description}}} 93 |
      94 | 95 | {{#if subprops}} 96 |
        97 | {{#subprops}} 98 |
      • 99 | {{#if optional}} 100 | [{{name}}{{#if optdefault}}={{optdefault}}{{/if}}] 101 | {{#crossLink type}}{{/crossLink}} 102 | optional 103 | {{else}} 104 | {{name}} 105 | {{#crossLink type}}{{/crossLink}} 106 | {{/if}} 107 | 108 |
        109 | {{{description}}} 110 |
        111 |
      • 112 | {{/subprops}} 113 |
      114 | {{/if}} 115 |
    • 116 | {{/subprops}} 117 |
    118 | {{/if}} 119 |
    120 | -------------------------------------------------------------------------------- /tests/input/charts/PieChartLegend.js: -------------------------------------------------------------------------------- 1 | var PieChartLegend = Y.Base.create("pieChartLegend", Y.PieChart, [], { 2 | /** 3 | * Redraws the chart instance. 4 | * 5 | * @method _redraw 6 | * @private 7 | */ 8 | _redraw: function() 9 | { 10 | if(this._drawing) 11 | { 12 | this._callLater = true; 13 | return; 14 | } 15 | this._drawing = true; 16 | this._callLater = false; 17 | var graph = this.get("graph"), 18 | w = this.get("width"), 19 | h = this.get("height"), 20 | graphWidth, 21 | graphHeight, 22 | legend = this.get("legend"), 23 | x = 0, 24 | y = 0, 25 | legendX = 0, 26 | legendY = 0, 27 | legendWidth, 28 | legendHeight, 29 | dimension, 30 | gap, 31 | position, 32 | direction; 33 | if(graph) 34 | { 35 | if(legend) 36 | { 37 | position = legend.get("position"); 38 | direction = legend.get("direction"); 39 | graphWidth = graph.get("width"); 40 | graphHeight = graph.get("height"); 41 | legendWidth = legend.get("width"); 42 | legendHeight = legend.get("height"); 43 | gap = legend.get("styles").gap; 44 | 45 | if((direction == "vertical" && (graphWidth + legendWidth + gap !== w)) || (direction == "horizontal" && (graphHeight + legendHeight + gap !== h))) 46 | { 47 | switch(legend.get("position")) 48 | { 49 | case LEFT : 50 | dimension = Math.min(w - (legendWidth + gap), h); 51 | legendHeight = h; 52 | x = legendWidth + gap; 53 | legend.set(HEIGHT, legendHeight); 54 | break; 55 | case TOP : 56 | dimension = Math.min(h - (legendHeight + gap), w); 57 | legendWidth = w; 58 | y = legendHeight + gap; 59 | legend.set(WIDTH, legendWidth); 60 | break; 61 | case RIGHT : 62 | dimension = Math.min(w - (legendWidth + gap), h); 63 | legendHeight = h; 64 | legendX = dimension + gap; 65 | legend.set(HEIGHT, legendHeight); 66 | break; 67 | case BOTTOM : 68 | dimension = Math.min(h - (legendHeight + gap), w); 69 | legendWidth = w; 70 | legendY = dimension + gap; 71 | legend.set(WIDTH, legendWidth); 72 | break; 73 | } 74 | graph.set(WIDTH, dimension); 75 | graph.set(HEIGHT, dimension); 76 | } 77 | else 78 | { 79 | switch(legend.get("position")) 80 | { 81 | case LEFT : 82 | x = legendWidth + gap; 83 | break; 84 | case TOP : 85 | y = legendHeight + gap; 86 | break; 87 | case RIGHT : 88 | legendX = graphWidth + gap; 89 | break; 90 | case BOTTOM : 91 | legendY = graphHeight + gap; 92 | break; 93 | } 94 | } 95 | } 96 | else 97 | { 98 | graph.set(_X, 0); 99 | graph.set(_Y, 0); 100 | graph.set(WIDTH, w); 101 | graph.set(HEIGHT, h); 102 | } 103 | } 104 | this._drawing = false; 105 | if(this._callLater) 106 | { 107 | this._redraw(); 108 | return; 109 | } 110 | if(graph) 111 | { 112 | graph.set(_X, x); 113 | graph.set(_Y, y); 114 | } 115 | if(legend) 116 | { 117 | legend.set(_X, legendX); 118 | legend.set(_Y, legendY); 119 | } 120 | } 121 | }, { 122 | ATTRS: { 123 | /** 124 | * The legend for the chart. 125 | * 126 | * @attribute 127 | * @type Legend 128 | */ 129 | legend: LEGEND 130 | } 131 | }); 132 | Y.PieChart = PieChartLegend; 133 | -------------------------------------------------------------------------------- /conf/docs/layouts/main.mustache: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{htmlTitle}} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Fork me on GitHub 15 |
    16 |
    17 |

    {{title}}

    18 |
    19 | {{#if description}} 20 |
    21 | Main Page > {{title}} 22 |
    23 | {{/if}} 24 | {{^hideTableOfContents}} 25 | Jump to Table of Contents 26 | {{/hideTableOfContents}} 27 | 28 |
    29 |
    30 |
    31 |
    {{>layout_content}}
    32 |
    33 |
    34 | 35 |
    36 | 104 |
    105 |
    106 |
    107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /tests/input/charts/Gridlines.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Gridlines draws gridlines on a Graph. 3 | * 4 | * @module charts 5 | * @class Gridlines 6 | * @constructor 7 | * @extends Base 8 | * @uses Renderer 9 | */ 10 | Y.Gridlines = Y.Base.create("gridlines", Y.Base, [Y.Renderer], { 11 | /** 12 | * Reference to the `Path` element used for drawing Gridlines. 13 | * 14 | * @property _path 15 | * @type Path 16 | * @private 17 | */ 18 | _path: null, 19 | 20 | /** 21 | * Removes the Gridlines. 22 | * 23 | * @method remove 24 | * @private 25 | */ 26 | remove: function() 27 | { 28 | var path = this._path; 29 | if(path) 30 | { 31 | path.destroy(); 32 | } 33 | }, 34 | 35 | /** 36 | * Draws the gridlines 37 | * 38 | * @method draw 39 | * @protected 40 | */ 41 | draw: function() 42 | { 43 | if(this.get("axis") && this.get("graph")) 44 | { 45 | this._drawGridlines(); 46 | } 47 | }, 48 | 49 | /** 50 | * Algorithm for drawing gridlines 51 | * 52 | * @method _drawGridlines 53 | * @private 54 | */ 55 | _drawGridlines: function() 56 | { 57 | var path, 58 | axis = this.get("axis"), 59 | axisPosition = axis.get("position"), 60 | points, 61 | i = 0, 62 | l, 63 | direction = this.get("direction"), 64 | graph = this.get("graph"), 65 | w = graph.get("width"), 66 | h = graph.get("height"), 67 | line = this.get("styles").line, 68 | color = line.color, 69 | weight = line.weight, 70 | alpha = line.alpha, 71 | lineFunction = direction == "vertical" ? this._verticalLine : this._horizontalLine; 72 | if(isFinite(w) && isFinite(h) && w > 0 && h > 0) 73 | { 74 | if(axisPosition != "none" && axis && axis.get("tickPoints")) 75 | { 76 | points = axis.get("tickPoints"); 77 | l = points.length; 78 | } 79 | else 80 | { 81 | points = []; 82 | l = axis.get("styles").majorUnit.count; 83 | for(; i < l; ++i) 84 | { 85 | points[i] = { 86 | x: w * (i/(l-1)), 87 | y: h * (i/(l-1)) 88 | }; 89 | } 90 | i = 0; 91 | } 92 | path = graph.get("gridlines"); 93 | path.set("width", w); 94 | path.set("height", h); 95 | path.set("stroke", { 96 | weight: weight, 97 | color: color, 98 | opacity: alpha 99 | }); 100 | for(; i < l; ++i) 101 | { 102 | lineFunction(path, points[i], w, h); 103 | } 104 | path.end(); 105 | } 106 | }, 107 | 108 | /** 109 | * Algorithm for horizontal lines. 110 | * 111 | * @method _horizontalLine 112 | * @param {Path} path Reference to path element 113 | * @param {Object} pt Coordinates corresponding to a major unit of an axis. 114 | * @param {Number} w Width of the Graph 115 | * @param {Number} h Height of the Graph 116 | * @private 117 | */ 118 | _horizontalLine: function(path, pt, w, h) 119 | { 120 | path.moveTo(0, pt.y); 121 | path.lineTo(w, pt.y); 122 | }, 123 | 124 | /** 125 | * Algorithm for vertical lines. 126 | * 127 | * @method _verticalLine 128 | * @param {Path} path Reference to path element 129 | * @param {Object} pt Coordinates corresponding to a major unit of an axis. 130 | * @param {Number} w Width of the Graph 131 | * @param {Number} h Height of the Graph 132 | * @private 133 | */ 134 | _verticalLine: function(path, pt, w, h) 135 | { 136 | path.moveTo(pt.x, 0); 137 | path.lineTo(pt.x, h); 138 | }, 139 | 140 | /** 141 | * Gets the default value for the `styles` attribute. Overrides 142 | * base implementation. 143 | * 144 | * @method _getDefaultStyles 145 | * @return Object 146 | * @protected 147 | */ 148 | _getDefaultStyles: function() 149 | { 150 | var defs = { 151 | line: { 152 | color:"#f0efe9", 153 | weight: 1, 154 | alpha: 1 155 | } 156 | }; 157 | return defs; 158 | } 159 | 160 | }, 161 | { 162 | ATTRS: { 163 | /** 164 | * Indicates the direction of the gridline. 165 | * 166 | * @attribute direction 167 | * @type String 168 | */ 169 | direction: {}, 170 | 171 | /** 172 | * Indicate the `Axis` in which to bind 173 | * the gridlines. 174 | * 175 | * @attribute axis 176 | * @type Axis 177 | */ 178 | axis: {}, 179 | 180 | /** 181 | * Indicates the `Graph` in which the gridlines 182 | * are drawn. 183 | * 184 | * @attribute graph 185 | * @type Graph 186 | */ 187 | graph: {} 188 | } 189 | }); 190 | -------------------------------------------------------------------------------- /output/api/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | yuidoc-root 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    15 |
    16 |
    17 | 18 |

    19 | 20 |
    21 |
    22 | API Docs for: 0.3.47 23 |
    24 |
    25 |
    26 | 27 |
    28 | 78 |
    79 |
    80 |
    81 | Show: 82 | 86 | 87 | 91 | 92 | 96 | 100 | 101 |
    102 | 103 | 104 |
    105 |
    106 |
    107 |
    108 |
    109 |

    110 | Browse to a module or class using the sidebar to view its API documentation. 111 |

    112 | 113 |

    Keyboard Shortcuts

    114 | 115 |
      116 |
    • Press s to focus the API search box.

    • 117 | 118 |
    • Use Up and Down to select classes, modules, and search results.

    • 119 | 120 |
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • 121 | 122 |
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • 123 |
    124 |
    125 |
    126 | 127 | 128 | 129 |
    130 |
    131 |
    132 |
    133 |
    134 |
    135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /tests/input/charts/ShapeGroup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The Charts widget provides an api for displaying data 3 | * graphically. 4 | * 5 | * @module charts 6 | * @main charts 7 | */ 8 | var CONFIG = Y.config, 9 | WINDOW = CONFIG.win, 10 | DOCUMENT = CONFIG.doc, 11 | Y_Lang = Y.Lang, 12 | IS_STRING = Y_Lang.isString, 13 | LeftAxisLayout, 14 | RightAxisLayout, 15 | BottomAxisLayout, 16 | TopAxisLayout, 17 | _getClassName = Y.ClassNameManager.getClassName, 18 | SERIES_MARKER = _getClassName("seriesmarker"), 19 | ShapeGroup, 20 | CircleGroup, 21 | RectGroup, 22 | EllipseGroup, 23 | DiamondGroup; 24 | 25 | /** 26 | * Abstract class for creating groups of shapes with the same styles and dimensions. 27 | * 28 | * @module graphics 29 | * @class ShapeGroup 30 | * @constructor 31 | */ 32 | ShapeGroup = function(cfg) 33 | { 34 | ShapeGroup.superclass.constructor.apply(this, arguments); 35 | }; 36 | 37 | ShapeGroup.NAME = "shapeGroup"; 38 | 39 | Y.extend(ShapeGroup, Y.Path, { 40 | /** 41 | * Updates the shape. 42 | * 43 | * @method _draw 44 | * @private 45 | */ 46 | _draw: function() 47 | { 48 | var xvalues = this.get("xvalues"), 49 | yvalues = this.get("yvalues"), 50 | x, 51 | y, 52 | xRad, 53 | yRad, 54 | i = 0, 55 | len, 56 | attrs = [], 57 | dimensions = this.get("dimensions"), 58 | width = dimensions.width, 59 | height = dimensions.height, 60 | radius = dimensions.radius, 61 | yRadius = dimensions.yRadius, 62 | id = this.get("id"), 63 | className = this.node.className, 64 | widthIsArray = Y_Lang.isArray(width), 65 | heightIsArray = Y_Lang.isArray(height), 66 | radiusIsArray = Y_Lang.isArray(radius), 67 | yRadiusIsArray = Y_Lang.isArray(yRadius); 68 | if(xvalues && yvalues && xvalues.length > 0) 69 | { 70 | this.clear(); 71 | 72 | len = xvalues.length; 73 | for(; i < len; ++i) 74 | { 75 | x = xvalues[i]; 76 | y = yvalues[i]; 77 | xRad = radiusIsArray ? radius[i] : radius; 78 | yRad = yRadiusIsArray ? yRadius[i] : yRadius; 79 | if(!isNaN(x) && !isNaN(y) && !isNaN(xRad)) 80 | { 81 | this.drawShape({ 82 | x: x, 83 | y: y, 84 | width: widthIsArray ? width[i] : width, 85 | height: heightIsArray ? height[i] : height, 86 | radius: xRad, 87 | yRadius: yRad 88 | }); 89 | this.closePath(); 90 | attrs[i] = { 91 | id: id + "_" + i, 92 | className: className, 93 | coords: (x - this._left) + ", " + (y - this._top) + ", " + radius, 94 | shape: "circle" 95 | }; 96 | } 97 | } 98 | this._closePath(); 99 | } 100 | }, 101 | 102 | /** 103 | * Parses and array of lengths into radii 104 | * 105 | * @method _getRadiusCollection 106 | * @param {Array} val Array of lengths 107 | * @return Array 108 | * @private 109 | */ 110 | _getRadiusCollection: function(val) 111 | { 112 | var i = 0, 113 | len = val.length, 114 | radii = []; 115 | for(; i < len; ++i) 116 | { 117 | radii[i] = val[i] * 0.5; 118 | } 119 | return radii; 120 | } 121 | }); 122 | 123 | ShapeGroup.ATTRS = Y.merge(Y.Path.ATTRS, { 124 | dimensions: { 125 | getter: function() 126 | { 127 | var dimensions = this._dimensions, 128 | radius, 129 | yRadius, 130 | width, 131 | height; 132 | if(dimensions.hasOwnProperty("radius")) 133 | { 134 | return dimensions; 135 | } 136 | else 137 | { 138 | width = dimensions.width; 139 | height = dimensions.height; 140 | radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5); 141 | yRadius = Y_Lang.isArray(height) ? this._getRadiusCollection(height) : (height * 0.5); 142 | return { 143 | width: width, 144 | height: height, 145 | radius: radius, 146 | yRadius: yRadius 147 | }; 148 | } 149 | }, 150 | 151 | setter: function(val) 152 | { 153 | this._dimensions = val; 154 | return val; 155 | } 156 | }, 157 | xvalues: { 158 | getter: function() 159 | { 160 | return this._xvalues; 161 | }, 162 | setter: function(val) 163 | { 164 | this._xvalues = val; 165 | } 166 | }, 167 | yvalues: { 168 | getter: function() 169 | { 170 | return this._yvalues; 171 | }, 172 | setter: function(val) 173 | { 174 | this._yvalues = val; 175 | } 176 | } 177 | }); 178 | Y.ShapeGroup = ShapeGroup; 179 | -------------------------------------------------------------------------------- /themes/default/partials/events.handlebars: -------------------------------------------------------------------------------- 1 |
    2 |

    {{name}}

    3 | {{#crossLink type}}{{/crossLink}} 4 | 5 | {{#if deprecated}} 6 | deprecated 7 | {{/if}} 8 | 9 | {{#if access}} 10 | {{access}} 11 | {{/if}} 12 | 13 | {{#if final}} 14 | final 15 | {{/if}} 16 | 17 | {{#if static}} 18 | static 19 | {{/if}} 20 | 21 |
    22 | {{#if overwritten_from}} 23 |

    Inherited from 24 | 25 | {{overwritten_from/class}} 26 | 27 | {{#if foundAt}} 28 | but overwritten in 29 | {{/if}} 30 | {{else}} 31 | {{#if extended_from}} 32 |

    Inherited from 33 | {{extended_from}}: 34 | {{else}} 35 | {{#providedBy}} 36 |

    Provided by the {{.}} module.

    37 | {{/providedBy}} 38 |

    39 | {{#if foundAt}} 40 | Defined in 41 | {{/if}} 42 | {{/if}} 43 | {{/if}} 44 | {{#if foundAt}} 45 | `{{{file}}}:{{{line}}}` 46 | {{/if}} 47 |

    48 | 49 | {{#if deprecationMessage}} 50 |

    Deprecated: {{deprecationMessage}}

    51 | {{/if}} 52 | 53 | {{#if since}} 54 |

    Available since {{since}}

    55 | {{/if}} 56 |
    57 | 58 |
    59 | {{{eventDescription}}} 60 |
    61 | 62 | {{#if params}} 63 |
    64 |

    Event Payload:

    65 | 66 |
      67 | {{#params}} 68 |
    • 69 | {{#if optional}} 70 | [{{name}}{{#if optdefault}}={{optdefault}}{{/if}}] 71 | {{#crossLink type}}{{/crossLink}} 72 | optional 73 | {{else}} 74 | {{name}} 75 | {{#crossLink type}}{{/crossLink}} 76 | {{/if}} 77 | 78 | {{#if multiple}} 79 | Multiple 80 | {{/if}} 81 | 82 |
      83 | {{{description}}} 84 |
      85 | 86 | {{#if props}} 87 |
        88 | {{#props}} 89 |
      • 90 | {{#if optional}} 91 | [{{name}}{{#if optdefault}}={{optdefault}}{{/if}}] 92 | {{#crossLink type}}{{/crossLink}} 93 | optional 94 | {{else}} 95 | {{name}} 96 | {{#crossLink type}}{{/crossLink}} 97 | {{/if}} 98 | 99 |
        100 | {{{description}}} 101 |
        102 | 103 | {{#if props}} 104 |
          105 | {{#props}} 106 |
        • 107 | {{name}} 108 | {{#crossLink type}}{{/crossLink}} 109 | 110 |
          111 | {{{description}}} 112 |
          113 |
        • 114 | {{/props}} 115 |
        116 | {{/if}} 117 |
      • 118 | {{/props}} 119 |
      120 | {{/if}} 121 |
    • 122 | {{/params}} 123 |
    124 |
    125 | {{/if}} 126 | 127 | 128 | {{#example}} 129 |
    130 |

    Example:

    131 | 132 |
    133 | {{{.}}} 134 |
    135 |
    136 | {{/example}} 137 |
    138 | -------------------------------------------------------------------------------- /themes/default/partials/attrs.handlebars: -------------------------------------------------------------------------------- 1 |
    2 | {{! For backwards compatibility }} 3 |

    {{name}}

    4 | {{#crossLink type}}{{/crossLink}} 5 | 6 | {{#if deprecated}} 7 | deprecated 8 | {{/if}} 9 | 10 | {{#if access}} 11 | {{access}} 12 | {{/if}} 13 | 14 | {{#if final}} 15 | final 16 | {{/if}} 17 | 18 | {{#if static}} 19 | static 20 | {{/if}} 21 | 22 | {{#if optional}} 23 | optional 24 | {{/if}} 25 | 26 | {{#if required}} 27 | required 28 | {{/if}} 29 | 30 | {{#if readonly}} 31 | readonly 32 | {{/if}} 33 | 34 |
    35 | {{#if overwritten_from}} 36 |

    Inherited from 37 | 38 | {{overwritten_from/class}} 39 | 40 | {{#if foundAt}} 41 | but overwritten in 42 | {{/if}} 43 | {{else}} 44 | {{#if extended_from}} 45 |

    Inherited from 46 | {{extended_from}}: 47 | {{else}} 48 | {{#providedBy}} 49 |

    Provided by the {{.}} module.

    50 | {{/providedBy}} 51 |

    52 | {{#if foundAt}} 53 | Defined in 54 | {{/if}} 55 | {{/if}} 56 | {{/if}} 57 | {{#if foundAt}} 58 | `{{{file}}}:{{{line}}}` 59 | {{/if}} 60 |

    61 | 62 | {{#if deprecationMessage}} 63 |

    Deprecated: {{deprecationMessage}}

    64 | {{/if}} 65 | 66 | {{#if since}} 67 |

    Available since {{since}}

    68 | {{/if}} 69 |
    70 | 71 |
    72 | {{{attrDescription}}} 73 |
    74 | 75 | {{#if default}} 76 |

    Default: {{default}}

    77 | {{/if}} 78 | 79 | {{#if emit}} 80 |
    81 |

    Fires event {{name}}Change

    82 | 83 |

    84 | Fires when the value for the configuration attribute `{{{name}}}` is 85 | changed. You can listen for the event using the `on` method if you 86 | wish to be notified before the attribute's value has changed, or 87 | using the `after` method if you wish to be notified after the 88 | attribute's value has changed. 89 |

    90 | 91 |
    92 |

    Parameters:

    93 | 94 |
      95 |
    • 96 | e 97 | {{#crossLink "EventFacade"}}{{/crossLink}} 98 | 99 |
      100 | An Event Facade object with the following 101 | attribute-specific properties added: 102 |
      103 | 104 |
        105 |
      • 106 | prevVal 107 | Any 108 |
        The value of the attribute, prior to it being set.
        109 |
      • 110 |
      • 111 | newVal 112 | Any 113 |
        The value the attribute is to be set to.
        114 |
      • 115 |
      • 116 | attrName 117 | {{#crossLink "String"}}{{/crossLink}} 118 |
        The name of the attribute being set.
        119 |
      • 120 |
      • 121 | subAttrName 122 | {{#crossLink "String"}}{{/crossLink}} 123 |
        If setting a property within the attribute's value, the name of the sub-attribute property being set.
        124 |
      • 125 |
      126 |
    • 127 |
    128 |
    129 |
    130 | {{/if}} 131 | 132 | {{#example}} 133 |
    134 |

    Example:

    135 | 136 |
    137 | {{{.}}} 138 |
    139 |
    140 | {{/example}} 141 |
    142 | -------------------------------------------------------------------------------- /output/api/classes/CLI.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CLI - yuidoc-root 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    15 |
    16 |
    17 | 18 |

    19 | 20 |
    21 |
    22 | API Docs for: 0.3.47 23 |
    24 |
    25 |
    26 | 27 |
    28 | 78 |
    79 |
    80 |
    81 | Show: 82 | 86 | 87 | 91 | 92 | 96 | 100 | 101 |
    102 | 103 | 104 |
    105 |
    106 |
    107 |

    CLI Class

    108 |
    109 | 110 | 111 | 112 | 113 | 114 |
    115 | Defined in: lib/cli.js:8 116 |
    117 | 118 | 119 | 120 | 121 | Module: yuidoc 122 | 123 | 124 | 125 | 126 |
    127 | 128 | 129 | 130 |
    131 |

    Parses the arguments, creates the options and passes them to Y.YUIDoc and then Y.DocBuilder.

    132 | 133 |
    134 | 135 | 136 | 137 |
    138 |
      139 |
    • Index
    • 140 | 141 | 142 | 143 | 144 | 145 |
    146 | 147 |
    148 |
    149 |

    Item Index

    150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 |
    159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 |
    168 |
    169 | 170 |
    171 |
    172 |
    173 |
    174 |
    175 |
    176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /tests/input/test/test.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * The test project 4 | * @project tester 5 | * @title The Tester 6 | * @icon http://a.img 7 | * @url http://one.url 8 | * @url http://two.url 9 | * @author admo 10 | * @contributor davglass 11 | * @contributor entropy 12 | */ 13 | 14 | /** 15 | * The module 16 | * @module mymodule 17 | * @category one,two 18 | * @category three 19 | * @requires one 20 | * @requires two 21 | * @uses three 22 | * @uses four 23 | */ 24 | 25 | /** 26 | * The submodule 27 | * @submodule mysubmodule 28 | * @category three,four 29 | */ 30 | 31 | 32 | /** 33 | * The class def 34 | * @class myclass 35 | * @constructor 36 | */ 37 | 38 | /** 39 | * test optional 40 | * @method testoptional 41 | * @param notype my desc 42 | * @param {int} namesecond my desc 43 | * @param namefirst {string} my desc 44 | * @param [optionalvar] {bool} my desc 45 | * @param {string} [optionalwithdefault="defaultval"] my desc 46 | * @evil 47 | * @injects {HTML} uses a string parameter to populate innerHTML 48 | * @returns something without a type 49 | * @example 50 | * This is code 51 | * @example 52 | * var = 'This is more code'; 53 | * document.title = 'Test This'; 54 | */ 55 | 56 | /** 57 | * test object param 58 | * @method testobjectparam 59 | * @param {object} anobject the object 60 | * @param {string} anobject.prop1 prop1 61 | * @param {bool} anobject.prop2 prop2 62 | * @return {string} something with a type 63 | */ 64 | 65 | /** 66 | * test 0..n param 67 | * @method test0ton 68 | * @param {string} [optionalandmultiple]* my desc 69 | * @returns something without a type 70 | */ 71 | 72 | /** 73 | * test 1..n param 74 | * @method test1ton 75 | * @param {string} multiple* my desc 76 | * @returns something without a type 77 | */ 78 | 79 | /** 80 | * Testing really long param description paring 81 | * @method reallyLongParamDesc 82 | * @param {Object} config Object with configuration property name/value pairs. The object can be 83 | * used to provide default values for the objects published attributes. 84 | * 85 | *

    86 | * The config object can also contain the following non-attribute properties, providing a convenient 87 | * way to configure events listeners and plugins for the instance, as part of the constructor call: 88 | *

    89 | * 90 | *
    91 | *
    on
    92 | *
    An event name to listener function map, to register event listeners for the "on" moment of the event. A constructor convenience property for the on method.
    93 | *
    after
    94 | *
    An event name to listener function map, to register event listeners for the "after" moment of the event. A constructor convenience property for the after method.
    95 | *
    bubbleTargets
    96 | *
    An object, or array of objects, to register as bubble targets for bubbled events fired by this instance. A constructor convenience property for the addTarget method.
    97 | *
    plugins
    98 | *
    A plugin, or array of plugins to be plugged into the instance (see PluginHost's plug method for signature details). A constructor convenience property for the plug method.
    99 | *
    100 | * 101 | */ 102 | 103 | 104 | /** 105 | This is the description 106 | 107 | @method foo 108 | @example 109 | 110 | var email = "lsmith@foo-truncated-here.com" 111 | 112 | **/ 113 | 114 | /** 115 | Other Class 116 | @class OtherClass 117 | @extensionfor myclass 118 | */ 119 | 120 | /** 121 | Other Class 2 122 | @class OtherClass2 123 | @extension_for myclass 124 | */ 125 | 126 | /** 127 | Default options to use for all transactions. 128 | @static 129 | @protected 130 | @property {Object} options 131 | @property {Object} [options.attributes] HTML attribute name/value pairs that 132 | should be added to inserted nodes. 133 | @property {Boolean} [options.autopurge=false] Whether or not to automatically 134 | purge inserted nodes after the purge threshold is reached. 135 | @property {Document} [options.doc] Document into which nodes should be inserted. 136 | @property {Number} [options.pollInterval=50] Polling interval (in milliseconds) 137 | for detecting CSS load completion in browsers that don't support the `load` 138 | event on `` nodes. 139 | **/ 140 | 141 | 142 | /** 143 | This is a test of CASE TaGs 144 | @MeThod testMethod 145 | @ParaM {String} foo Foo description 146 | */ 147 | 148 | /** 149 | This is an optional attribute 150 | @attribute optionalAttr 151 | @optional 152 | */ 153 | 154 | /** 155 | This is a required attribute 156 | @attribute requiredAttr 157 | @required 158 | */ 159 | 160 | /** 161 | crash test method 162 | @method crashTest 163 | @params {String} foo The string to crash the parser 164 | */ 165 | 166 | /** 167 | * @event changeWithOptional 168 | * @param ev {EventFacade} containing: 169 | * @param [ev.name] {String} Name of the field changed 170 | */ 171 | 172 | 173 | 174 | /** 175 | This method fires {{#crossLink "OtherClass2/changeWithOptional:event"}}{{/crossLink}} 176 | @method crossedEvent 177 | */ 178 | 179 | /** 180 | This method has attr {{#crossLink "OtherClass2/requiredAttr:attribute"}}{{/crossLink}} 181 | @method crossedAttr 182 | */ 183 | 184 | /** 185 | This method has attr {{#crossLink "OtherClass2/optionalAttr:attr"}}{{/crossLink}} 186 | @method crossOptAttr 187 | */ 188 | 189 | /** 190 | Test `\{{foobar\}}` `\{{barfoo\}}` 191 | @method hbHelper1 192 | */ 193 | 194 | /** 195 | Test `\{{foobar2\}}` `\{{barfoo2\}}` 196 | @method hbHelper2 197 | */ 198 | 199 | /** 200 | Test `\{{foobar3\}}` `\{{barfoo3\}}` 201 | @method hbHelper3 202 | */ 203 | 204 | -------------------------------------------------------------------------------- /lib/options.js: -------------------------------------------------------------------------------- 1 | YUI.add('options', function (Y) { 2 | 3 | var path = require('path'); 4 | 5 | /** 6 | * Handles argument parsing 7 | * @module yuidoc 8 | * @class Options 9 | */ 10 | 11 | /** 12 | * Parses arguments and returns an Object of config options 13 | * @method Options 14 | * @param {Array} args Arguments to parse 15 | * @return {Object} The config object 16 | */ 17 | Y.Options = function (args) { 18 | /*jshint onevar:false */ 19 | 20 | var options = { 21 | port: 3000, 22 | nocode: false 23 | }; 24 | 25 | while (args.length > 0) { 26 | var v = args.shift(); 27 | // options.* defined in ./builder.js 28 | switch (v) { 29 | case '--lint': 30 | options.lint = true; 31 | options.parseOnly = true; 32 | options.writeJSON = false; 33 | options.quiet = true; 34 | break; 35 | case "--debug": 36 | Y.applyConfig({ 37 | debug: true, 38 | filter: 'debug' 39 | }); 40 | break; 41 | case "--charset": 42 | Y.charset = args.shift() || 'utf8'; 43 | Y.log('Setting default charset to ' + Y.charset, 'yuidoc', 'warn'); 44 | break; 45 | case "-c": 46 | case "--config": 47 | case "--configfile": 48 | options.configfile = args.shift(); 49 | break; 50 | case "-e": 51 | case "--extension": 52 | options.extension = args.shift(); 53 | break; 54 | case "-x": 55 | case "--exclude": 56 | options.exclude = args.shift(); 57 | break; 58 | case "-v": 59 | case "--version": 60 | console.error(Y.packageInfo.version); 61 | process.exit(1); 62 | break; 63 | case "--project-version": 64 | options.version = args.shift(); 65 | break; 66 | case "-N": 67 | case "--no-color": 68 | Y.config.useColor = false; 69 | options.nocolor = true; 70 | break; 71 | case "-D": 72 | case "--no-delete-out": 73 | options.nodeleteout = true; 74 | break; 75 | case "-C": 76 | case "--no-code": 77 | options.nocode = true; 78 | break; 79 | case "-n": 80 | case "--norecurse": 81 | options.norecurse = true; 82 | break; 83 | case "-S": 84 | case "--selleck": 85 | options.selleck = true; 86 | break; 87 | case "-V": 88 | case "--view": 89 | options.dumpview = true; 90 | break; 91 | case "-p": 92 | case "--parse-only": 93 | options.parseOnly = true; 94 | break; 95 | case "-o": 96 | case "--outdir": 97 | options.outdir = args.shift(); 98 | break; 99 | case "-t": 100 | case "--themedir": 101 | options.themedir = args.shift(); 102 | break; 103 | case "--server": 104 | options.server = true; 105 | var a = args.shift(); 106 | var p = parseInt(a, 10); 107 | if (isNaN(p) || !p) { 108 | if (a) { 109 | args.unshift(a); 110 | } 111 | Y.log('Failed to extract port, setting to the default :3000', 'warn', 'yuidoc'); 112 | } else { 113 | options.port = p; 114 | } 115 | break; 116 | case "-h": 117 | case "--help": 118 | Y.showHelp(); 119 | break; 120 | case "-H": 121 | case "--helpers": 122 | var list = args.shift(); 123 | if (list) { 124 | options.helpers = list.split(','); 125 | } else { 126 | throw ('Failed to pass a helper file.'); 127 | } 128 | break; 129 | case "-T": 130 | case "--theme": 131 | var theme = args.shift(); 132 | options.themedir = path.join(__dirname, '../', 'themes', theme); 133 | break; 134 | case "-q": 135 | case "--quiet": 136 | options.quiet = true; 137 | break; 138 | case "--syntaxtype": 139 | options.syntaxtype = args.shift(); 140 | break; 141 | case "--tab-to-space": 142 | options.tabtospace = parseInt(args.shift(), 10); 143 | if (typeof options.tabtospace === 'number') { 144 | options.tabspace = ''; 145 | for (var s = 0; s < options.tabtospace; s++) { 146 | options.tabspace += ' '; 147 | } 148 | } 149 | break; 150 | default: 151 | if (!options.paths) { 152 | options.paths = []; 153 | } 154 | if (v && v.indexOf('-') === 0) { 155 | throw ('Unknown option: ' + v); 156 | } 157 | options.paths.push(v); 158 | } 159 | } 160 | 161 | if (options.quiet) { 162 | Y.applyConfig({ 163 | debug: false 164 | }); 165 | } 166 | 167 | return options; 168 | }; 169 | 170 | }); 171 | -------------------------------------------------------------------------------- /output/api/classes/Main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Main - yuidoc-root 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    15 |
    16 |
    17 | 18 |

    19 | 20 |
    21 |
    22 | API Docs for: 0.3.47 23 |
    24 |
    25 |
    26 | 27 |
    28 | 78 |
    79 |
    80 |
    81 | Show: 82 | 86 | 87 | 91 | 92 | 96 | 100 | 101 |
    102 | 103 | 104 |
    105 |
    106 |
    107 |

    Main Class

    108 |
    109 | 110 | 111 | 112 | 113 | 114 |
    115 | Defined in: lib/index.js:6 116 |
    117 | 118 | 119 | 120 | 121 | Module: yuidoc 122 | 123 | 124 | 125 | 126 |
    127 | 128 | 129 | 130 |
    131 |

    Module creates the YUI instance with the required modules, uses them and exports the Y to be used 132 | by the CLI class or by extenders: require('yuidocjs');
    You can use it like this:

    133 |
    var options = {
    134 |     paths: [ './lib' ],
    135 |     outdir: './out'
    136 | };
    137 | 
    138 | var Y = require('yuidocjs');
    139 | var json = (new Y.YUIDoc(options)).run();
    140 | 141 |
    142 | 143 | 144 | 145 |
    146 |
      147 |
    • Index
    • 148 | 149 | 150 | 151 | 152 | 153 |
    154 | 155 |
    156 |
    157 |

    Item Index

    158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 |
    167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 |
    176 |
    177 | 178 |
    179 |
    180 |
    181 |
    182 |
    183 |
    184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /output/api/files/lib_cli.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | lib/cli.js - yuidoc-root 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    15 |
    16 |
    17 | 18 |

    19 | 20 |
    21 |
    22 | API Docs for: 0.3.47 23 |
    24 |
    25 |
    26 | 27 |
    28 | 78 |
    79 |
    80 |
    81 | Show: 82 | 86 | 87 | 91 | 92 | 96 | 100 | 101 |
    102 | 103 | 104 |
    105 |
    106 |
    107 |

    File: lib/cli.js

    108 | 109 |
    110 |
    111 | #!/usr/bin/env node
    112 | /*
    113 | Copyright (c) 2011, Yahoo! Inc. All rights reserved.
    114 | Code licensed under the BSD License:
    115 | http://yuilibrary.com/license/
    116 | */
    117 | 
    118 | /**
    119 | * Parses the arguments, creates the options and passes them to `Y.YUIDoc` and then `Y.DocBuilder`.
    120 | * @class CLI
    121 | * @module yuidoc
    122 | */
    123 | 
    124 | var Y = require('./index'),
    125 |     path = require('path');
    126 | 
    127 | var options = Y.Options(Y.Array(process.argv, 2));
    128 | 
    129 | Y.log('Starting YUIDoc@' + Y.packageInfo.version + ' using YUI@' + Y.version + ' with NodeJS@' + process.versions.node, 'info', 'yuidoc');
    130 | 
    131 | var starttime = (new Date).getTime();
    132 | 
    133 | options = Y.Project.init(options);
    134 | 
    135 | Y.log('Starting YUIDoc with the following options:', 'info', 'yuidoc');
    136 | var opts = Y.clone(options);
    137 | if (opts.paths && opts.paths.length && (opts.paths.length > 10)) {
    138 |     opts.paths = [].concat(opts.paths.slice(0, 5), ['<paths truncated>'], options.paths.slice(-5));
    139 | }
    140 | Y.log(opts, 'info', 'yuidoc');
    141 | 
    142 | if (options.server) {
    143 |     Y.Server.start(options);
    144 | } else {
    145 | 
    146 |     var json = (new Y.YUIDoc(options)).run();
    147 |     if (json === null) {
    148 |         return;
    149 |     }
    150 |     options = Y.Project.mix(json, options);
    151 | 
    152 |     if (!options.parseOnly) {
    153 |         var builder = new Y.DocBuilder(options, json);
    154 |         builder.compile(function() {
    155 |             var endtime = (new Date).getTime();
    156 |             Y.log('Completed in ' + ((endtime - starttime) / 1000) + ' seconds' , 'info', 'yuidoc');
    157 |         });
    158 |     }
    159 | }
    160 | 
    161 |     
    162 |
    163 | 164 |
    165 |
    166 |
    167 |
    168 |
    169 |
    170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | --------------------------------------------------------------------------------