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

Commit a11df4e

Browse files
committed
Initial commit.
0 parents  commit a11df4e

File tree

7 files changed

+173
-0
lines changed

7 files changed

+173
-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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# doxdox-plugin-markdown
2+
3+
> Markdown template plugin for doxdox.
4+
5+
## Install
6+
7+
```bash
8+
$ npm install doxdox doxdox-plugin-markdown --save-dev
9+
```
10+
11+
## Usage
12+
13+
```bash
14+
$ doxdox lib/ --layout markdown --output DOCUMENTATION.md
15+
```

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(__dirname, './template.hbs'), '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-markdown",
3+
"description": "Markdown 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.0"
13+
},
14+
"scripts": {
15+
"test": "echo \"Error: no test specified\" && exit 1"
16+
},
17+
"keywords": [
18+
"doxdox",
19+
"plugin",
20+
"markdown"
21+
],
22+
"authors": [
23+
{
24+
"name": "Scott Doxey",
25+
"email": "hello@scottdoxey.com",
26+
"homepage": "http://scottdoxey.com/"
27+
}
28+
],
29+
"homepage": "https://github.com/neogeek/doxdox-plugin-markdown",
30+
"repository": {
31+
"type": "git",
32+
"url": "git://github.com/neogeek/doxdox-plugin-markdown.git"
33+
}
34+
}

template.hbs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{{#if pkg.homepage}}
2+
# [{{title}}]({{pkg.homepage}}) {{#if pkg.version}}*{{pkg.version}}*{{/if}}
3+
{{else}}
4+
# {{title}} {{#if pkg.version}}*{{pkg.version}}*{{/if}}
5+
{{/if}}
6+
7+
{{#if description}}
8+
> {{description}}
9+
{{/if}}
10+
11+
{{#each files}}
12+
13+
### {{name}}
14+
15+
{{#each methods}}
16+
17+
#### {{name}}({{params}}) {{#if isPrivate}} *private method*{{/if}}
18+
19+
{{{description}}}
20+
21+
{{{body}}}
22+
23+
{{#if tags.param}}
24+
25+
##### Parameters
26+
27+
{{#each tags.param}}
28+
- **{{name}}** {{#each types}}`{{.}}` {{/each}} {{#if isOptional}}*Optional*{{/if}} {{{description}}}
29+
{{/each}}
30+
31+
{{/if}}
32+
33+
{{#if tags.property}}
34+
35+
##### Properties
36+
37+
{{#each tags.property}}
38+
- **{{name}}** {{#each types}}`{{.}}` {{/each}} {{#if isOptional}}*Optional*{{/if}} {{{description}}}
39+
{{/each}}
40+
41+
{{/if}}
42+
43+
{{#if tags.example}}
44+
45+
##### Examples
46+
47+
{{#each tags.example}}
48+
```javascript
49+
{{{.}}}
50+
```
51+
{{/each}}
52+
53+
{{/if}}
54+
55+
##### Returns
56+
57+
{{#if tags.return}}
58+
59+
{{#each tags.return}}
60+
- {{#each types}}`{{.}}` {{/each}} {{#if isOptional}}*Optional*{{/if}} {{{description}}}
61+
{{/each}}
62+
63+
{{else}}
64+
65+
- `Void`
66+
67+
{{/if}}
68+
69+
{{/each}}
70+
71+
{{/each}}
72+
73+
*Documentation generated with [doxdox](https://github.com/neogeek/doxdox).*

0 commit comments

Comments
 (0)