Skip to content

Commit

Permalink
Merge branch 'integration'
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jan 20, 2011
2 parents 0f4b2e2 + 3d48ec8 commit 1d62e52
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions Readme.md
Expand Up @@ -46,6 +46,7 @@ Output from `--help`:
Options:
-t, --title Project title
-d, --desc Project description (markdown)
-i, --intro File that contains introduction text (markdown)
-s, --style Document style, available: ["default"]
-J, --no-jsdoc Disable jsdoc parsing (coverts to markdown)
-p, --private Output private code in documentation
Expand Down
18 changes: 17 additions & 1 deletion lib/dox/index.js
Expand Up @@ -55,6 +55,14 @@ var jsdoc = true;

var desc = '';

/**
* Intro text file name.
*
* @type String
*/

var intro = '';

/**
* Show private code.
*
Expand All @@ -81,6 +89,7 @@ var usage = ''
+ 'Options:\n'
+ ' -t, --title STR Project title\n'
+ ' -d, --desc STR Project description (markdown)\n'
+ ' -i, --intro FILE Intro file (markdown)\n'
+ ' -r, --ribbon URL Github ribbon url\n'
+ ' -s, --style NAME Document style, available: ["default"]\n'
+ ' -J, --no-jsdoc Disable jsdoc parsing (coverts to markdown)\n'
Expand Down Expand Up @@ -141,6 +150,10 @@ exports.parse = function(args){
case '--desc':
desc = requireArg();
break;
case '-i':
case '--intro':
intro = requireArg();
break;
case '-s':
case '--style':
style = requireArg();
Expand Down Expand Up @@ -171,6 +184,9 @@ exports.parse = function(args){
var head = fs.readFileSync(__dirname + '/styles/' + style + '/head.html', 'utf8');
var foot = fs.readFileSync(__dirname + '/styles/' + style + '/foot.html', 'utf8');
var css = fs.readFileSync(__dirname + '/styles/' + style + '/style.css', 'utf8');

if (intro)
desc = (desc || '') + fs.readFileSync(intro, 'utf8');

// Substitutions
head = head.replace(/\{\{title\}\}/g, title).replace(/\{\{style\}\}/, css);
Expand Down Expand Up @@ -264,4 +280,4 @@ var render = exports.render = function(str, file){
}

return html.join('\n');
};
};

0 comments on commit 1d62e52

Please sign in to comment.