Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Auto generate api.md using mocha #146

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
695 changes: 695 additions & 0 deletions API.md

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,18 @@ ipfs daemon

## API

### Level 1 Commands
Level 1 commands are simple commands
You can find more detailed documentation with examples at [API.md](/API.md).




-----------------------------------------------------------------------------

### Previous API Docs

#### add

Add a file (where file is any data) to ipfs returning the hash and name. The
name value will only be set if you are actually sending a file. A single or
array of files can be used.
Add a file (where file is any data) to ipfs returning the hash and name. The name value will only be set if you are actually sending a file. A single or array of files can be used.

**Usage**
```javascript
Expand All @@ -84,8 +88,7 @@ ipfs.add(files, function(err, res) {
})
})
```
`files` can be a mixed array of filenames or buffers of data. A single value is
also acceptable.
`files` can be a mixed array of filenames or buffers of data. A single value is also acceptable.

Example
```js
Expand Down Expand Up @@ -185,9 +188,6 @@ curl "http://localhost:5001/api/v0/ls?arg=<hash>&stream-channels=true"

**commands**

### Level 2 Commands
Level 2 commands are simply named spaced wrapped commands

#### Config

#### Update
Expand Down
22 changes: 0 additions & 22 deletions examples/add.js

This file was deleted.

18 changes: 0 additions & 18 deletions examples/cat.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/files/hello.txt

This file was deleted.

1 change: 0 additions & 1 deletion examples/files/ipfs.txt

This file was deleted.

12 changes: 0 additions & 12 deletions examples/ipfs-add.js

This file was deleted.

18 changes: 0 additions & 18 deletions examples/ls.js

This file was deleted.

8 changes: 0 additions & 8 deletions examples/version.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"gulp-filter": "^3.0.1",
"gulp-git": "^1.6.0",
"gulp-load-plugins": "^1.0.0",
"gulp-mocha": "^2.1.3",
"gulp-size": "^2.0.0",
"gulp-tag-version": "^1.3.0",
"gulp-spawn-mocha": "^2.2.1",
"gulp-util": "^3.0.7",
"https-browserify": "0.0.1",
"ipfsd-ctl": "^0.6.1",
Expand Down
27 changes: 23 additions & 4 deletions tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ gulp.task('test:node', done => {
)
})

gulp.task('docs', done => {
runSequence(
'daemons:start',
'mocha:docs',
'daemons:stop',
done
)
})

gulp.task('test:browser', done => {
runSequence(
'daemons:start',
Expand All @@ -39,10 +48,20 @@ gulp.task('mocha', () => {
return gulp.src([
'test/setup.js',
'test/**/*.spec.js'
])
.pipe($.mocha({
timeout: config.webpack.dev.timeout
}))
]).pipe($.spawnMocha({
timeout: config.webpack.dev.timeout
}))
})

gulp.task('mocha:docs', function () {
return gulp.src([
'test/setup.js',
'test/**/*.spec.js'
]).pipe($.spawnMocha({
timeout: config.webpack.dev.timeout,
reporter: 'markdown',
output: 'API.md'
}))
})

gulp.task('karma', done => {
Expand Down