Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'integration'

  • Loading branch information...
commit 1d62e52a364c23cef146f95ca85371a75472480c 2 parents 0f4b2e2 + 3d48ec8
@tj authored
Showing with 18 additions and 1 deletion.
  1. +1 −0  Readme.md
  2. +17 −1 lib/dox/index.js
View
1  Readme.md
@@ -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
View
18 lib/dox/index.js
@@ -56,6 +56,14 @@ var jsdoc = true;
var desc = '';
/**
+ * Intro text file name.
+ *
+ * @type String
+ */
+
+var intro = '';
+
+/**
* Show private code.
*
* @type Boolean
@@ -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'
@@ -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();
@@ -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);
@@ -264,4 +280,4 @@ var render = exports.render = function(str, file){
}
return html.join('\n');
-};
+};
Please sign in to comment.
Something went wrong with that request. Please try again.