Skip to content

Commit e08e4c6

Browse files
committed
Initial commit.
0 parents  commit e08e4c6

File tree

6 files changed

+173
-0
lines changed

6 files changed

+173
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#Changelog
2+
3+
##0.0.1 (September 11, 2014)
4+
5+
- Initial public release.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Scott Doxey
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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#grunt-doxdox
2+
3+
> Generate documentation with doxdox.
4+
5+
##Installation
6+
7+
```bash
8+
$ npm install grunt-doxdox --save-dev
9+
```
10+
11+
##Usage
12+
13+
###Basic Options
14+
15+
```javascript
16+
grunt.initConfig({
17+
doxdox: {
18+
dev: {
19+
input: 'script.js',
20+
output: 'docs/index.html'
21+
}
22+
}
23+
});
24+
```
25+
26+
###Custom Configuration Options
27+
28+
```javascript
29+
grunt.initConfig({
30+
doxdox: {
31+
dev: {
32+
input: 'script.js',
33+
output: 'docs/index.html',
34+
config: {
35+
title: 'Sample Title',
36+
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit',
37+
layout: 'docs/template.hbs',
38+
package: 'package.json'
39+
}
40+
}
41+
}
42+
});
43+
```

package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "grunt-doxdox",
3+
"description": "Generate documentation with doxdox.",
4+
"version": "0.0.1",
5+
"license": "MIT",
6+
"dependencies": {
7+
"doxdox": "*",
8+
"extend": "1.3.0"
9+
},
10+
"keywords": [
11+
"gruntplugin",
12+
"documentation",
13+
"html",
14+
"bootstrap",
15+
"markdown"
16+
],
17+
"authors": [
18+
{
19+
"name": "Scott Doxey",
20+
"email": "[email protected]",
21+
"homepage": "http://scottdoxey.com/"
22+
}
23+
],
24+
"homepage": "https://github.com/neogeek/grunt-doxdox",
25+
"repository": {
26+
"type": "git",
27+
"url": "git://github.com/neogeek/grunt-doxdox.git"
28+
}
29+
}

tasks/doxdox.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
var doxdox = require('doxdox'),
2+
utils = require('doxdox/lib/utils'),
3+
fs = require('fs'),
4+
path = require('path'),
5+
extend = require('extend');
6+
7+
module.exports = function (grunt) {
8+
9+
grunt.registerMultiTask('doxdox', 'Generate documentation with doxdox.', function () {
10+
11+
var input,
12+
output,
13+
config = {
14+
title: '',
15+
description: '',
16+
layout: 'bootstrap'
17+
};
18+
19+
if (this.data.input && this.data.output) {
20+
21+
input = this.data.input;
22+
output = this.data.output;
23+
24+
if (this.data.config) {
25+
26+
config = extend(true, {}, config, this.data.config);
27+
28+
}
29+
30+
if (!config.package) {
31+
32+
config.package = utils.findPackage(input);
33+
34+
}
35+
36+
if (fs.existsSync(config.package)) {
37+
38+
config.package = require(config.package);
39+
40+
if (!config.title && config.package.name) {
41+
42+
config.title = config.package.name;
43+
44+
}
45+
46+
if (!config.description && config.package.description) {
47+
48+
config.description = config.package.description;
49+
50+
}
51+
52+
}
53+
54+
if (!config.title) {
55+
56+
config.title = 'Untitled Project';
57+
58+
}
59+
60+
doxdox.parseInput(
61+
path.normalize(path.resolve(input)),
62+
path.normalize(path.resolve(output)),
63+
config
64+
);
65+
66+
} else {
67+
68+
throw new Error('Valid input and output properties are required.');
69+
70+
}
71+
72+
});
73+
74+
};

0 commit comments

Comments
 (0)