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

Commit 88da1ce

Browse files
committed
Initial commit.
0 parents  commit 88da1ce

File tree

8 files changed

+489
-0
lines changed

8 files changed

+489
-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-bootstrap
2+
3+
> Bootstrap template plugin for doxdox.
4+
5+
[![NPM Version](http://img.shields.io/npm/v/doxdox-plugin-bootstrap.svg?style=flat)](https://www.npmjs.org/package/doxdox-plugin-bootstrap)
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-bootstrap --save-dev
12+
```
13+
14+
## Usage
15+
16+
```bash
17+
$ doxdox lib/ --layout bootstrap --output DOCUMENTATION.html
18+
```

helpers.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const Handlebars = require('handlebars');
2+
3+
const hljs = require('highlight.js');
4+
const markdown = require('markdown-it')({
5+
highlight (code) {
6+
7+
return hljs.highlight('javascript', code).value;
8+
9+
},
10+
'html': true
11+
});
12+
13+
Handlebars.registerHelper('highlightBlock', block => {
14+
15+
if (block) {
16+
17+
return hljs.highlight('javascript', block).value;
18+
19+
}
20+
21+
return null;
22+
23+
});
24+
25+
Handlebars.registerHelper('markdown', block => {
26+
27+
if (block) {
28+
29+
return markdown.render(block);
30+
31+
}
32+
33+
return null;
34+
35+
});

index.js

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

package.json

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

0 commit comments

Comments
 (0)