├── .gitignore
├── .npmignore
├── .travis.yml
├── LICENSE.txt
├── README.md
├── example
├── code.png
├── diagram.png
└── index.js
├── package.json
├── publish.js
└── tpl
├── index.js
└── index.tpl
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .idea
3 | out
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.10.31
4 | before_install: npm install -g npm@'>=2.13.5'
5 | notifications:
6 | email:
7 | recipients:
8 | - tates001@gmail.com
9 | on_success: always
10 | on_failure: always
11 | deploy:
12 | provider: npm
13 | email: tates001@gmail.com
14 | api_key: $API_KEY
15 | on:
16 | tags: true
17 | branch: master
18 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Andrei McMillan (http://github.com/amcmillan01/jsdoc2diagram)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## jsdoc2diagram
2 |
3 | [](https://badge.fury.io/js/jsdoc2diagram)
4 | [](https://travis-ci.org/amcmillan01/jsdoc2diagram)
5 |
6 | jsdoc2diagram is a [JSDoc](http://usejsdoc.org/) template that creates a [D3 tree diagram](http://bl.ocks.org/d3noob/8329404) from your code's jsdoc documentation.
7 |
8 | #### Code
9 |
10 |
11 | #### Diagram
12 |
13 |
14 | ### Getting Started
15 |
16 | - npm install jsdoc
17 | - npm install jsdoc2diagram
18 | - jsdoc -t `PATH/TO/jsdoc2diagram` -r `JS_SOURCE_DIR/FILE` -d `OUTPUT_DIR`
19 |
20 | ### Reference
21 |
22 | - http://usejsdoc.org/
23 | - http://bl.ocks.org/d3noob/8329404
24 |
25 | ### License
26 |
27 | Licensed under The MIT License (MIT)
28 |
29 | For the full copyright and license information, please view the LICENSE.txt file.
30 |
31 |
--------------------------------------------------------------------------------
/example/code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amcmillan01/jsdoc2diagram/41260c04113199856d1cc27fe2b132cde6acbf0d/example/code.png
--------------------------------------------------------------------------------
/example/diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amcmillan01/jsdoc2diagram/41260c04113199856d1cc27fe2b132cde6acbf0d/example/diagram.png
--------------------------------------------------------------------------------
/example/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @constructor
3 | */
4 | var Garage = function(){
5 |
6 | };
7 |
8 | /**
9 | * @return {number}
10 | */
11 | Garage.prototype.getVehicleCount = function(){
12 |
13 | };
14 |
15 |
16 | /**
17 | *
18 | * @constructor
19 | * @memberof Garage
20 | */
21 | var Car = function(){
22 | /**
23 | *
24 | * @type {string}
25 | */
26 | this.name = '';
27 | /**
28 | *
29 | * @type {string}
30 | */
31 | this.color = '';
32 | };
33 |
34 | /**
35 | * @return {boolean}
36 | */
37 | Car.prototype.isOn = function(){
38 |
39 | };
40 |
41 | /**
42 | * @return {boolean}
43 | */
44 | Car.prototype.hasNavigation = function(){
45 |
46 | };
47 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jsdoc2diagram",
3 | "version": "0.0.6",
4 | "license": "MIT",
5 | "repository": {
6 | "type": "git",
7 | "url": "https://github.com/amcmillan01/jsdoc2diagram.git"
8 | },
9 | "author": "Andrei McMillan",
10 | "description": "jsdoc2diagram is a JSDoc template that creates a D3 tree diagram from your code's jsdoc documentation",
11 | "keywords": [
12 | "jsdoc2diagram",
13 | "jsdoc",
14 | "diagram",
15 | "d3",
16 | "tree"
17 | ],
18 | "scripts": {
19 | "test": "echo 'write some tests!'"
20 | },
21 | "dependencies": {
22 | "lodash.template": "^3.6.2"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/publish.js:
--------------------------------------------------------------------------------
1 | /**
2 | * jsdoc2diagram
3 | */
4 |
5 | 'use strict';
6 |
7 | var fs = require('fs');
8 | var path = require('path');
9 | var template = require('lodash.template');
10 |
11 | /**
12 | * Create the tree structure need for the d3 tree diagram
13 | * - original code from http://bl.ocks.org/
14 | *
15 | * @param {Array.