Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 816dde1

Browse files
authored
Merge pull request #24 from documentationjs/update
Update to documentation v4 and modernize
2 parents 48446f6 + 556cd6b commit 816dde1

File tree

21 files changed

+199
-1727
lines changed

21 files changed

+199
-1727
lines changed

‎.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
html-documentation
2+
test-manual

‎.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test
2+
test-manual

‎CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## 3.0.0
2+
3+
- Updates documentation to v4.0.0-beta12
4+
- Removes ability to pass a `documentation` instance. This would not survive
5+
major version shifts.
6+
- Switches test framework from prova to tap
7+
- Removes generated documentation results from repo

‎README.md

Lines changed: 65 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,89 @@ Use [gulp](http://gulpjs.com/) with
66
[documentation](https://github.com/documentationjs/documentation)
77
to generate great documentation for your JavaScript projects.
88

9-
| name | description |
10-
| ---- | ----------- |
11-
| `options` | output options |
12-
| `options.format` | either 'html', 'md', 'json', or 'docset' |
13-
| `options.filename` | custom filename for md or json output |
14-
15-
Returns `stream.Transform`
16-
179
## Installation
1810

1911
```sh
2012
$ npm install --save-dev gulp-documentation
2113
```
2214

23-
## Example
15+
## API
16+
17+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
18+
19+
### documentation
20+
21+
Documentation stream intended for use within the gulp system.
22+
23+
**Parameters**
2424

25-
```js
26-
var documentation = require('gulp-documentation'),
27-
gulp = require('gulp');
25+
- `format` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** format - one of 'html', 'md', or 'json' (optional, default `md`)
26+
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** documentation options - the same as given to [documentation](https://github.com/documentationjs/documentation)
27+
- `options.filename` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** custom filename for md or json output
28+
- `formatterOptions` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** output options - same as given to documentation
29+
- `formatterOptions.name` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** if format is HTML, specifies the name of the project
2830

31+
**Examples**
32+
33+
```javascript
34+
var gulpDocumentation = require('gulp-documentation'),
35+
var gulp = require('gulp');
36+
// Out of the box, you can generate JSON, HTML, and Markdown documentation
2937
gulp.task('documentation', function () {
3038

39+
// Generating README documentation
3140
gulp.src('./index.js')
32-
.pipe(documentation({ format:'md' }))
41+
.pipe(gulpDocumentation('md'))
3342
.pipe(gulp.dest('md-documentation'));
3443

44+
// Generating a pretty HTML documentation site
3545
gulp.src('./index.js')
36-
.pipe(documentation({ format:'html' }))
46+
.pipe(gulpDocumentation('html))
3747
.pipe(gulp.dest('html-documentation'));
3848
49+
// Generating raw JSON documentation output
3950
gulp.src('./index.js')
40-
.pipe(documentation({ format:'json' }))
51+
.pipe(gulpDocumentation('json'))
4152
.pipe(gulp.dest('json-documentation'));
4253
54+
});
55+
56+
// Generate documentation for multiple files using normal glob syntax.
57+
// Note that this generates one documentation output, so that it can
58+
// easily cross-reference and use types.
59+
gulp.task('documentation-multiple-files', function () {
60+
61+
gulp.src('./src/*.js')
62+
.pipe(gulpDocumentation({ format: 'md' }))
63+
.pipe(gulp.dest('md-documentation'));
64+
65+
});
66+
67+
68+
// If you're using HTML documentation, you can specify additional 'name'
69+
// and 'version' options
70+
gulp.task('documentation-html-options', function () {
71+
72+
gulp.src('./src/*.js')
73+
.pipe(gulpDocumentation('html', {}, {
74+
name: 'My Project',
75+
version: '1.0.0'
76+
}))
77+
.pipe(gulp.dest('html-documentation'));
78+
79+
});
80+
81+
// Document non-JavaScript files with JSDoc comments using polyglot: true
82+
gulp.task('documentation-for-cplusplus', function () {
83+
84+
gulp.src('./src/*.cpp')
85+
.pipe(gulpDocumentation('html', { polyglot: true }, {
86+
name: 'My Project',
87+
version: '1.0.0'
88+
}))
89+
.pipe(gulp.dest('html-documentation'));
90+
4391
});
4492
```
93+
94+
Returns **[stream.Transform](https://nodejs.org/api/stream.html#stream_class_stream_transform)**

‎circle.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
machine:
2+
node:
3+
version: 4

‎html-documentation/assets/anchor.js

Lines changed: 0 additions & 197 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /