Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Commit 4c8c470

Browse files
committed
Initial commit.
0 parents  commit 4c8c470

File tree

6 files changed

+103
-0
lines changed

6 files changed

+103
-0
lines changed

.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@neogeek/eslint-config-standards"
4+
]
5+
}

.gitignore

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

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) 2016 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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# doxdox-plugin-handlebars
2+
3+
> Custom handlebars template plugin for doxdox.
4+
5+
[![NPM Version](http://img.shields.io/npm/v/doxdox-plugin-handlebars.svg?style=flat)](https://www.npmjs.org/package/doxdox-plugin-handlebars)
6+
![](https://img.shields.io/badge/requires%20doxdox-v1.0.0-orange.svg)
7+
8+
## Install
9+
10+
```bash
11+
$ npm install doxdox doxdox-plugin-handlebars --save-dev
12+
```
13+
14+
## Usage
15+
16+
```bash
17+
$ doxdox lib/ --layout templates/custom.hbs --output DOCUMENTATION.html
18+
```

index.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const Handlebars = require('handlebars');
5+
6+
const plugin = data => new Promise((resolve, reject) => {
7+
8+
fs.readFile(path.join(process.cwd(), data.layout), 'utf8', (err, contents) => {
9+
10+
if (err) {
11+
12+
return reject(err);
13+
14+
}
15+
16+
const template = Handlebars.compile(contents);
17+
18+
return resolve(template(data));
19+
20+
});
21+
22+
});
23+
24+
module.exports = plugin;

package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "doxdox-plugin-handlebars",
3+
"description": "Custom handlebars template plugin for doxdox.",
4+
"version": "1.0.0",
5+
"main": "index.js",
6+
"license": "MIT",
7+
"dependencies": {
8+
"handlebars": "4.0.5"
9+
},
10+
"devDependencies": {
11+
"@neogeek/eslint-config-standards": "1.6.3",
12+
"eslint": "3.8.1"
13+
},
14+
"scripts": {
15+
"test": "echo \"Error: no test specified\" && exit 1"
16+
},
17+
"keywords": [
18+
"doxdox",
19+
"plugin",
20+
"handlebars"
21+
],
22+
"authors": [
23+
{
24+
"name": "Scott Doxey",
25+
"email": "[email protected]",
26+
"homepage": "http://scottdoxey.com/"
27+
}
28+
],
29+
"homepage": "https://github.com/neogeek/doxdox-plugin-handlebars",
30+
"repository": {
31+
"type": "git",
32+
"url": "git://github.com/neogeek/doxdox-plugin-handlebars.git"
33+
}
34+
}

0 commit comments

Comments
 (0)