Skip to content

Commit d19f7d4

Browse files
committed
Merge branch 'edge'
2 parents 4bb7384 + c678585 commit d19f7d4

File tree

6 files changed

+25
-9
lines changed

6 files changed

+25
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#Changelog
22

3+
##0.0.6 (August 17, 2014)
4+
5+
- Added support for custom Handlebars templates.
6+
- Improved built-in template selection (now case insensitive).
7+
38
##0.0.5 (August 17, 2014)
49

510
- Added support for crawling directories.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $ npm install doxdox -g
1414

1515
##Usage
1616

17-
```bash
17+
```
1818
Usage: doxdox <path> [options]
1919
2020
Options:
@@ -24,7 +24,7 @@ $ npm install doxdox -g
2424
-t, --title Sets title.
2525
-d, --description Sets description.
2626
-l, --layout Template to render the documentation with.
27-
-p, --package Sets location of package.json file.
27+
-p, --package Sets location of package.json file.
2828
-o, --output File to save documentation to. Defaults to stdout.
2929
3030
Available Layouts:

bin/doxdox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ while (args.length) {
6767
process.stdout.write(chalk.yellow(' -t, --title') + '\t\tSets title.' + '\n');
6868
process.stdout.write(chalk.yellow(' -d, --description') + '\tSets description.' + '\n');
6969
process.stdout.write(chalk.yellow(' -l, --layout') + '\t\tTemplate to render the documentation with.' + '\n');
70-
process.stdout.write(chalk.yellow(' -p, --package') + '\tSets location of package.json file.' + '\n');
70+
process.stdout.write(chalk.yellow(' -p, --package') + '\t\tSets location of package.json file.' + '\n');
7171
process.stdout.write(chalk.yellow(' -o, --output') + '\t\tFile to save documentation to. Defaults to stdout.' + '\n');
7272
process.stdout.write('\n');
7373
process.stdout.write(' Available Layouts:' + '\n\n');

lib/doxdox.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ exports.parseInput = function (input, output, config) {
5353
exports.parseScripts = function (scripts, output, config) {
5454

5555
var files = [],
56-
content;
56+
content,
57+
template;
5758

5859
scripts.forEach(function (script) {
5960

@@ -70,9 +71,19 @@ exports.parseScripts = function (scripts, output, config) {
7071

7172
});
7273

73-
if (templates[config.layout]) {
74+
if (fs.existsSync(path.resolve(config.layout))) {
7475

75-
content = templates[config.layout]({
76+
template = require(path.resolve(config.layout));
77+
78+
} else if (templates[config.layout.toLowerCase()]) {
79+
80+
template = templates[config.layout.toLowerCase()];
81+
82+
}
83+
84+
if (template) {
85+
86+
content = template({
7687
title: config.title,
7788
description: config.description,
7889
files: files

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "doxdox",
33
"description": "HTML and Markdown documentation generator.",
4-
"version": "0.0.5",
4+
"version": "0.0.6",
55
"bin": "./bin/doxdox",
66
"license": "MIT",
77
"dependencies": {

templates/bootstrap.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
1717
.back-to-top a {
1818
display: block;
19-
padding: .5em .5em .5em 1.3em;
19+
padding: .5em .5em .5em 1.5em;
2020
line-height: 1em;
2121
border-radius: .25em;
22-
background: #fff url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxM3B4IiBoZWlnaHQ9IjE0cHgiIHZpZXdCb3g9IjAgMCAxMyAxNCI+CiAgICA8cGF0aCBkPSJNNy4xODc2MTE1NiwxMyBMNy4xODc2MTE1Niw1LjQ5MjQ5NzAzIEwxMC40NTg3ODUzLDUuNDkyNDk3MDMgTDUuMDk5MzE3NjMsMC4xMTM1NTgxMjkgTC0wLjI2MDE1LDUuNDkyNDk3MDMgTDMuMDExMDIzNzEsNS40OTI0OTcwMyBMMy4wMTEwMjM3MSwxMyBMNy4xODc2MTE1NiwxMyBaIiBmaWxsPSIjNDI4YmNhIj48L3BhdGg+Cjwvc3ZnPgo=) no-repeat .25em center;
22+
background: #fff url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxM3B4IiBoZWlnaHQ9IjE0cHgiIHZpZXdCb3g9IjAgMCAxMyAxNCI+CiAgICA8cGF0aCBkPSJNNy4xODc2MTE1NiwxMyBMNy4xODc2MTE1Niw1LjQ5MjQ5NzAzIEwxMC40NTg3ODUzLDUuNDkyNDk3MDMgTDUuMDk5MzE3NjMsMC4xMTM1NTgxMjkgTC0wLjI2MDE1LDUuNDkyNDk3MDMgTDMuMDExMDIzNzEsNS40OTI0OTcwMyBMMy4wMTEwMjM3MSwxMyBMNy4xODc2MTE1NiwxMyBaIiBmaWxsPSIjNDI4YmNhIj48L3BhdGg+Cjwvc3ZnPgo=) no-repeat .5em center;
2323
}
2424
2525
.menu {

0 commit comments

Comments
 (0)