Browse Source

Added jsdoc2md to generate api reference documentation to markdown, and organized docs into 'api' and 'guide'

patch-2
Braydon Fuller 10 years ago
parent
commit
f89612f9de
  1. 0
      docs/guide/address.md
  2. 0
      docs/guide/block.md
  3. 0
      docs/guide/crypto.md
  4. 0
      docs/guide/ecies.md
  5. 0
      docs/guide/encoding.md
  6. 0
      docs/guide/examples.md
  7. 0
      docs/guide/hierarchical.md
  8. 0
      docs/guide/index.md
  9. 0
      docs/guide/jsonrpc.md
  10. 0
      docs/guide/navigation.md
  11. 0
      docs/guide/networks.md
  12. 0
      docs/guide/paymentprotocol.md
  13. 0
      docs/guide/peer.md
  14. 0
      docs/guide/pool.md
  15. 0
      docs/guide/privatekey.md
  16. 0
      docs/guide/publickey.md
  17. 0
      docs/guide/script.md
  18. 0
      docs/guide/transaction.md
  19. 0
      docs/guide/unit.md
  20. 0
      docs/guide/uri.md
  21. 32
      gulpfile.js
  22. 5
      package.json

0
docs/address.md → docs/guide/address.md

0
docs/block.md → docs/guide/block.md

0
docs/crypto.md → docs/guide/crypto.md

0
docs/ecies.md → docs/guide/ecies.md

0
docs/encoding.md → docs/guide/encoding.md

0
docs/examples.md → docs/guide/examples.md

0
docs/hierarchical.md → docs/guide/hierarchical.md

0
docs/index.md → docs/guide/index.md

0
docs/jsonrpc.md → docs/guide/jsonrpc.md

0
docs/navigation.md → docs/guide/navigation.md

0
docs/Networks.md → docs/guide/networks.md

0
docs/PaymentProtocol.md → docs/guide/paymentprotocol.md

0
docs/peer.md → docs/guide/peer.md

0
docs/pool.md → docs/guide/pool.md

0
docs/privatekey.md → docs/guide/privatekey.md

0
docs/publickey.md → docs/guide/publickey.md

0
docs/script.md → docs/guide/script.md

0
docs/transaction.md → docs/guide/transaction.md

0
docs/unit.md → docs/guide/unit.md

0
docs/uri.md → docs/guide/uri.md

32
gulpfile.js

@ -37,7 +37,10 @@ var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var runSequence = require('run-sequence');
var shell = require('gulp-shell');
var through = require('through2');
var gutil = require('gulp-util');
var jsdoc2md = require('jsdoc-to-markdown');
var mfs = require('more-fs');
var files = ['lib/**/*.js'];
var tests = ['test/**/*.js'];
@ -126,7 +129,32 @@ gulp.task('lint', function() {
gulp.task('plato', shell.task(['plato -d report -r -l .jshintrc -t bitcore lib']));
gulp.task('jsdoc', shell.task(['node_modules/.bin/jsdoc2md lib/address.js > docs/api/address.md']));
gulp.task('jsdoc', function() {
function jsdoc() {
return through.obj(function(file, enc, cb) {
if (file.isNull()){
cb(null, file);
return;
}
if (file.isStream()) {
cb(new gutil.PluginError('gulp-jsdoc2md', 'Streaming not supported'));
return;
}
var destination = 'docs/api/'+file.path.replace(file.base, '').replace(/\.js$/, '.md');
jsdoc2md.render(file.path, {})
.on('error', function(err) {
gutil.log(gutil.colors.red('jsdoc2md failed', err.message));
})
.pipe(mfs.writeStream(destination));
cb(null, file);
});
}
return gulp.src(files).pipe(jsdoc());
});
gulp.task('coverage', shell.task(['node_modules/.bin/./istanbul cover node_modules/.bin/_mocha -- --recursive']));

5
package.json

@ -98,6 +98,7 @@
"gulp-jshint": "^1.9.0",
"gulp-mocha": "^2.0.0",
"gulp-shell": "^0.2.10",
"gulp-util": "^3.0.1",
"ink-docstrap": "git://github.com/bitpay/bitcore-jsdoctemplates.git",
"istanbul": "^0.3.5",
"jsdoc-to-markdown": "=0.5.9",
@ -105,8 +106,10 @@
"karma-firefox-launcher": "^0.1.3",
"karma-mocha": "^0.1.9",
"mocha": "~2.0.1",
"more-fs": "^0.5.0",
"run-sequence": "^1.0.2",
"sinon": "^1.12.2"
"sinon": "^1.12.2",
"through2": "^0.6.3"
},
"license": "MIT"
}

Loading…
Cancel
Save