mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-18 14:17:30 +00:00
* Source-sorting by default Many changes * Uses a new version of module-deps that exposes a sort key we use to sort documentation. * Adds inference for methods in objects * Groups events into a separate comment property * Add jsdoc property. Refs https://github.com/documentationjs/documentation/pull/388#issuecomment-215791547 * Namespaces and paths * More powerful paths: paths now include name, kind, and scope * comments now include a 'namespace' property with a formatted namespace * Fix tests * Re-ignore fonts * Nix sourceKey from output * Pin dependency versions * Fix module-deps-sortable ref * Update tests for right deps
23 lines
548 B
JavaScript
23 lines
548 B
JavaScript
'use strict';
|
|
|
|
var walk = require('../walk');
|
|
|
|
/**
|
|
* Formats documentation as a JSON string.
|
|
*
|
|
* @param {Array<Object>} comments parsed comments
|
|
* @param {Object} opts Options that can customize the output
|
|
* @param {Function} callback called with null, string
|
|
* @name json
|
|
* @return {undefined} calls callback
|
|
*/
|
|
module.exports = function (comments, opts, callback) {
|
|
|
|
walk(comments, function (comment) {
|
|
delete comment.errors;
|
|
delete comment.context.sortKey;
|
|
});
|
|
|
|
return callback(null, JSON.stringify(comments, null, 2));
|
|
};
|