Skip to content

Commit aec3200

Browse files
author
Jeremy Kahn
committed
Switch from gulp to npm for doc generation
1 parent 84cf135 commit aec3200

File tree

3 files changed

+10
-28
lines changed

3 files changed

+10
-28
lines changed

gulpfile.js

-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
'use strict';
22
var gulp = require('gulp');
3-
var shell = require('gulp-shell');
43
var eslint = require('gulp-eslint');
54
var jasmine = require('gulp-jasmine');
6-
var isWin = /^win/.test(process.platform);
7-
8-
gulp.task('jsdoc', shell.task([
9-
(isWin) ?
10-
'"node_modules/.bin/jsdoc.cmd" -c ./doc-config.json' :
11-
'./node_modules/.bin/jsdoc -c ./doc-config.json'
12-
]));
135

146
gulp.task('test', function () {
157
return gulp.src('test/**/*.spec.js')

package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@
88
},
99
"devDependencies": {
1010
"@jeremyckahn/minami": "^1.3.1",
11-
"gulp-eslint": "^3.0.1",
1211
"gulp": "^3.8.10",
12+
"gulp-eslint": "^3.0.1",
1313
"gulp-jasmine": "^2.0.1",
1414
"gulp-shell": "^0.2.11",
15-
"jsdoc": "3.5.5"
15+
"jsdoc": "3.5.5",
16+
"live-server": "^1.2.0"
1617
},
1718
"scripts": {
18-
"test": "gulp test"
19+
"test": "gulp test",
20+
"doc": "npm run doc:build && npm run doc:view",
21+
"doc:build": "jsdoc -c doc-config.json",
22+
"doc:view": "live-server dist --port=9124"
1923
},
2024
"repository": {
2125
"type": "git",

readme.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,15 @@ npm install
1919

2020
**To setup repository with documentation**
2121

22-
* Go to the parent directory of the `javascript-algorithms` folder and call:
23-
24-
```bash
25-
git clone https://github.com/mgechev/javascript-algorithms.git javascript-algorithms-docs
26-
```
27-
28-
* Go to the `javascript-algorithms-docs` folder and change current branch to `gh-pages`:
29-
3022
```bash
31-
git checkout gh-pages
23+
npm run:doc
3224
```
3325

34-
Now you can see `index.html` file in this folder and open it in your browser.
26+
This will build the documentation and open it in your browser.
3527

3628
**To update .html files with documentation**
3729

38-
Go to the `javascript-algorithms` folder and call:
39-
40-
```bash
41-
gulp jsdoc
42-
```
43-
44-
and all files in `javascript-algorithms-docs` folder will be updated.
30+
Just run `npm run:doc` again.
4531

4632
**To run tests**
4733

0 commit comments

Comments
 (0)