-
-
+
+
+
-
<%- options.name %>
-
<%- options.version %>
+
<%- config['project-name'] %>
+
<%- config['project-version'] %>
@@ -37,7 +42,7 @@
Static members
<% doc.members.static.forEach(function(member) { %>
.<%- member.name %>
@@ -49,7 +54,19 @@
Instance members
<% doc.members.instance.forEach(function(member) { %>
+ #<%- member.name %>
+
+ <% }) %>
+
+ <% } %>
+ <% if (doc.members.inner && doc.members.inner.length) { %>
+
+ Inner members
+ <% doc.members.inner.forEach(function(member) { %>
+
#<%- member.name %>
@@ -61,7 +78,7 @@
Events
<% doc.members.events.forEach(function(member) { %>
ⓔ <%- member.name %>
@@ -75,26 +92,27 @@
-
+
<% docs.forEach(function(s) { %>
- <% if (s.kind !== 'note') { %>
- <%= renderSection({
- section: s,
- renderSection: renderSection,
- renderSectionList: renderSectionList
- }) %>
- <% } else { %>
+ <% if (s.kind === 'note' && !s.children) { %>
<%=renderNote({ note: s })%>
+ <% } else { %>
+ <%= renderSection({
+ section: s,
+ renderSection: renderSection,
+ renderSectionList: renderSectionList,
+ renderParamProperty: renderParamProperty
+ }) %>
<% } %>
<% }) %>
-
+
diff --git a/src/default_theme/index.js b/src/default_theme/index.js
new file mode 100644
index 000000000..19eace3be
--- /dev/null
+++ b/src/default_theme/index.js
@@ -0,0 +1,142 @@
+import fs from 'fs/promises';
+import path from 'path';
+import template from 'lodash/template.js';
+import GithubSlugger from 'github-slugger';
+import { util } from '../index.js';
+import hljs from 'highlight.js';
+import { fileURLToPath } from 'url';
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
+
+const { LinkerStack, createFormatters } = util;
+
+async function copyDir(sorce, dest) {
+ await fs.mkdir(dest, { recursive: true });
+ let entries = await fs.readdir(sorce, { withFileTypes: true });
+
+ for (let entry of entries) {
+ let srcPath = path.join(sorce, entry.name);
+ let destPath = path.join(dest, entry.name);
+
+ entry.isDirectory()
+ ? await copyDir(srcPath, destPath)
+ : await fs.copyFile(srcPath, destPath);
+ }
+}
+
+function isFunction(section) {
+ return (
+ section.kind === 'function' ||
+ (section.kind === 'typedef' &&
+ section.type &&
+ section.type.type === 'NameExpression' &&
+ section.type.name === 'Function')
+ );
+}
+
+const slugger = new GithubSlugger();
+const slugs = {};
+
+function getSlug(str) {
+ if (slugs[str] === undefined) {
+ slugs[str] = slugger.slug(str);
+ }
+ return slugs[str];
+}
+
+export default async function (comments, config) {
+ var linkerStack = new LinkerStack(config).namespaceResolver(
+ comments,
+ function (namespace) {
+ return '#' + getSlug(namespace);
+ }
+ );
+
+ var formatters = createFormatters(linkerStack.link);
+
+ hljs.configure(config.hljs || {});
+
+ var sharedImports = {
+ imports: {
+ slug(str) {
+ return getSlug(str);
+ },
+ shortSignature(section) {
+ var prefix = '';
+ if (section.kind === 'class') {
+ prefix = 'new ';
+ } else if (!isFunction(section)) {
+ return section.name;
+ }
+ return prefix + section.name + formatters.parameters(section, true);
+ },
+ signature(section) {
+ var returns = '';
+ var prefix = '';
+ if (section.kind === 'class') {
+ prefix = 'new ';
+ } else if (!isFunction(section)) {
+ return section.name;
+ }
+ if (section.returns.length) {
+ returns = ': ' + formatters.type(section.returns[0].type);
+ }
+ return prefix + section.name + formatters.parameters(section) + returns;
+ },
+ md(ast, inline) {
+ if (
+ inline &&
+ ast &&
+ ast.children.length &&
+ ast.children[0].type === 'paragraph'
+ ) {
+ ast = {
+ type: 'root',
+ children: ast.children[0].children.concat(ast.children.slice(1))
+ };
+ }
+ return formatters.markdown(ast);
+ },
+ formatType: formatters.type,
+ autolink: formatters.autolink,
+ highlight(example) {
+ if (config.hljs && config.hljs.highlightAuto) {
+ return hljs.highlightAuto(example).value;
+ }
+ return hljs.highlight(example, { language: 'js' }).value;
+ }
+ }
+ };
+
+ sharedImports.imports.renderSectionList = template(
+ await fs.readFile(path.join(__dirname, 'section_list._'), 'utf8'),
+ sharedImports
+ );
+ sharedImports.imports.renderSection = template(
+ await fs.readFile(path.join(__dirname, 'section._'), 'utf8'),
+ sharedImports
+ );
+ sharedImports.imports.renderNote = template(
+ await fs.readFile(path.join(__dirname, 'note._'), 'utf8'),
+ sharedImports
+ );
+ sharedImports.imports.renderParamProperty = template(
+ await fs.readFile(path.join(__dirname, 'paramProperty._'), 'utf8'),
+ sharedImports
+ );
+
+ var pageTemplate = template(
+ await fs.readFile(path.join(__dirname, 'index._'), 'utf8'),
+ sharedImports
+ );
+
+ const string = pageTemplate({ docs: comments, config });
+
+ if (!config.output) {
+ return string;
+ }
+
+ await copyDir(__dirname + '/assets/', config.output + '/assets/');
+ await fs.writeFile(config.output + '/index.html', string, 'utf8');
+}
diff --git a/default_theme/note._ b/src/default_theme/note._
similarity index 68%
rename from default_theme/note._
rename to src/default_theme/note._
index f98b2a444..cebebc13c 100644
--- a/default_theme/note._
+++ b/src/default_theme/note._
@@ -1,10 +1,10 @@
-
+
<%- note.name %>
<% if (note.description) { %>
<%= md(note.description) %>
<% } %>
-
+
\ No newline at end of file
diff --git a/src/default_theme/paramProperty._ b/src/default_theme/paramProperty._
new file mode 100644
index 000000000..5291b2be3
--- /dev/null
+++ b/src/default_theme/paramProperty._
@@ -0,0 +1,15 @@
+
+ <%- property.name %> <%= formatType(property.type) %>
+ <% if (property.default) { %>
+ (default <%- property.default %>
)
+ <% } %>
+ <%= md(property.description, true) %>
+
+<% if(property.properties && property.properties.length) { %>
+ <% property.properties.forEach(function(childProperty) { %>
+ <%= renderParamProperty({
+ property: childProperty,
+ renderParamProperty: renderParamProperty
+ }) %>
+ <% }) %>
+<% } %>
diff --git a/default_theme/section._ b/src/default_theme/section._
similarity index 69%
rename from default_theme/section._
rename to src/default_theme/section._
index 06f7bd2f4..cd30107e5 100644
--- a/default_theme/section._
+++ b/src/default_theme/section._
@@ -8,18 +8,22 @@
<% } %>
<% if (section.context && section.context.github) { %>
-
- <%= section.context.path %>
+
+ <%= section.context.github.path %>
<% } %>
<% } %>
<%= md(section.description) %>
-
-
<%= signature(section) %>
-
- <% if (section.augments) { %>
+
<%= signature(section) %>
+ <% if (section.type) { %>
+
+ Type:
+ <%= formatType(section.type) %>
+
+ <% } %>
+ <% if (section.augments && section.augments.length) { %>
Extends
<% if (section.augments) { %>
@@ -30,13 +34,14 @@
<% } %>
+ <% if (section.deprecated) { %>
Deprecated: <%= md(section.deprecated, true) %>
<% }%>
<% if (section.version) { %>
Version: <%- section.version %>
<% }%>
<% if (section.license) { %>
License: <%- section.license %>
<% }%>
<% if (section.author) { %>
Author: <%- section.author %>
<% }%>
- <% if (section.copyright) { %>
Copyright: <%- section.copyright %>
<% }%>
+ <% if (section.copyright) { %>
Copyright: <%= md(section.copyright, true) %>
<% }%>
<% if (section.since) { %>
Since: <%- section.since %>
<% }%>
- <% if (section.params) { %>
+ <% if (section.params && section.params.length) { %>
Parameters
<% section.params.forEach(function(param) { %>
@@ -46,7 +51,7 @@
= <%- param.default %>
<% } %>)
<%= md(param.description, true) %>
- <% if (param.properties) { %>
+ <% if (param.properties && param.properties.length) { %>
@@ -60,13 +65,10 @@
<% param.properties.forEach(function(property) { %>
-
- <%- property.name %> <%= formatType(property.type) %>
- <% if (property.default) { %>
- (default <%- property.default %>
)
- <% } %>
- <%= md(property.description, true) %>
-
+ <%= renderParamProperty({
+ property: property,
+ renderParamProperty: renderParamProperty
+ }) %>
<% }) %>
@@ -76,7 +78,7 @@
<% } %>
- <% if (section.properties) { %>
+ <% if (section.properties && section.properties.length) { %>
Properties
<% section.properties.forEach(function(property) { %>
@@ -87,7 +89,7 @@
<% } %><% if (property.description) {
%>: <%= md(property.description, true) %><%
} %>
- <% if (property.properties) { %>
+ <% if (property.properties && property.properties.length) { %>
<% property.properties.forEach(function(property) { %>
<%- property.name %>
<%= formatType(property.type) %>
@@ -103,7 +105,7 @@
<% } %>
- <% if (section.returns) { %>
+ <% if (section.returns && section.returns.length) { %>
<% section.returns.forEach(function(ret) { %>
Returns
<%= formatType(ret.type) %>
<% if (ret.description) { %>:
@@ -112,7 +114,16 @@
<% }) %>
<% } %>
- <% if (section.throws) { %>
+ <% if (section.sees && section.sees.length) { %>
+
Related
+ <% section.sees.forEach(function(see) { %>
+ <% if (see.description) { %>
+ <%= md(see.description, true) %>
+ <% }%>
+ <% }) %>
+ <% } %>
+
+ <% if (section.throws && section.throws.length) { %>
Throws
<% section.throws.forEach(function(throws) { %>
@@ -121,7 +132,7 @@
<% } %>
- <% if (section.examples) { %>
+ <% if (section.examples && section.examples.length) { %>
Example
<% section.examples.forEach(function(example) { %>
<% if (example.caption) { %>
<%= md(example.caption) %>
<% } %>
@@ -131,16 +142,21 @@
<% if (section.members.static && section.members.static.length) { %>
Static Members
- <%= renderSectionList({ members: section.members.static, renderSection: renderSection, noun: 'Static Member' }) %>
+ <%= renderSectionList({ members: section.members.static, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Static Member' }) %>
<% } %>
<% if (section.members.instance && section.members.instance.length) { %>
Instance Members
- <%= renderSectionList({ members: section.members.instance, renderSection: renderSection, noun: 'Instance Member' }) %>
+ <%= renderSectionList({ members: section.members.instance, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Instance Member' }) %>
+ <% } %>
+
+ <% if (section.members.inner && section.members.inner.length) { %>
+
Inner Members
+ <%= renderSectionList({ members: section.members.inner, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Inner Member' }) %>
<% } %>
<% if (section.members.events && section.members.events.length) { %>
Events
- <%= renderSectionList({ members: section.members.events, renderSection: renderSection, noun: 'Event' }) %>
+ <%= renderSectionList({ members: section.members.events, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Event' }) %>
<% } %>
diff --git a/default_theme/section_list._ b/src/default_theme/section_list._
similarity index 79%
rename from default_theme/section_list._
rename to src/default_theme/section_list._
index 904483ccc..60d80ac32 100644
--- a/default_theme/section_list._
+++ b/src/default_theme/section_list._
@@ -1,6 +1,6 @@
<% members.forEach(function(member) { %>
-
+
▸
@@ -11,7 +11,8 @@
<%= renderSection({
section: member,
renderSection: renderSection,
- nested: true
+ renderParamProperty: renderParamProperty,
+ nested: true
}) %>
diff --git a/src/extractors/comments.js b/src/extractors/comments.js
new file mode 100644
index 000000000..2ab7dc884
--- /dev/null
+++ b/src/extractors/comments.js
@@ -0,0 +1,61 @@
+import babelTraverse from '@babel/traverse';
+import isJSDocComment from '../is_jsdoc_comment.js';
+
+const traverse = babelTraverse.default || babelTraverse;
+
+/**
+ * Iterate through the abstract syntax tree, finding a different kind of comment
+ * each time, and optionally including context. This is how we find
+ * JSDoc annotations that will become part of documentation
+ * @param type comment type to find
+ * @param includeContext to include context in the nodes
+ * @param ast the babel-parsed syntax tree
+ * @param data the filename and the source of the file the comment is in
+ * @param addComment a method that creates a new comment if necessary
+ * @returns comments
+ * @private
+ */
+export default function walkComments(
+ type,
+ includeContext,
+ ast,
+ data,
+ addComment
+) {
+ const newResults = [];
+
+ traverse(ast, {
+ /**
+ * Process a parse in an abstract syntax tree
+ * @param {Object} path ast path
+ * @returns {undefined} causes side effects
+ * @private
+ */
+ enter(path) {
+ /**
+ * Parse a comment with doctrine and decorate the result with file position and code context.
+ *
+ * @param {Object} comment the current state of the parsed JSDoc comment
+ * @returns {undefined} this emits data
+ */
+ function parseComment(comment) {
+ newResults.push(
+ addComment(
+ data,
+ comment.value,
+ comment.loc,
+ path,
+ path.node.loc,
+ includeContext
+ )
+ );
+ }
+
+ (path.node[type] || []).filter(isJSDocComment).forEach(parseComment);
+ }
+ });
+
+ traverse.cache.clear();
+
+ return newResults;
+}
diff --git a/src/extractors/exported.js b/src/extractors/exported.js
new file mode 100644
index 000000000..da6f8955b
--- /dev/null
+++ b/src/extractors/exported.js
@@ -0,0 +1,356 @@
+import babelTraverse from '@babel/traverse';
+import isJSDocComment from '../is_jsdoc_comment.js';
+import t from '@babel/types';
+import nodePath from 'path';
+import fs from 'fs';
+import { parseToAst } from '../parsers/parse_to_ast.js';
+import findTarget from '../infer/finders.js';
+import { createRequire } from 'module';
+
+const require = createRequire(import.meta.url);
+const traverse = babelTraverse.default || babelTraverse;
+
+/**
+ * Iterate through the abstract syntax tree, finding ES6-style exports,
+ * and inserting blank comments into documentation.js's processing stream.
+ * Through inference steps, these comments gain more information and are automatically
+ * documented as well as we can.
+ * @param {Object} config
+ * @param {Object} [config.extensions] extensions to try when resolving
+ * @param {Object} ast the babel-parsed syntax tree
+ * @param {Object} data the name of the file
+ * @param {Function} addComment a method that creates a new comment if necessary
+ * @returns {Array
} comments
+ * @private
+ */
+export default function walkExported(
+ config /* { extensions?: string[] } */,
+ ast,
+ data /*: {
+ file: string
+} */,
+ addComment
+) {
+ const newResults = [];
+ const filename = data.file;
+ const dataCache = new Map();
+
+ function addBlankComment(data, path, node) {
+ return addComment(data, '', node.loc, path, node.loc, true);
+ }
+
+ function getComments(data, path) {
+ const comments = (path.node.leadingComments || []).filter(isJSDocComment);
+
+ if (!comments.length) {
+ // If this is the first declarator we check for comments on the VariableDeclaration.
+ if (
+ t.isVariableDeclarator(path) &&
+ path.parentPath.get('declarations')[0] === path
+ ) {
+ return getComments(data, path.parentPath);
+ }
+
+ const added = addBlankComment(data, path, path.node);
+ return added ? [added] : [];
+ }
+
+ return comments
+ .map(function (comment) {
+ return addComment(
+ data,
+ comment.value,
+ comment.loc,
+ path,
+ path.node.loc,
+ true
+ );
+ })
+ .filter(Boolean);
+ }
+
+ function addComments(data, path, overrideName) {
+ const comments = getComments(data, path);
+ if (overrideName) {
+ comments.forEach(function (comment) {
+ comment.name = overrideName;
+ });
+ }
+ newResults.push.apply(newResults, comments);
+ }
+
+ traverse(ast, {
+ Statement(path) {
+ path.skip();
+ },
+ ExportDeclaration(path) {
+ const declaration = path.get('declaration');
+ if (t.isDeclaration(declaration)) {
+ traverseExportedSubtree(declaration, data, addComments);
+ return path.skip();
+ }
+
+ if (path.isExportDefaultDeclaration()) {
+ if (declaration.isIdentifier()) {
+ const binding = declaration.scope.getBinding(declaration.node.name);
+ traverseExportedSubtree(binding.path, data, addComments);
+ return path.skip();
+ }
+
+ traverseExportedSubtree(declaration, data, addComments);
+ return path.skip();
+ }
+
+ if (t.isExportNamedDeclaration(path)) {
+ const specifiers = path.get('specifiers');
+ const source = path.node.source;
+ const exportKind = path.node.exportKind;
+ specifiers.forEach(specifier => {
+ let specData = data;
+ let local;
+ if (t.isExportDefaultSpecifier(specifier)) {
+ local = 'default';
+ } else {
+ // ExportSpecifier
+ local = specifier.node.local.name;
+ }
+ const exported = specifier.node.exported.name;
+
+ let bindingPath;
+ if (source) {
+ const tmp = findExportDeclaration(
+ dataCache,
+ local,
+ exportKind,
+ filename,
+ source.value,
+ config.extensions
+ );
+ bindingPath = tmp.ast;
+ specData = tmp.data;
+ } else if (exportKind === 'value') {
+ bindingPath = path.scope.getBinding(local).path;
+ } else if (exportKind === 'type') {
+ bindingPath = findLocalType(path.scope, local);
+ } else {
+ throw new Error('Unreachable');
+ }
+
+ if (bindingPath === undefined) {
+ throw new Error(
+ `Unable to find the value ${exported} in ${specData.file}`
+ );
+ }
+ traverseExportedSubtree(bindingPath, specData, addComments, exported);
+ });
+ return path.skip();
+ }
+ }
+ });
+
+ return newResults;
+}
+
+function traverseExportedSubtree(path, data, addComments, overrideName) {
+ let attachCommentPath = path;
+ if (path.parentPath && path.parentPath.isExportDeclaration()) {
+ attachCommentPath = path.parentPath;
+ }
+ addComments(data, attachCommentPath, overrideName);
+
+ let target = findTarget(path);
+ if (!target) {
+ return;
+ }
+
+ if (t.isVariableDeclarator(target) && target.has('init')) {
+ target = target.get('init');
+ }
+
+ if (target.isClass() || target.isObjectExpression()) {
+ target.traverse({
+ Property(path) {
+ addComments(data, path);
+ path.skip();
+ },
+ Method(path) {
+ // Don't explicitly document constructor methods: their
+ // parameters are output as part of the class itself.
+ if (path.node.kind !== 'constructor') {
+ addComments(data, path);
+ }
+ path.skip();
+ }
+ });
+ }
+}
+
+function resolveFile(filePath, extensions = []) {
+ try {
+ // First try resolving the file with the default extensions.
+ return require.resolve(filePath);
+ } catch {
+ // If that fails, try resolving the file with the extensions passed in.
+ }
+
+ // Then try all other extensions in order.
+ for (const extension of extensions) {
+ try {
+ return require.resolve(
+ `${filePath}${extension.startsWith('.') ? extension : `.${extension}`}`
+ );
+ } catch {
+ continue;
+ }
+ }
+
+ throw new Error(
+ `Could not resolve \`${filePath}\` with any of the extensions: ${[
+ ...require.extensions,
+ ...extensions
+ ].join(', ')}`
+ );
+}
+
+function getCachedData(dataCache, filePath, extensions) {
+ const path = resolveFile(filePath, extensions);
+
+ let value = dataCache.get(path);
+ if (!value) {
+ const input = fs.readFileSync(path, 'utf-8');
+ const ast = parseToAst(input, path);
+ value = {
+ data: {
+ file: path,
+ source: input
+ },
+ ast
+ };
+ dataCache.set(path, value);
+ }
+ return value;
+}
+
+// Loads a module and finds the exported declaration.
+function findExportDeclaration(
+ dataCache,
+ name,
+ exportKind,
+ referrer,
+ filename,
+ extensions
+) {
+ const depPath = nodePath.resolve(nodePath.dirname(referrer), filename);
+ const tmp = getCachedData(dataCache, depPath, extensions);
+ const ast = tmp.ast;
+ let data = tmp.data;
+
+ let rv;
+ traverse(ast, {
+ Statement(path) {
+ path.skip();
+ },
+ ExportDeclaration(path) {
+ if (name === 'default' && path.isExportDefaultDeclaration()) {
+ rv = path.get('declaration');
+ path.stop();
+ } else if (path.isExportNamedDeclaration()) {
+ const declaration = path.get('declaration');
+ if (t.isDeclaration(declaration)) {
+ let bindingName;
+ if (
+ declaration.isFunctionDeclaration() ||
+ declaration.isClassDeclaration() ||
+ declaration.isTypeAlias() ||
+ declaration.isOpaqueType()
+ ) {
+ bindingName = declaration.node.id.name;
+ } else if (declaration.isVariableDeclaration()) {
+ // TODO: Multiple declarations.
+ bindingName = declaration.node.declarations[0].id.name;
+ }
+ if (name === bindingName) {
+ rv = declaration;
+ path.stop();
+ } else {
+ path.skip();
+ }
+ return;
+ }
+
+ // export {x as y}
+ // export {x as y} from './file.js'
+ const specifiers = path.get('specifiers');
+ const source = path.node.source;
+ for (let i = 0; i < specifiers.length; i++) {
+ const specifier = specifiers[i];
+ let local, exported;
+ if (t.isExportDefaultSpecifier(specifier)) {
+ // export x from ...
+ local = 'default';
+ exported = specifier.node.exported.name;
+ } else {
+ // ExportSpecifier
+ local = specifier.node.local.name;
+ exported = specifier.node.exported.name;
+ }
+ if (exported === name) {
+ if (source) {
+ // export {local as exported} from './file.js';
+ const tmp = findExportDeclaration(
+ dataCache,
+ local,
+ exportKind,
+ depPath,
+ source.value,
+ extensions
+ );
+ rv = tmp.ast;
+ data = tmp.data;
+ if (!rv) {
+ throw new Error(`${name} is not exported by ${depPath}`);
+ }
+ } else {
+ // export {local as exported}
+ if (exportKind === 'value') {
+ rv = path.scope.getBinding(local).path;
+ } else {
+ rv = findLocalType(path.scope, local);
+ }
+ if (!rv) {
+ throw new Error(`${depPath} has no binding for ${name}`);
+ }
+ }
+ path.stop();
+ return;
+ }
+ }
+ }
+ }
+ });
+
+ return {
+ ast: rv,
+ data
+ };
+}
+
+// Since we cannot use scope.getBinding for types this walks the current scope looking for a
+// top-level type alias.
+function findLocalType(scope, local) {
+ let rv;
+ scope.path.traverse({
+ Statement(path) {
+ path.skip();
+ },
+ TypeAlias(path) {
+ if (path.node.id.name === local) {
+ rv = path;
+ path.stop();
+ } else {
+ path.skip();
+ }
+ }
+ });
+ return rv;
+}
diff --git a/lib/filter_access.js b/src/filter_access.js
similarity index 70%
rename from lib/filter_access.js
rename to src/filter_access.js
index d32564b64..610aa3fa5 100644
--- a/lib/filter_access.js
+++ b/src/filter_access.js
@@ -1,6 +1,4 @@
-'use strict';
-
-var walk = require('./walk');
+import walk from './walk.js';
/**
* Exclude given access levels from the generated documentation: this allows
@@ -9,18 +7,18 @@ var walk = require('./walk');
*
* @param {Array} [levels=['public', 'undefined', 'protected']] included access levels.
* @param {Array} comments parsed comments (can be nested)
- * @return {Array} filtered comments
+ * @returns {Array} filtered comments
*/
function filterAccess(levels, comments) {
- levels = levels || ['public', 'undefined', 'protected'];
-
function filter(comment) {
- return comment.kind === 'note' ||
- (!comment.ignore && levels.indexOf(String(comment.access)) !== -1);
+ return (
+ comment.kind === 'note' ||
+ (!comment.ignore && levels.indexOf(String(comment.access)) !== -1)
+ );
}
function recurse(comment) {
- for (var scope in comment.members) {
+ for (const scope in comment.members) {
comment.members[scope] = comment.members[scope].filter(filter);
}
}
@@ -28,4 +26,4 @@ function filterAccess(levels, comments) {
return walk(comments.filter(filter), recurse);
}
-module.exports = filterAccess;
+export default filterAccess;
diff --git a/src/flow_doctrine.js b/src/flow_doctrine.js
new file mode 100644
index 000000000..f81f2ffc8
--- /dev/null
+++ b/src/flow_doctrine.js
@@ -0,0 +1,169 @@
+import generator from '@babel/generator';
+const generate = generator.default || generator;
+
+const namedTypes = {
+ NumberTypeAnnotation: 'number',
+ BooleanTypeAnnotation: 'boolean',
+ StringTypeAnnotation: 'string',
+ SymbolTypeAnnotation: 'symbol'
+};
+
+const oneToOne = {
+ AnyTypeAnnotation: 'AllLiteral',
+ MixedTypeAnnotation: 'AllLiteral',
+ NullLiteralTypeAnnotation: 'NullLiteral',
+ VoidTypeAnnotation: 'VoidLiteral'
+};
+
+function propertyToField(property) {
+ if (!property.value) return null;
+
+ let type = flowDoctrine(property.value);
+ if (property.optional) {
+ // Doctrine does not support optional fields but it does have something called optional types
+ // (which makes no sense, but let's play along).
+ type = {
+ type: 'OptionalType',
+ expression: type
+ };
+ }
+ return {
+ type: 'FieldType',
+ key: property.key.name || property.key.value,
+ value: type
+ };
+}
+
+/**
+ * Babel parses Flow annotations in JavaScript into AST nodes. documentation.js uses
+ * Babel to parse JavaScript. This method restructures those Babel-generated
+ * objects into objects that fit the output of Doctrine, the module we use
+ * to parse JSDoc annotations. This lets us use Flow annotations _as_
+ * JSDoc annotations.
+ *
+ * @private
+ * @param {Object} type babel-parsed flow type
+ * @returns {Object} doctrine compatible type
+ */
+function flowDoctrine(type) {
+ if (type.type in namedTypes) {
+ const doctrineType = {
+ type: 'NameExpression',
+ name: namedTypes[type.type]
+ };
+ return doctrineType;
+ }
+
+ if (type.type in oneToOne) {
+ return { type: oneToOne[type.type] };
+ }
+
+ switch (type.type) {
+ case 'NullableTypeAnnotation':
+ return {
+ type: 'NullableType',
+ expression: flowDoctrine(type.typeAnnotation)
+ };
+ case 'UnionTypeAnnotation':
+ return {
+ type: 'UnionType',
+ elements: type.types.map(flowDoctrine)
+ };
+ // [number]
+ // [string, boolean, number]
+ case 'TupleTypeAnnotation':
+ return {
+ type: 'ArrayType',
+ elements: type.types.map(flowDoctrine)
+ };
+ // number[]
+ case 'ArrayTypeAnnotation':
+ return {
+ type: 'TypeApplication',
+ expression: {
+ type: 'NameExpression',
+ name: 'Array'
+ },
+ applications: [flowDoctrine(type.elementType)]
+ };
+ // (y: number) => bool
+ case 'FunctionTypeAnnotation':
+ return {
+ type: 'FunctionType',
+ params: type.params.map(param => {
+ let name = '';
+ if (param.name && param.name.name) {
+ name = param.name.name;
+ }
+ return {
+ type: 'ParameterType',
+ name,
+ expression: flowDoctrine(param.typeAnnotation)
+ };
+ }),
+ result: flowDoctrine(type.returnType)
+ };
+
+ case 'GenericTypeAnnotation':
+ if (type.typeParameters) {
+ return {
+ type: 'TypeApplication',
+ expression: {
+ type: 'NameExpression',
+ name: generate(type.id, {
+ compact: true
+ }).code
+ },
+ applications: type.typeParameters.params.map(flowDoctrine)
+ };
+ }
+
+ return {
+ type: 'NameExpression',
+ name: generate(type.id, {
+ compact: true
+ }).code
+ };
+
+ case 'ObjectTypeAnnotation':
+ if (type.properties) {
+ return {
+ type: 'RecordType',
+ fields: type.properties.map(propertyToField).filter(x => x)
+ };
+ }
+
+ return {
+ type: 'NameExpression',
+ name: generate(type.id, {
+ compact: true
+ }).code
+ };
+ case 'BooleanLiteralTypeAnnotation':
+ return {
+ type: 'BooleanLiteralType',
+ value: type.value
+ };
+ case 'NumberLiteralTypeAnnotation':
+ return {
+ type: 'NumericLiteralType',
+ value: type.value
+ };
+ case 'StringLiteralTypeAnnotation':
+ return {
+ type: 'StringLiteralType',
+ value: type.value
+ };
+ case 'ThisTypeAnnotation':
+ return {
+ type: 'NameExpression',
+ name: 'this'
+ };
+ default:
+ return {
+ type: 'AllLiteral'
+ };
+ }
+}
+
+export default flowDoctrine;
diff --git a/lib/garbage_collect.js b/src/garbage_collect.js
similarity index 78%
rename from lib/garbage_collect.js
rename to src/garbage_collect.js
index 79b8ed36b..47ed77aa1 100644
--- a/lib/garbage_collect.js
+++ b/src/garbage_collect.js
@@ -4,4 +4,4 @@ function garbageCollect(comment) {
return comment;
}
-module.exports = garbageCollect;
+export default garbageCollect;
diff --git a/src/get-readme-file.js b/src/get-readme-file.js
new file mode 100644
index 000000000..74fc63480
--- /dev/null
+++ b/src/get-readme-file.js
@@ -0,0 +1,22 @@
+import fs from 'fs';
+import path from 'path';
+
+export default function findReadme(dir) {
+ const readmeFilenames = [
+ 'README.markdown',
+ 'README.md',
+ 'Readme.md',
+ 'readme.markdown',
+ 'readme.md'
+ ];
+
+ const readmeFile = fs.readdirSync(dir).find(function (filename) {
+ return readmeFilenames.indexOf(filename) >= 0;
+ });
+
+ if (readmeFile) {
+ return path.join(fs.realpathSync(dir), readmeFile);
+ }
+
+ return 'README.md';
+}
diff --git a/src/git/find_git.js b/src/git/find_git.js
new file mode 100644
index 000000000..39869c007
--- /dev/null
+++ b/src/git/find_git.js
@@ -0,0 +1,27 @@
+import path from 'path';
+import fs from 'fs';
+
+/**
+ * Given a full path to a single file, iterate upwards through the filesystem
+ * to find a directory with a .git file indicating that it is a git repository
+ * @param filename any file within a repository
+ * @returns repository root & its .git folder paths
+ */
+export default function findGit(filename) {
+ let root = path.resolve(filename);
+ while (root) {
+ root = path.dirname(root);
+ let git = path.join(root, '.git');
+ if (!fs.existsSync(git)) continue;
+
+ if (fs.statSync(git).isFile()) {
+ // git submodule
+ const matches = fs.readFileSync(git, 'utf8').match(/gitdir: (.*)/);
+ if (!matches) return null;
+ git = path.join(root, matches[1]);
+ }
+
+ return { root, git };
+ }
+ return null;
+}
diff --git a/src/git/url_prefix.js b/src/git/url_prefix.js
new file mode 100644
index 000000000..235b4ca80
--- /dev/null
+++ b/src/git/url_prefix.js
@@ -0,0 +1,85 @@
+import fs from 'fs';
+import path from 'path';
+import gitUrlParse from 'git-url-parse';
+import ini from 'ini';
+
+/**
+ * Sometimes git will [pack refs](https://git-scm.com/docs/git-pack-refs)
+ * in order to save space on disk and
+ * duck under limits of numbers of files in folders. CircleCI in particular
+ * does this by default. This method parses that `packed-refs` file
+ *
+ * @private
+ * @param {string} packedRefs string contents of the packed refs file
+ * @param {string} branchName the branch name to resolve to
+ * @returns {string} sha hash referring to current tree
+ */
+export function parsePackedRefs(packedRefs, branchName) {
+ return packedRefs
+ .split(/\n/)
+ .filter(line => line[0] !== '#' && line[0] !== '^')
+ .reduce((memo, line) => {
+ memo[line.split(' ')[1]] = line.split(' ')[0];
+ return memo;
+ }, {})[branchName];
+}
+
+/**
+ * Given a a root directory, find its git configuration and figure out
+ * the HTTPS URL at the base of that GitHub repository.
+ *
+ * @param {string} root path at the base of this local repo
+ * @returns {string} base HTTPS url of the GitHub repository
+ * @throws {Error} if the root is not a git repo
+ */
+export function getGithubURLPrefix({ git, root }) {
+ let sha;
+ try {
+ const head = fs.readFileSync(path.join(git, 'HEAD'), 'utf8');
+ const branch = head.match(/ref: (.*)/);
+ if (branch) {
+ const branchName = branch[1];
+ const branchFileName = path.join(git, branchName);
+ const packedRefsName = path.join(git, 'packed-refs');
+ if (fs.existsSync(branchFileName)) {
+ sha = fs.readFileSync(branchFileName, 'utf8');
+ } else if (fs.existsSync(packedRefsName)) {
+ // packed refs are a compacted version of the refs folder. usually
+ // you have a folder filled with files that just contain sha
+ // hashes. since this folder can be really big, packed refs
+ // stores all the refs in one file instead.
+ sha = parsePackedRefs(
+ fs.readFileSync(packedRefsName, 'utf8'),
+ branchName
+ );
+ }
+ } else {
+ sha = head;
+ }
+ if (sha) {
+ let origin;
+ if (git.indexOf(root) === 0) {
+ const config = parseGitConfig(path.join(git, 'config'));
+ origin = config['remote "origin"'].url;
+ } else {
+ const config = parseGitConfig(path.join(git, '..', '..', 'config'));
+ origin = config[`submodule "${path.basename(git)}"`].url;
+ }
+ const parsed = gitUrlParse(origin);
+ parsed.git_suffix = false; // eslint-disable-line
+ return parsed.toString('https') + '/blob/' + sha.trim() + '/';
+ }
+ } catch (e) {
+ return null;
+ }
+}
+
+function parseGitConfig(configPath) {
+ const str = fs
+ .readFileSync(configPath, 'utf8')
+ .replace(
+ /\[(\S+) "(.+)"\]/g,
+ (match, key, value) => `[${key} "${value.split('.').join('\\.')}"]`
+ );
+ return ini.parse(str);
+}
diff --git a/src/github.js b/src/github.js
new file mode 100644
index 000000000..d52a8afdc
--- /dev/null
+++ b/src/github.js
@@ -0,0 +1,41 @@
+import path from 'path';
+import findGit from './git/find_git.js';
+import { getGithubURLPrefix } from './git/url_prefix.js';
+
+/**
+ * Attempts to link code to its place on GitHub.
+ *
+ * @name linkGitHub
+ * @param {Object} comment parsed comment
+ * @returns {Object} comment with github inferred
+ */
+export default function (comment) {
+ const paths = findGit(comment.context.file);
+
+ const urlPrefix = paths && getGithubURLPrefix(paths);
+
+ if (urlPrefix) {
+ const fileRelativePath = comment.context.file
+ .replace(paths.root + path.sep, '')
+ .split(path.sep)
+ .join('/');
+
+ let startLine;
+ let endLine;
+
+ if (comment.kind == 'typedef') {
+ startLine = comment.loc.start.line;
+ endLine = comment.loc.end.line;
+ } else {
+ startLine = comment.context.loc.start.line;
+ endLine = comment.context.loc.end.line;
+ }
+
+ comment.context.github = {
+ url:
+ urlPrefix + fileRelativePath + '#L' + startLine + '-' + 'L' + endLine,
+ path: fileRelativePath
+ };
+ }
+ return comment;
+}
diff --git a/src/hierarchy.js b/src/hierarchy.js
new file mode 100644
index 000000000..7bb870cbe
--- /dev/null
+++ b/src/hierarchy.js
@@ -0,0 +1,247 @@
+import _ from 'lodash';
+const hasOwnProperty = Object.prototype.hasOwnProperty;
+
+/**
+ * Check if a given member object is of kind `event`.
+ * @param {Object} member - The member to check.
+ * @returns {boolean} `true` if it is of kind `event`, otherwise false.
+ */
+const isEvent = member => member.kind === 'event';
+
+/**
+ * We need to have members of all valid JSDoc scopes.
+ * @private
+ */
+const getMembers = () => ({
+ global: Object.create(null),
+ inner: Object.create(null),
+ instance: Object.create(null),
+ events: Object.create(null),
+ static: Object.create(null)
+});
+
+/**
+ * Pick only relevant properties from a comment to store them in
+ * an inheritance chain
+ * @param comment a parsed comment
+ * @returns reduced comment
+ * @private
+ */
+function pick(comment) {
+ if (typeof comment.name !== 'string') {
+ return undefined;
+ }
+
+ const item = {
+ name: comment.name,
+ kind: comment.kind
+ };
+
+ if (comment.scope) {
+ item.scope = comment.scope;
+ }
+
+ return item;
+}
+
+/**
+ * @param {Array} comments an array of parsed comments
+ * @returns {Array} nested comments, with only root comments
+ * at the top level.
+ */
+export default function (comments) {
+ let id = 0;
+ const root = {
+ members: getMembers()
+ };
+
+ const namesToUnroot = [];
+
+ comments.forEach(comment => {
+ let path = comment.path;
+ if (!path) {
+ path = [];
+
+ if (comment.memberof) {
+ // TODO: full namepath parsing
+ path = comment.memberof
+ .split('.')
+ .map(segment => ({ scope: 'static', name: segment }));
+ }
+
+ if (!comment.name) {
+ comment.errors.push({
+ message: 'could not determine @name for hierarchy'
+ });
+ }
+
+ path.push({
+ scope: comment.scope || 'static',
+ name: comment.name || 'unknown_' + id++
+ });
+ }
+
+ let node = root;
+
+ while (path.length) {
+ const segment = path.shift();
+ const scope = segment.scope;
+ const name = segment.name;
+
+ if (!hasOwnProperty.call(node.members[scope], name)) {
+ // If segment.toc is true, everything up to this point in the path
+ // represents how the documentation should be nested, but not how the
+ // actual code is nested. To ensure that child members end up in the
+ // right places in the tree, we temporarily push the same node a second
+ // time to the root of the tree, and unroot it after all the comments
+ // have found their homes.
+ if (
+ segment.toc &&
+ node !== root &&
+ hasOwnProperty.call(root.members[scope], name)
+ ) {
+ node.members[scope][name] = root.members[scope][name];
+ namesToUnroot.push(name);
+ } else {
+ const newNode = (node.members[scope][name] = {
+ comments: [],
+ members: getMembers()
+ });
+ if (segment.toc && node !== root) {
+ root.members[scope][name] = newNode;
+ namesToUnroot.push(name);
+ }
+ }
+ }
+
+ node = node.members[scope][name];
+ }
+
+ node.comments.push(comment);
+ });
+ namesToUnroot.forEach(function (name) {
+ delete root.members.static[name];
+ });
+
+ /*
+ * Massage the hierarchy into a format more suitable for downstream consumers:
+ *
+ * * Individual top-level scopes are collapsed to a single array
+ * * Members at intermediate nodes are copied over to the corresponding comments,
+ * with multisignature comments allowed.
+ * * Intermediate nodes without corresponding comments indicate an undefined
+ * @memberof reference. Emit an error, and reparent the offending comment to
+ * the root.
+ * * Add paths to each comment, making it possible to generate permalinks
+ * that differentiate between instance functions with the same name but
+ * different `@memberof` values.
+ *
+ * Person#say // the instance method named "say."
+ * Person.say // the static method named "say."
+ * Person~say // the inner method named "say."
+ */
+ function toComments(nodes, root, hasUndefinedParent, path) {
+ const result = [];
+ let scope;
+
+ path = path || [];
+
+ for (const name in nodes) {
+ const node = nodes[name];
+
+ for (scope in node.members) {
+ node.members[scope] = toComments(
+ node.members[scope],
+ root || result,
+ !node.comments.length,
+ node.comments.length && node.comments[0].kind !== 'note'
+ ? path.concat(node.comments[0])
+ : []
+ );
+ }
+
+ for (let i = 0; i < node.comments.length; i++) {
+ const comment = node.comments[i];
+
+ comment.members = {};
+ for (scope in node.members) {
+ comment.members[scope] = node.members[scope];
+ }
+
+ let events = comment.members.events;
+ let groups = [];
+
+ if (comment.members.instance.length) {
+ groups = _.groupBy(comment.members.instance, isEvent);
+
+ events = events.concat(groups[true] || []);
+ comment.members.instance = groups[false] || [];
+ }
+
+ if (comment.members.static.length) {
+ groups = _.groupBy(comment.members.static, isEvent);
+
+ events = events.concat(groups[true] || []);
+ comment.members.static = groups[false] || [];
+ }
+
+ if (comment.members.inner.length) {
+ groups = _.groupBy(comment.members.inner, isEvent);
+
+ events = events.concat(groups[true] || []);
+ comment.members.inner = groups[false] || [];
+ }
+
+ if (comment.members.global.length) {
+ groups = _.groupBy(comment.members.global, isEvent);
+
+ events = events.concat(groups[true] || []);
+ comment.members.global = groups[false] || [];
+ }
+
+ comment.members.events = events;
+
+ comment.path = path.map(pick).concat(pick(comment)).filter(Boolean);
+
+ const scopeChars = {
+ instance: '#',
+ static: '.',
+ inner: '~',
+ global: ''
+ };
+
+ comment.namespace = comment.path.reduce((memo, part) => {
+ if (part.kind === 'event') {
+ return memo + '.event:' + part.name;
+ }
+ let scopeChar = '';
+ if (part.scope) {
+ scopeChar = scopeChars[part.scope];
+ }
+ return memo + scopeChar + part.name;
+ }, '');
+
+ if (hasUndefinedParent) {
+ const memberOfTag = comment.tags.filter(
+ tag => tag.title === 'memberof'
+ )[0];
+ const memberOfTagLineNumber =
+ (memberOfTag && memberOfTag.lineNumber) || 0;
+
+ comment.errors.push({
+ message: `@memberof reference to ${comment.memberof} not found`,
+ commentLineNumber: memberOfTagLineNumber
+ });
+
+ root.push(comment);
+ } else {
+ result.push(comment);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ return toComments(root.members.static);
+}
diff --git a/src/index.js b/src/index.js
new file mode 100644
index 000000000..abe624c7c
--- /dev/null
+++ b/src/index.js
@@ -0,0 +1,233 @@
+import _ from 'lodash';
+import sort from './sort.js';
+import { nest } from './nest.js';
+import filterAccess from './filter_access.js';
+import dependency from './input/dependency.js';
+import shallow from './input/shallow.js';
+import parseJavaScript from './parsers/javascript.js';
+import github from './github.js';
+import hierarchy from './hierarchy.js';
+import inferName from './infer/name.js';
+import inferKind from './infer/kind.js';
+import inferAugments from './infer/augments.js';
+import inferImplements from './infer/implements.js';
+import inferParams from './infer/params.js';
+import inferProperties from './infer/properties.js';
+import inferMembership from './infer/membership.js';
+import inferReturn from './infer/return.js';
+import inferAccess from './infer/access.js';
+import inferType from './infer/type.js';
+import { formatLint, lintComments } from './lint.js';
+import garbageCollect from './garbage_collect.js';
+import markdownAST from './output/markdown_ast.js';
+import mergeConfig from './merge_config.js';
+import html from './output/html.js';
+import md from './output/markdown.js';
+import json from './output/json.js';
+import createFormatters from './output/util/formatters.js';
+import LinkerStack from './output/util/linker_stack.js';
+
+/**
+ * Build a pipeline of comment handlers.
+ * @param {Array} fns - Pipeline elements. Each is a function that accepts
+ * a comment and can return a comment or undefined (to drop that comment).
+ * @returns {Function} pipeline
+ * @private
+ */
+function pipeline(fns) {
+ return comment => {
+ for (let i = 0; comment && i < fns.length; i++) {
+ if (fns[i]) {
+ comment = fns[i](comment);
+ }
+ }
+ return comment;
+ };
+}
+
+function configure(indexes, args) {
+ const mergedConfig = mergeConfig(args);
+
+ return mergedConfig.then(config => {
+ const expandedInputs = expandInputs(indexes, config);
+
+ return expandedInputs.then(inputs => {
+ return {
+ inputs,
+ config
+ };
+ });
+ });
+}
+
+/**
+ * Given an array of indexes and options for whether to resolve shallow
+ * or deep dependencies, resolve dependencies.
+ *
+ * @param {Array|string} indexes files to process
+ * @param {Object} config options
+ * @returns {Promise>} promise with results
+ */
+export function expandInputs(indexes, config) {
+ // Ensure that indexes is an array of strings
+ indexes = [].concat(indexes);
+
+ if (config.shallow || config.documentExported) {
+ return shallow(indexes, config);
+ }
+
+ return dependency(indexes, config);
+}
+
+function buildInternal(inputsAndConfig) {
+ const config = inputsAndConfig.config;
+ const inputs = inputsAndConfig.inputs;
+
+ if (!config.access) {
+ config.access = ['public', 'undefined', 'protected'];
+ }
+
+ const buildPipeline = pipeline([
+ inferName,
+ inferAccess(config.inferPrivate),
+ inferAugments,
+ inferImplements,
+ inferKind,
+ nest,
+ inferParams,
+ inferProperties,
+ inferReturn,
+ inferMembership(),
+ inferType,
+ config.github && github,
+ garbageCollect
+ ]);
+
+ const extractedComments = _.flatMap(inputs, function (sourceFile) {
+ return parseJavaScript(sourceFile, config).map(buildPipeline);
+ }).filter(Boolean);
+
+ return filterAccess(
+ config.access,
+ hierarchy(sort(extractedComments, config))
+ );
+}
+
+function lintInternal(inputsAndConfig) {
+ const inputs = inputsAndConfig.inputs;
+ const config = inputsAndConfig.config;
+
+ const lintPipeline = pipeline([
+ lintComments,
+ inferName,
+ inferAccess(config.inferPrivate),
+ inferAugments,
+ inferKind,
+ inferParams,
+ inferProperties,
+ inferReturn,
+ inferMembership(),
+ inferType,
+ nest
+ ]);
+
+ const extractedComments = _.flatMap(inputs, sourceFile => {
+ return parseJavaScript(sourceFile, config).map(lintPipeline);
+ }).filter(Boolean);
+
+ return formatLint(hierarchy(extractedComments));
+}
+
+/**
+ * Lint files for non-standard or incorrect documentation
+ * information, returning a potentially-empty string
+ * of lint information intended for human-readable output.
+ *
+ * @param {Array|string} indexes files to process
+ * @param {Object} args args
+ * @param {Array} args.external a string regex / glob match pattern
+ * that defines what external modules will be whitelisted and included in the
+ * generated documentation.
+ * @param {boolean} [args.shallow=false] whether to avoid dependency parsing
+ * even in JavaScript code.
+ * @param {string} [args.inferPrivate] a valid regular expression string
+ * to infer whether a code element should be private, given its naming structure.
+ * For instance, you can specify `inferPrivate: '^_'` to automatically treat
+ * methods named like `_myMethod` as private.
+ * @param {string|Array} [args.extension] treat additional file extensions
+ * as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
+ * @returns {Promise} promise with lint results
+ * @public
+ * @example
+ * documentation.lint('file.js').then(lintOutput => {
+ * if (lintOutput) {
+ * console.log(lintOutput);
+ * process.exit(1);
+ * } else {
+ * process.exit(0);
+ * }
+ * });
+ */
+export const lint = (indexes, args) =>
+ configure(indexes, args).then(lintInternal);
+
+/**
+ * Generate JavaScript documentation as a list of parsed JSDoc
+ * comments, given a root file as a path.
+ *
+ * @param {Array|string} indexes files to process
+ * @param {Object} args args
+ * @param {Array} args.external a string regex / glob match pattern
+ * that defines what external modules will be whitelisted and included in the
+ * generated documentation.
+ * @param {boolean} [args.shallow=false] whether to avoid dependency parsing
+ * even in JavaScript code.
+ * @param {Array} [args.order=[]] optional array that
+ * defines sorting order of documentation
+ * @param {Array} [args.access=[]] an array of access levels
+ * to output in documentation
+ * @param {Object} [args.hljs] hljs optional args
+ * @param {boolean} [args.hljs.highlightAuto=false] hljs automatically detect language
+ * @param {Array} [args.hljs.languages] languages for hljs to choose from
+ * @param {string} [args.inferPrivate] a valid regular expression string
+ * to infer whether a code element should be private, given its naming structure.
+ * For instance, you can specify `inferPrivate: '^_'` to automatically treat
+ * methods named like `_myMethod` as private.
+ * @param {string|Array} [args.extension] treat additional file extensions
+ * as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
+ * @returns {Promise} results
+ * @public
+ * @example
+ * var documentation = require('documentation');
+ *
+ * documentation.build(['index.js'], {
+ * // only output comments with an explicit @public tag
+ * access: ['public']
+ * }).then(res => {
+ * // res is an array of parsed comments with inferred properties
+ * // and more: everything you need to build documentation or
+ * // any other kind of code data.
+ * });
+ */
+export const build = (indexes, args) =>
+ configure(indexes, args).then(buildInternal);
+
+/**
+ * Documentation's formats are modular methods that take comments
+ * and config as input and return Promises with results,
+ * like stringified JSON, markdown strings, or Vinyl objects for HTML
+ * output.
+ * @public
+ */
+export const formats = {
+ html,
+ md,
+ remark: (comments, config) =>
+ markdownAST(comments, config).then(res => JSON.stringify(res, null, 2)),
+ json
+};
+
+export const util = {
+ createFormatters,
+ LinkerStack
+};
diff --git a/src/infer/access.js b/src/infer/access.js
new file mode 100644
index 000000000..32f304f54
--- /dev/null
+++ b/src/infer/access.js
@@ -0,0 +1,43 @@
+/**
+ * Given a string with a pattern that might infer access level, like `^_`,
+ * create an inference method.
+ *
+ * @param {?string} pattern regexp-compatible pattern
+ * @returns {Function} inference method
+ * @private
+ */
+export default function inferAccessWithPattern(pattern) {
+ const re = pattern && new RegExp(pattern);
+
+ /**
+ * Infers access from TypeScript annotations, and from the name (only private atm).
+ *
+ * @name inferAccess
+ * @param {Object} comment parsed comment
+ * @returns {Object} comment with access inferred
+ */
+ return function inferAccess(comment) {
+ // Support typescript access modifiers
+ const ast = comment.context.ast;
+ if (ast && ast.node.accessibility) {
+ comment.access = ast.node.accessibility;
+ }
+
+ if (ast && ast.node.readonly) {
+ comment.readonly = true;
+ }
+
+ // This needs to run after inferName because we infer the access based on
+ // the name.
+ if (
+ re &&
+ comment.name &&
+ comment.access === undefined &&
+ re.test(comment.name)
+ ) {
+ comment.access = 'private';
+ }
+
+ return comment;
+ };
+}
diff --git a/src/infer/augments.js b/src/infer/augments.js
new file mode 100644
index 000000000..f310c167b
--- /dev/null
+++ b/src/infer/augments.js
@@ -0,0 +1,55 @@
+import babelGenerate from '@babel/generator';
+import findTarget from './finders.js';
+
+const generate = babelGenerate.default || babelGenerate;
+
+/**
+ * Infers an `augments` tag from an ES6 class declaration
+ *
+ * @param {Object} comment parsed comment
+ * @returns {Object} comment with kind inferred
+ */
+export default function inferAugments(comment) {
+ if (comment.augments.length) {
+ return comment;
+ }
+
+ const path = findTarget(comment.context.ast);
+
+ if (!path) {
+ return comment;
+ }
+
+ if (path.isClass()) {
+ /*
+ * A superclass can be a single name, like React,
+ * or a MemberExpression like React.Component,
+ * so we generate code from the AST rather than assuming
+ * we can access a name like `path.node.superClass.name`
+ */
+ if (path.node.superClass) {
+ comment.augments.push({
+ title: 'augments',
+ name: generate(path.node.superClass).code
+ });
+ }
+ } else if (
+ (path.isInterfaceDeclaration() || path.isTSInterfaceDeclaration()) &&
+ path.node.extends
+ ) {
+ /*
+ * extends is an array of interface identifiers or
+ * qualified type identifiers, so we generate code
+ * from the AST rather than assuming we can acces
+ * a name.
+ */
+ path.node.extends.forEach(node => {
+ comment.augments.push({
+ title: 'extends',
+ name: generate(node).code
+ });
+ });
+ }
+
+ return comment;
+}
diff --git a/src/infer/finders.js b/src/infer/finders.js
new file mode 100644
index 000000000..2592e3bb8
--- /dev/null
+++ b/src/infer/finders.js
@@ -0,0 +1,38 @@
+import t from '@babel/types';
+
+/**
+ * Try to find the part of JavaScript a comment is referring to, by
+ * looking at the syntax tree closest to that comment.
+ *
+ * @param {Object} path abstract syntax tree path
+ * @returns {?Object} ast path, if one is found.
+ * @private
+ */
+export default function findTarget(path) {
+ if (!path) {
+ return path;
+ }
+
+ if (
+ t.isExportDefaultDeclaration(path) ||
+ (t.isExportNamedDeclaration(path) && path.has('declaration'))
+ ) {
+ path = path.get('declaration');
+ }
+
+ if (t.isVariableDeclaration(path)) {
+ // var x = init;
+ path = path.get('declarations')[0];
+ } else if (t.isExpressionStatement(path)) {
+ // foo.x = TARGET
+ path = path.get('expression').get('right');
+ } else if (t.isObjectProperty(path) || t.isObjectTypeProperty(path)) {
+ // var foo = { x: TARGET }; object property
+ path = path.get('value');
+ } else if (t.isClassProperty(path) && path.get('value').node) {
+ // var foo = { x = TARGET }; class property
+ path = path.get('value');
+ }
+
+ return path.node && path;
+}
diff --git a/src/infer/implements.js b/src/infer/implements.js
new file mode 100644
index 000000000..26240898e
--- /dev/null
+++ b/src/infer/implements.js
@@ -0,0 +1,38 @@
+import babelGenerate from '@babel/generator';
+import findTarget from './finders.js';
+
+const generate = babelGenerate.default || babelGenerate;
+
+/**
+ * Infers an `augments` tag from an ES6 class declaration
+ *
+ * @param {Object} comment parsed comment
+ * @returns {Object} comment with kind inferred
+ */
+export default function inferImplements(comment) {
+ if (comment.implements.length) {
+ return comment;
+ }
+
+ const path = findTarget(comment.context.ast);
+ if (!path) {
+ return comment;
+ }
+
+ if (path.isClass() && path.node.implements) {
+ /*
+ * A interface can be a single name, like React,
+ * or a MemberExpression like React.Component,
+ * so we generate code from the AST rather than assuming
+ * we can access a name like `path.node.implements.name`
+ */
+ path.node.implements.forEach(impl => {
+ comment.implements.push({
+ title: 'implements',
+ name: generate(impl).code
+ });
+ });
+ }
+
+ return comment;
+}
diff --git a/src/infer/kind.js b/src/infer/kind.js
new file mode 100644
index 000000000..f6ecdd4aa
--- /dev/null
+++ b/src/infer/kind.js
@@ -0,0 +1,98 @@
+import t from '@babel/types';
+
+/**
+ * Infers a `kind` tag from the context.
+ *
+ * @param {Object} comment parsed comment
+ * @returns {Object} comment with kind inferred
+ */
+export default function inferKind(comment) {
+ if (comment.kind) {
+ return comment;
+ }
+
+ function findKind(node) {
+ if (!node) {
+ return comment;
+ }
+
+ if (t.isClassDeclaration(node)) {
+ comment.kind = 'class';
+ if (node.abstract) {
+ comment.abstract = true;
+ }
+ } else if (
+ t.isFunction(node) ||
+ t.isTSDeclareMethod(node) ||
+ t.isTSDeclareFunction(node) ||
+ t.isFunctionTypeAnnotation(node) ||
+ t.isTSMethodSignature(node)
+ ) {
+ if (node.kind === 'get' || node.kind === 'set') {
+ comment.kind = 'member';
+ } else if (node.id && node.id.name && !!/^[A-Z]/.exec(node.id.name)) {
+ comment.kind = 'class';
+ } else {
+ comment.kind = 'function';
+ if (node.async) {
+ comment.async = true;
+ }
+ if (node.generator) {
+ comment.generator = true;
+ }
+ if (node.abstract) {
+ comment.abstract = true;
+ }
+ }
+ } else if (t.isTypeAlias(node) || t.isTSTypeAliasDeclaration(node)) {
+ comment.kind = 'typedef';
+ } else if (
+ t.isInterfaceDeclaration(node) ||
+ t.isTSInterfaceDeclaration(node)
+ ) {
+ comment.kind = 'interface';
+ } else if (t.isVariableDeclaration(node)) {
+ if (node.kind === 'const') {
+ comment.kind = 'constant';
+ } else {
+ // This behavior is in need of fixing https://github.com/documentationjs/documentation/issues/351
+ findKind(node.declarations[0].init);
+ }
+ } else if (t.isExportDeclaration(node)) {
+ // export var x = ...
+ // export function f() {}
+ // export class C {}
+ // export default function f() {}
+ // export default class C {}
+ findKind(node.declaration);
+ } else if (t.isExpressionStatement(node)) {
+ // module.exports = function() {}
+ findKind(node.expression.right);
+ } else if (
+ t.isClassProperty(node) ||
+ t.isTSPropertySignature(node) ||
+ t.isTSEnumMember(node)
+ ) {
+ comment.kind = 'member';
+ } else if (t.isProperty(node)) {
+ // { foo: function() {} }
+ findKind(node.value);
+ } else if (t.isTSModuleDeclaration(node)) {
+ comment.kind = 'namespace';
+ } else if (t.isObjectTypeProperty(node)) {
+ if (t.isFunctionTypeAnnotation(node.value)) {
+ findKind(node.value);
+ } else {
+ comment.kind = 'member';
+ }
+ } else if (t.isTSEnumDeclaration(node)) {
+ comment.kind = 'enum';
+ }
+ }
+
+ if (comment.context.ast) {
+ findKind(comment.context.ast.node);
+ }
+
+ return comment;
+}
diff --git a/src/infer/membership.js b/src/infer/membership.js
new file mode 100644
index 000000000..756d43e3b
--- /dev/null
+++ b/src/infer/membership.js
@@ -0,0 +1,496 @@
+import n from '@babel/types';
+import pathParse from 'parse-filepath';
+import isJSDocComment from '../is_jsdoc_comment.js';
+import parse from '../parse.js';
+
+function inferModuleName(comment) {
+ return (
+ (comment.kind === 'module' && comment.name) ||
+ pathParse(comment.context.file).name
+ );
+}
+
+/**
+ * Given an AST node, try to find a comment in front of it that
+ * has a `lends` tag, and if it has that, return the tag, split by
+ * .s.
+ *
+ * @private
+ * @param {Object} path AST node
+ * @returns {string|undefined} lends identifier, if any
+ */
+function findLendsIdentifiers(path) {
+ if (!path || !path.get('leadingComments')) {
+ return;
+ }
+
+ const leadingComments = path.get('leadingComments');
+
+ for (let i = 0; i < leadingComments.length; i++) {
+ const comment = leadingComments[i];
+ if (isJSDocComment(comment.node)) {
+ const lends = parse(comment.node.value).lends;
+ if (lends) {
+ return lends.split('.');
+ }
+ }
+ }
+}
+
+/**
+ * Given an AST node, try to find a comment before the class declaration that
+ * has a `memberof` tag, and if it has that, return the tag, split by
+ * .s with the name of the class.
+ *
+ * @private
+ * @param {Object} path AST node
+ * @returns {Array} class membership
+ */
+function inferClassMembership(path) {
+ if (path.get('leadingComments')) {
+ const leadingComments = path.get('leadingComments');
+
+ for (let i = leadingComments.length - 1; i >= 0; i--) {
+ const comment = leadingComments[i];
+ if (isJSDocComment(comment.node)) {
+ const memberof = parse(comment.node.value).memberof;
+ if (memberof) {
+ return [...memberof.split('.'), path.node.id.name];
+ }
+ }
+ }
+ }
+
+ return [path.node.id.name];
+}
+
+/**
+ * Extract and return the identifiers for expressions of
+ * type this.foo
+ *
+ * @param {NodePath} path AssignmentExpression, MemberExpression,
+ * or Identifier
+ * @param {Comment} comment
+ * @returns {Array} identifiers
+ * @private
+ */
+function extractThis(path, comment) {
+ let identifiers = [];
+
+ path.traverse({
+ /**
+ * Add the resolved identifier of this in a path to the identifiers array
+ * @param {Object} path ast path
+ * @returns {undefined} has side-effects
+ * @private
+ */
+ ThisExpression(path) {
+ let scope = path.scope;
+
+ while (n.isBlockStatement(scope.block)) {
+ scope = scope.parent;
+ }
+
+ if (
+ n.isClassMethod(scope.block) &&
+ scope.path.parentPath.parentPath.node.id !== null
+ ) {
+ identifiers.push(
+ scope.path.parentPath.parentPath.node.id.name,
+ 'prototype'
+ );
+ }
+
+ // function OldClass() { this.foo = 1 }
+ if (n.isFunctionDeclaration(scope.block)) {
+ // named function like
+ // function OldClass() { ... }
+ if (scope.block.id) {
+ identifiers.push(scope.block.id.name, 'prototype');
+ } else if (n.isExportDefaultDeclaration(path.scope.parentBlock)) {
+ identifiers.push(inferModuleName(comment));
+ }
+ // var Binding = function OldClass() { this.foo = 1 }
+ } else if (n.isFunctionExpression(scope.block)) {
+ if (scope.path.parentPath.isVariableDeclarator()) {
+ /** var Bar = function(foo) { this.foo = foo; }; */
+ identifiers = identifiers
+ .concat(scope.path.parentPath.get('id').node.name)
+ .concat('prototype');
+ } else if (scope.path.parentPath.isAssignmentExpression()) {
+ /** this.Bar = function(foo) { this.foo = foo; }; */
+ identifiers = identifiers
+ .concat(extractIdentifiers(scope.path.parentPath.get('left')))
+ .concat('prototype');
+ }
+ }
+ }
+ });
+
+ return identifiers;
+}
+
+/**
+ * Extract and return the chain of identifiers from the left hand side of expressions
+ * of the forms `Foo = ...`, `Foo.bar = ...`, `Foo.bar.baz = ...`, etc.
+ *
+ * @param {NodePath} path AssignmentExpression, MemberExpression, or Identifier
+ * @returns {Array} identifiers
+ * @private
+ */
+function extractIdentifiers(path) {
+ const identifiers = [];
+
+ path.traverse({
+ /**
+ * Add an identifier in a path to the identifiers array
+ * @param {Object} path ast path
+ * @returns {undefined} has side-effects
+ * @private
+ */
+ Identifier(path) {
+ identifiers.push(path.node.name);
+ }
+ });
+
+ return identifiers;
+}
+
+/**
+ * Count leading identifiers that refer to a module export (`exports` or `module.exports`).
+ * @private
+ * @param {Object} comment parsed comment
+ * @param {Array} identifiers array of identifier names
+ * @returns {number} number of identifiers referring to a module export (0, 1 or 2)
+ */
+function countModuleIdentifiers(comment, identifiers) {
+ if (identifiers.length >= 1 && identifiers[0] === 'exports') {
+ return 1;
+ }
+
+ if (
+ identifiers.length >= 2 &&
+ identifiers[0] === 'module' &&
+ identifiers[1] === 'exports'
+ ) {
+ return 2;
+ }
+
+ return 0;
+}
+
+/**
+ * Returns the comment object after normalizing Foo.prototype and Foo# expressions
+ * @param comment parsed comment
+ * @returns the normalized comment
+ */
+function normalizeMemberof(comment) {
+ if (typeof comment.memberof != 'string') {
+ return comment;
+ }
+
+ const memberof = comment.memberof;
+
+ const isPrototype = /.prototype$/;
+
+ if (memberof.match(isPrototype) !== null) {
+ comment.memberof = memberof.replace(isPrototype, '');
+ comment.scope = 'instance';
+
+ return comment;
+ }
+
+ const isInstanceMember = /#$/;
+
+ if (memberof.match(isInstanceMember) !== null) {
+ comment.memberof = memberof.replace(isInstanceMember, '');
+ comment.scope = 'instance';
+ }
+
+ return comment;
+}
+
+/**
+ * Uses code structure to infer `memberof`, `instance`, and `static`
+ * tags from the placement of JSDoc
+ * annotations within a file
+ *
+ * @private
+ * @returns {Object} comment with membership inferred
+ */
+export default function () {
+ let currentModule;
+
+ /**
+ * Set `memberof` and `instance`/`static` tags on `comment` based on the
+ * array of `identifiers`. If the last element of the `identifiers` is
+ * `"prototype"`, it is assumed to be an instance member; otherwise static.
+ * If the `identifiers` start with `exports` or `module.exports`, assign
+ * membership based on the last seen @module tag or name of the current file.
+ *
+ * @param {Object} comment comment for which to infer memberships
+ * @param {Array} identifiers array of identifier names
+ * @param {string} explicitScope if derived from an es6 class, whether or
+ * not this method had the static keyword
+ * @returns {Comment} returns mutated `comment`
+ * @private
+ */
+ function inferMembershipFromIdentifiers(comment, identifiers, explicitScope) {
+ if (
+ identifiers.length === 1 &&
+ identifiers[0] === 'module' &&
+ comment.name === 'exports'
+ ) {
+ comment.name = inferModuleName(currentModule || comment);
+ return comment;
+ }
+
+ /*
+ * Test whether identifiers start with a module export (`exports` or `module.exports`),
+ * and if so replace those identifiers with the name of the current module.
+ */
+ const moduleIdentifierCount = countModuleIdentifiers(comment, identifiers);
+ if (moduleIdentifierCount) {
+ identifiers = identifiers.slice(moduleIdentifierCount);
+ identifiers.unshift(inferModuleName(currentModule || comment));
+ }
+
+ if (identifiers[identifiers.length - 1] === 'prototype') {
+ comment.memberof = identifiers.slice(0, -1).join('.');
+ comment.scope = 'instance';
+ } else {
+ comment.memberof = identifiers.join('.');
+ if (explicitScope !== undefined) {
+ comment.scope = explicitScope;
+ } else {
+ comment.scope = 'static';
+ }
+ }
+ return comment;
+ }
+
+ return function inferMembership(comment) {
+ // Lends tags are go-betweens that let people reassign membership
+ // in bulk: they themselves don't get an inference step
+ if (comment.lends) {
+ return comment;
+ }
+
+ if (comment.kind === 'module') {
+ currentModule = comment;
+ }
+
+ // If someone explicitly specifies the parent of this chunk, don't
+ // try to infer it, just return what they specified.
+ if (comment.memberof) {
+ return normalizeMemberof(comment);
+ }
+
+ let path = comment.context.ast;
+ // If this chunk doesn't have code attached, like if it was the result
+ // of a polyglot parse, don't try to infer anything.
+ if (!path) {
+ return comment;
+ }
+
+ // INFERENCE ===============================================================
+ // Deal with an oddity of espree: the jsdoc comment is attached to a different
+ // node in the two expressions `a.b = c` vs `a.b = function () {}`.
+ if (
+ path.isExpressionStatement() &&
+ path.get('expression').isAssignmentExpression() &&
+ path.get('expression').get('left').isMemberExpression()
+ ) {
+ path = path.get('expression').get('left');
+ }
+
+ // Same as above but for `b: c` vs `b: function () {}`.
+ if (
+ path.isObjectProperty() &&
+ (path.get('key').isIdentifier() || path.get('key').isLiteral())
+ ) {
+ path = path.get('key');
+ }
+
+ // Forms:
+ //
+ // Foo.bar = ...;
+ // Foo.prototype.bar = ...;
+ // Foo.bar.baz = ...;
+ //
+ // Lends is not supported in this codepath.
+ if (path.isMemberExpression()) {
+ const memberIdentifiers = [].concat(
+ extractThis(path, comment),
+ extractIdentifiers(path)
+ );
+ if (memberIdentifiers.length >= 2) {
+ return inferMembershipFromIdentifiers(
+ comment,
+ memberIdentifiers.slice(0, -1)
+ );
+ }
+ return comment;
+ }
+
+ // Like straight membership, classes don't need
+ // to support lends.
+ //
+ // class Foo { bar() { } }
+ // var Foo = class { bar() { } }
+ // class Foo { prop: T }
+ // var Foo = class { prop: T }
+ if (
+ (path.isClassMethod() ||
+ path.isClassProperty() ||
+ path.isTSDeclareMethod()) &&
+ path.parentPath.isClassBody() &&
+ path.parentPath.parentPath.isClass()
+ ) {
+ let scope = 'instance';
+ if (path.node.static == true) {
+ scope = 'static';
+ }
+
+ if (path.parentPath.parentPath.isExpression()) {
+ return inferMembershipFromIdentifiers(
+ comment,
+ extractIdentifiers(path.parentPath.parentPath.parentPath.get('left')),
+ scope
+ );
+ }
+
+ const declarationNode = path.parentPath.parentPath.node;
+ if (!declarationNode.id && !declarationNode.key) {
+ // export default function () {}
+ // export default class {}
+ // Use module name instead.
+ return inferMembershipFromIdentifiers(
+ comment,
+ [pathParse(comment.context.file).name],
+ scope
+ );
+ }
+
+ return inferMembershipFromIdentifiers(
+ comment,
+ inferClassMembership(path.parentPath.parentPath),
+ scope
+ );
+ }
+
+ // Whether something is an ObjectMethod (shorthand like foo() {} )
+ // or ObjectProperty (old fashioned like foo: function() {} )
+ // doesn't matter for the membership phase, as long as we end up knowing
+ // that it belongs to an object. So we first establish objectParent,
+ // and then have the logic for the numerous ways an object can be named.
+ let objectParent;
+
+ if (
+ (path.isIdentifier() || path.isLiteral()) &&
+ path.parentPath.isObjectProperty() &&
+ path.parentPath.parentPath.isObjectExpression()
+ ) {
+ objectParent = path.parentPath.parentPath;
+ } else if (path.isObjectMethod() && path.parentPath.isObjectExpression()) {
+ objectParent = path.parentPath;
+ } else if (path.isObjectTypeProperty() || path.isTSTypeElement()) {
+ objectParent = path.parentPath;
+ }
+
+ // Confirm that the thing being documented is a property of an object.
+ if (objectParent) {
+ // Collect all keys of parent nested object keys, e.g. {foo: bar: {baz: 1}}
+ const objectKeys = [];
+
+ while (!objectParent.isStatement()) {
+ if (
+ objectParent.isObjectProperty() ||
+ objectParent.isObjectTypeProperty() ||
+ objectParent.isTSPropertySignature()
+ ) {
+ objectKeys.unshift(objectParent.node.key.name);
+ }
+
+ // The @lends comment is sometimes attached to the first property rather than
+ // the object expression itself.
+ const lendsIdentifiers =
+ findLendsIdentifiers(objectParent) ||
+ findLendsIdentifiers(objectParent.get('properties')[0]);
+
+ if (lendsIdentifiers) {
+ return inferMembershipFromIdentifiers(comment, [
+ ...lendsIdentifiers,
+ ...objectKeys
+ ]);
+ } else if (objectParent.parentPath.isAssignmentExpression()) {
+ // Foo = { ... };
+ // Foo.prototype = { ... };
+ // Foo.bar = { ... };
+ return inferMembershipFromIdentifiers(comment, [
+ ...extractIdentifiers(objectParent.parentPath.get('left')),
+ ...objectKeys
+ ]);
+ } else if (objectParent.parentPath.isVariableDeclarator()) {
+ // var Foo = { ... };
+ return inferMembershipFromIdentifiers(comment, [
+ objectParent.parentPath.get('id').node.name,
+ ...objectKeys
+ ]);
+ } else if (objectParent.parentPath.isExportDefaultDeclaration()) {
+ // export default { ... };
+ return inferMembershipFromIdentifiers(comment, [
+ inferModuleName(currentModule || comment),
+ ...objectKeys
+ ]);
+ } else if (
+ objectParent.parentPath.isTypeAlias() ||
+ objectParent.parentPath.isTSTypeAliasDeclaration()
+ ) {
+ // type X = { ... }
+ return inferMembershipFromIdentifiers(comment, [
+ objectParent.parentPath.node.id.name,
+ ...objectKeys
+ ]);
+ } else if (
+ objectParent.parentPath.isInterfaceDeclaration() ||
+ objectParent.parentPath.isTSInterfaceDeclaration()
+ ) {
+ // interface Foo { ... }
+ return inferMembershipFromIdentifiers(
+ comment,
+ [...inferClassMembership(objectParent.parentPath), ...objectKeys],
+ 'instance'
+ );
+ }
+
+ objectParent = objectParent.parentPath;
+ }
+ }
+
+ // TypeScript enums
+ // enum Foo { A }
+ if (path.isTSEnumMember()) {
+ const enumPath = path.parentPath;
+ return inferMembershipFromIdentifiers(
+ comment,
+ [enumPath.node.id.name],
+ 'static'
+ );
+ }
+
+ // var function Foo() {
+ // function bar() {}
+ // return { bar: bar };
+ // }
+ /*
+ if (n.isFunctionDeclaration(path) &&
+ n.isBlockStatement(path.parentPath) &&
+ n.isFunction(path.parentPath.parentPath)) {
+ inferMembershipFromIdentifiers(comment, [path.parentPath.parentPath.node.id.name]);
+ }
+ */
+
+ return comment;
+ };
+}
diff --git a/src/infer/name.js b/src/infer/name.js
new file mode 100644
index 000000000..0b8af39b0
--- /dev/null
+++ b/src/infer/name.js
@@ -0,0 +1,100 @@
+import pathParse from 'parse-filepath';
+import t from '@babel/types';
+
+/**
+ * Infers a `name` tag from the context.
+ *
+ * @name inferName
+ * @param {Object} comment parsed comment
+ * @returns {Object} comment with name inferred
+ */
+export default function inferName(comment) {
+ if (comment.name) {
+ return comment;
+ }
+
+ if (comment.alias) {
+ comment.name = comment.alias;
+ return comment;
+ }
+
+ if (comment.kind === 'module') {
+ comment.name = pathParse(comment.context.file).name;
+ return comment;
+ }
+
+ function inferName(path, node) {
+ if (node && node.name) {
+ comment.name = node.name;
+ return true;
+ }
+ if (node && node.type === 'StringLiteral' && node.value) {
+ comment.name = node.value;
+ return true;
+ }
+ }
+
+ const path = comment.context.ast;
+ if (path) {
+ if (path.type === 'ExportDefaultDeclaration') {
+ if (t.isDeclaration(path.node.declaration) && path.node.declaration.id) {
+ comment.name = path.node.declaration.id.name;
+ } else {
+ comment.name = pathParse(comment.context.file).name;
+ }
+ return comment;
+ }
+
+ // The strategy here is to do a depth-first traversal of the AST,
+ // looking for nodes with a "name" property, with exceptions as needed.
+ // For example, name inference for a MemberExpression `foo.bar = baz` will
+ // infer the named based on the `property` of the MemberExpression (`bar`)
+ // rather than the `object` (`foo`).
+ path.traverse({
+ /**
+ * Attempt to extract the name from an Identifier node.
+ * If the name can be resolved, it will stop traversing.
+ * @param {Object} path ast path
+ * @returns {undefined} has side-effects
+ * @private
+ */
+ Identifier(path) {
+ if (inferName(path, path.node)) {
+ path.stop();
+ }
+ },
+ /**
+ * Attempt to extract the name from a string literal that is the `key`
+ * part of an ObjectProperty node. If the name can be resolved, it
+ * will stop traversing.
+ * @param {Object} path ast path
+ * @returns {undefined} has side-effects
+ * @private
+ */
+ StringLiteral(path) {
+ if (
+ path.parent.type === 'ObjectProperty' &&
+ path.node === path.parent.key
+ ) {
+ if (inferName(path, path.node)) {
+ path.stop();
+ }
+ }
+ },
+ /**
+ * Attempt to extract the name from an Identifier node.
+ * If the name can be resolved, it will stop traversing.
+ * @param {Object} path ast path
+ * @returns {undefined} has side-effects
+ * @private
+ */
+ MemberExpression(path) {
+ if (inferName(path, path.node.property)) {
+ path.stop();
+ }
+ }
+ });
+ }
+
+ return comment;
+}
diff --git a/src/infer/params.js b/src/infer/params.js
new file mode 100644
index 000000000..2103af6df
--- /dev/null
+++ b/src/infer/params.js
@@ -0,0 +1,418 @@
+import t from '@babel/types';
+import babelGenerate from '@babel/generator';
+import _ from 'lodash';
+import findTarget from './finders.js';
+import typeAnnotation from '../type_annotation.js';
+
+const generate = babelGenerate.default || babelGenerate;
+
+/**
+ * Infers param tags by reading function parameter names
+ *
+ * @param {Object} comment parsed comment
+ * @returns {Object} comment with parameters
+ */
+export default function inferParams(comment) {
+ let path = findTarget(comment.context.ast);
+ if (!path) {
+ return comment;
+ }
+
+ // In case of `/** */ var x = function () {}` findTarget returns
+ // the declarator.
+ if (t.isVariableDeclarator(path)) {
+ path = path.get('init');
+ }
+
+ // If this is an ES6 class with a constructor method, infer
+ // parameters from that constructor method.
+ if (
+ t.isClassDeclaration(path) &&
+ !(comment.constructorComment && comment.constructorComment.hideconstructor)
+ ) {
+ const constructor = path.node.body.body.find(item => {
+ // https://github.com/babel/babylon/blob/master/ast/spec.md#classbody
+ return t.isClassMethod(item) && item.kind === 'constructor';
+ });
+ if (constructor) {
+ return inferAndCombineParams(constructor.params, comment);
+ }
+ }
+
+ if (
+ !t.isFunction(path) &&
+ !t.isTSDeclareFunction(path) &&
+ !t.isTSDeclareMethod(path) &&
+ !t.isFunctionTypeAnnotation(path) &&
+ !t.isTSMethodSignature(path)
+ ) {
+ return comment;
+ }
+
+ if (comment.kind === 'class' && comment.hideconstructor) {
+ return comment;
+ }
+
+ let params = t.isTSMethodSignature(path)
+ ? path.node.parameters
+ : path.node.params;
+
+ // Flow function annotations separate rest parameters into a different list
+ if (t.isFunctionTypeAnnotation(path) && path.node.rest) {
+ params = params.concat(path.node.rest);
+ }
+
+ const result = inferAndCombineParams(params, comment);
+
+ // Wrap flow rest parameter with a RestType
+ if (t.isFunctionTypeAnnotation(path) && path.node.rest) {
+ const rest = result.params[result.params.length - 1];
+ rest.type = {
+ type: 'RestType',
+ expression: rest.type
+ };
+ }
+
+ return result;
+}
+
+function inferAndCombineParams(params, comment) {
+ const inferredParams = params.map((param, i) => {
+ const doc = paramToDoc(param, '', i);
+ if (param.optional) {
+ doc.type = {
+ type: 'OptionalType',
+ expression: doc.type
+ };
+ }
+
+ return doc;
+ });
+ const paramsToMerge = comment.params;
+ if (comment.constructorComment) {
+ paramsToMerge.push.apply(paramsToMerge, comment.constructorComment.params);
+ }
+ const mergedParamsAndErrors = mergeTrees(inferredParams, paramsToMerge);
+
+ // Then merge the trees. This is the hard part.
+ return Object.assign(comment, {
+ params: mergedParamsAndErrors.mergedParams,
+ errors: comment.errors.concat(mergedParamsAndErrors.errors)
+ });
+}
+
+// Utility methods ============================================================
+//
+const PATH_SPLIT_CAPTURING = /(\[])?(\.)/g;
+const PATH_SPLIT = /(?:\[])?\./g;
+function tagDepth(tag) {
+ return (tag.name || '').split(PATH_SPLIT).length;
+}
+
+/**
+ * Index tags by their `name` property into an ES6 map.
+ */
+function mapTags(tags) {
+ return new Map(
+ tags.map(tag => {
+ return [tag.name, tag];
+ })
+ );
+}
+
+/**
+ * Babel parses JavaScript source code and produces an abstract syntax
+ * tree that includes methods and their arguments. This function takes
+ * that AST and uses it to infer details that would otherwise need
+ * explicit documentation, like the names of comments and their
+ * default values.
+ *
+ * It is especially careful to allow the user and the machine to collaborate:
+ * documentation.js should not overwrite any details that the user
+ * explicitly sets.
+ *
+ * @private
+ * @param {Object} param the abstract syntax tree of the parameter in JavaScript
+ * @param {number} i the number of this parameter, in argument order
+ * @param {string} prefix of the comment, if it is nested, like in the case of destructuring
+ * @returns {Object} parameter with inference.
+ */
+function paramToDoc(param, prefix, i) {
+ const autoName = '$' + String(i);
+ const prefixedName = prefix + '.' + param.name;
+
+ switch (param.type) {
+ case 'AssignmentPattern': {
+ // (a = b)
+ const newAssignmentParam = paramToDoc(param.left, '', i);
+
+ if (Array.isArray(newAssignmentParam)) {
+ throw new Error('Encountered an unexpected parameter type');
+ }
+
+ return Object.assign(newAssignmentParam, {
+ default: generate(param.right, {
+ compact: true
+ }).code,
+ type: newAssignmentParam.type
+ });
+ }
+ // ObjectPattern
+ case 'ObjectPattern': {
+ // { a }
+ if (prefix === '') {
+ // If this is a root-level param, like f({ x }), then we need to name
+ // it, like $0 or $1, depending on its position.
+ return {
+ title: 'param',
+ name: autoName,
+ anonymous: true,
+ type: (param.typeAnnotation &&
+ typeAnnotation(param.typeAnnotation)) || {
+ type: 'NameExpression',
+ name: 'Object'
+ },
+ properties: _.flatMap(param.properties, prop => {
+ return paramToDoc(prop, prefix + autoName);
+ })
+ };
+ } else if (param.indexed) {
+ // Likewise, if this object pattern sits inside of an ArrayPattern,
+ // like [{ foo }], it shouldn't just look like $0.foo, but like $0.0.foo,
+ // so make sure it isn't indexed first.
+ return {
+ title: 'param',
+ name: prefixedName,
+ anonymous: true,
+ type: (param.typeAnnotation &&
+ typeAnnotation(param.typeAnnotation)) || {
+ type: 'NameExpression',
+ name: 'Object'
+ },
+ properties: _.flatMap(param.properties, prop => {
+ return paramToDoc(prop, prefixedName);
+ })
+ };
+ }
+ // If, otherwise, this is nested, we don't really represent it as
+ // a parameter in and of itself - we just want its children, and
+ // it will be the . in obj.prop
+ return _.flatMap(param.properties, prop => {
+ return paramToDoc(prop, prefix);
+ });
+ }
+ // ArrayPattern
+ case 'ArrayPattern': {
+ // ([a, b, { c }])
+ if (prefix === '') {
+ return {
+ title: 'param',
+ name: autoName,
+ anonymous: true,
+ type: (param.typeAnnotation &&
+ typeAnnotation(param.typeAnnotation)) || {
+ type: 'NameExpression',
+ name: 'Array'
+ },
+ // Array destructuring lets you name the elements in the array,
+ // but those names don't really make sense within the JSDoc
+ // indexing tradition, or have any external meaning. So
+ // instead we're going to (immutably) rename the parameters to their
+ // indices
+ properties: _.flatMap(param.elements, (element, idx) => {
+ const indexedElement = Object.assign({}, element, {
+ name: String(idx),
+ indexed: true
+ });
+ return paramToDoc(indexedElement, autoName);
+ })
+ };
+ }
+ return _.flatMap(param.elements, (element, idx) => {
+ const indexedElement = Object.assign({}, element, {
+ name: String(idx)
+ });
+ return paramToDoc(indexedElement, prefix);
+ });
+ }
+ case 'ObjectProperty': {
+ return Object.assign(
+ paramToDoc(
+ param.value,
+ prefix + '.' + param.key.name || param.key.value
+ ),
+ {
+ name: prefix + '.' + param.key.name || param.key.value
+ }
+ );
+ }
+ case 'RestProperty': // (a, ...b)
+ case 'RestElement': {
+ const type = {
+ type: 'RestType'
+ };
+ if (param.typeAnnotation) {
+ type.expression = typeAnnotation(param.typeAnnotation);
+ }
+ return {
+ title: 'param',
+ name: prefix ? `${prefix}.${param.argument.name}` : param.argument.name,
+ lineNumber: param.loc.start.line,
+ type
+ };
+ }
+ case 'FunctionTypeParam': // flow interface method signature
+ return {
+ title: 'param',
+ name: prefix ? prefix + '.' + param.name.name : param.name.name,
+ lineNumber: param.loc.start.line,
+ type: param.typeAnnotation
+ ? typeAnnotation(param.typeAnnotation)
+ : undefined
+ };
+ default: {
+ // (a)
+ const newParam = {
+ title: 'param',
+ name: prefix ? prefixedName : param.name,
+ // A skipped array argument like ([, a]);
+ // looks like { name: '0', indexed: true }, and thus has no location,
+ // so we allow location to be undefined here.
+ lineNumber: param.loc ? param.loc.start.line : undefined
+ };
+
+ // Flow/TS annotations
+ if (param.typeAnnotation && param.typeAnnotation.typeAnnotation) {
+ newParam.type = typeAnnotation(param.typeAnnotation.typeAnnotation);
+ }
+
+ return newParam;
+ }
+ }
+}
+
+/**
+ * Recurse through a potentially nested parameter tag,
+ * replacing the auto-generated name, like $0, with an explicit
+ * name provided from a JSDoc comment. For instance, if you have a code
+ * block like
+ *
+ * function f({ x });
+ *
+ * It would by default be documented with a first param $0, with a member $0.x
+ *
+ * If you specify the name of the param, then it could be documented with, say,
+ * options and options.x. So we need to recursively rename not just $0 but
+ * also $0.x and maybe $0.x.y.z all to options.x and options.x.y.z
+ */
+function renameTree(node, explicitName) {
+ const parts = node.name.split(PATH_SPLIT_CAPTURING);
+ parts[0] = explicitName;
+ node.name = parts.join('');
+ if (node.properties) {
+ node.properties.forEach(property => renameTree(property, explicitName));
+ }
+}
+
+export function mergeTrees(inferred, explicit) {
+ // The first order of business is ensuring that the root types are specified
+ // in the right order. For the order of arguments, the inferred reality
+ // is the ground-truth: a function like
+ // function addThem(a, b, c) {}
+ // Should always see (a, b, c) in that order
+
+ // First, if all parameters are specified, allow explicit names to apply
+ // to destructuring parameters, which do not have inferred names. This is
+ // _only_ enabled in the case in which all parameters are specified explicitly
+ if (inferred.length === explicit.length) {
+ for (let i = 0; i < inferred.length; i++) {
+ if (inferred[i].anonymous === true) {
+ renameTree(inferred[i], explicit[i].name);
+ }
+ }
+ }
+
+ return mergeTopNodes(inferred, explicit);
+}
+
+function mergeTopNodes(inferred, explicit) {
+ const mapExplicit = mapTags(explicit);
+ const inferredNames = new Set(inferred.map(tag => tag.name));
+ const explicitTagsWithoutInference = explicit.filter(tag => {
+ return tagDepth(tag) === 1 && !inferredNames.has(tag.name);
+ });
+
+ const errors = explicitTagsWithoutInference.map(tag => {
+ return {
+ message:
+ `An explicit parameter named ${
+ tag.name || ''
+ } was specified but didn't match ` +
+ `inferred information ${Array.from(inferredNames).join(', ')}`,
+ commentLineNumber: tag.lineNumber
+ };
+ });
+
+ return {
+ errors,
+ mergedParams: inferred
+ .map(inferredTag => {
+ const explicitTag = mapExplicit.get(inferredTag.name);
+ return explicitTag
+ ? combineTags(inferredTag, explicitTag)
+ : inferredTag;
+ })
+ .concat(explicitTagsWithoutInference)
+ };
+}
+
+// This method is used for _non-root_ properties only - we use mergeTopNodes
+// for root properties, which strictly requires inferred only. In this case,
+// we combine all tags:
+// - inferred & explicit
+// - explicit only
+// - inferred only
+function mergeNodes(inferred, explicit) {
+ const intersection = _.intersectionBy(inferred, explicit, tag => tag.name);
+ const explicitOnly = _.differenceBy(explicit, inferred, tag => tag.name);
+ const inferredOnly = _.differenceBy(inferred, explicit, tag => tag.name);
+ const mapExplicit = mapTags(explicit);
+
+ return intersection
+ .map(inferredTag => {
+ const explicitTag = mapExplicit.get(inferredTag.name);
+ return explicitTag ? combineTags(inferredTag, explicitTag) : inferredTag;
+ })
+ .concat(explicitOnly)
+ .concat(inferredOnly);
+}
+
+function combineTags(inferredTag, explicitTag) {
+ let type = explicitTag.type;
+ let defaultValue;
+ if (!explicitTag.type) {
+ type = inferredTag.type;
+ }
+
+ if (!explicitTag.default && inferredTag.default) {
+ defaultValue = inferredTag.default;
+ }
+
+ const hasProperties =
+ (inferredTag.properties && inferredTag.properties.length) ||
+ (explicitTag.properties && explicitTag.properties.length);
+
+ return Object.assign(
+ explicitTag,
+ hasProperties
+ ? {
+ properties: mergeNodes(
+ inferredTag.properties || [],
+ explicitTag.properties || []
+ )
+ }
+ : {},
+ { type },
+ defaultValue ? { default: defaultValue } : {}
+ );
+}
diff --git a/src/infer/properties.js b/src/infer/properties.js
new file mode 100644
index 000000000..0560d1e1a
--- /dev/null
+++ b/src/infer/properties.js
@@ -0,0 +1,110 @@
+import typeAnnotation from '../type_annotation.js';
+import findTarget from './finders.js';
+
+function prefixedName(name, prefix) {
+ if (prefix.length) {
+ return prefix.join('.') + '.' + name;
+ }
+ return name;
+}
+
+function isObjectSpreadAndExactUtilTypeProperty(property) {
+ return (
+ property.type === 'ObjectTypeSpreadProperty' &&
+ property.argument.id.name === '$Exact'
+ );
+}
+
+function propertyToDoc(property, prefix) {
+ let type;
+ let name;
+
+ if (property.type === 'ObjectTypeProperty') {
+ // flow
+ type = typeAnnotation(property.value);
+ } else if (property.type === 'TSPropertySignature') {
+ // typescript
+ type = typeAnnotation(property.typeAnnotation);
+ } else if (property.type === 'TSMethodSignature') {
+ // typescript
+ type = typeAnnotation(property);
+ }
+
+ if (property.key) {
+ name = property.key.name || property.key.value;
+ }
+
+ // Special handling for { ...$Exact }
+ if (isObjectSpreadAndExactUtilTypeProperty(property)) {
+ name = property.argument.id.name;
+ type = {
+ type: 'NameExpression',
+ name: property.argument.typeParameters.params[0].id.name
+ };
+ }
+
+ if (property.optional) {
+ type = {
+ type: 'OptionalType',
+ expression: type
+ };
+ }
+ return {
+ title: 'property',
+ name: prefixedName(name, prefix),
+ lineNumber: property.loc.start.line,
+ type
+ };
+}
+
+/**
+ * Infers properties of TypeAlias objects (Flow or TypeScript type definitions)
+ *
+ * @param {Object} comment parsed comment
+ * @returns {Object} comment with inferred properties
+ */
+export default function inferProperties(comment) {
+ const explicitProperties = new Set();
+ // Ensure that explicitly specified properties are not overridden
+ // by inferred properties
+ comment.properties.forEach(prop => explicitProperties.add(prop.name));
+
+ function inferProperties(value, prefix) {
+ if (
+ value.type === 'ObjectTypeAnnotation' ||
+ value.type === 'TSTypeLiteral'
+ ) {
+ const properties = value.properties || value.members || value.body || [];
+ properties.forEach(function (property) {
+ let name;
+
+ if (property.key) {
+ name = property.key.name;
+ }
+
+ // Special handling for { ...$Exact }
+ if (isObjectSpreadAndExactUtilTypeProperty(property)) {
+ name = property.argument.id.name;
+ }
+
+ if (!explicitProperties.has(prefixedName(name, prefix))) {
+ comment.properties = comment.properties.concat(
+ propertyToDoc(property, prefix)
+ );
+ }
+ });
+ }
+ }
+
+ const path = findTarget(comment.context.ast);
+
+ if (path) {
+ if (path.isTypeAlias()) {
+ inferProperties(path.node.right, []);
+ } else if (path.isTSTypeAliasDeclaration()) {
+ inferProperties(path.node.typeAnnotation, []);
+ }
+ }
+
+ return comment;
+}
diff --git a/src/infer/return.js b/src/infer/return.js
new file mode 100644
index 000000000..a33917599
--- /dev/null
+++ b/src/infer/return.js
@@ -0,0 +1,114 @@
+import findTarget from './finders.js';
+import t from '@babel/types';
+import typeAnnotation from '../type_annotation.js';
+
+// TypeScript does not currently support typing the return value of a generator function.
+// This is coming in TypeScript 3.3 - https://github.com/Microsoft/TypeScript/pull/30790
+const TS_GENERATORS = {
+ Iterator: 1,
+ Iterable: 1,
+ IterableIterator: 1
+};
+
+const FLOW_GENERATORS = {
+ Iterator: 1,
+ Iterable: 1,
+ Generator: 3
+};
+
+/**
+ * Infers returns tags by using Flow return type annotations
+ *
+ * @name inferReturn
+ * @param {Object} comment parsed comment
+ * @returns {Object} comment with return tag inferred
+ */
+export default function inferReturn(comment) {
+ if (
+ Array.isArray(comment.returns) &&
+ comment.returns.length &&
+ comment.returns[0].type
+ ) {
+ return comment;
+ }
+ const path = findTarget(comment.context.ast);
+ let fn = path && path.node;
+ if (!fn) {
+ return comment;
+ }
+
+ // In case of `/** */ var x = function () {}` findTarget returns
+ // the declarator.
+ if (t.isVariableDeclarator(fn)) {
+ fn = fn.init;
+ }
+
+ const fnReturnType = getReturnType(fn);
+ if (fnReturnType) {
+ let returnType = typeAnnotation(fnReturnType);
+ let yieldsType = null;
+
+ if (fn.generator && returnType.type === 'TypeApplication') {
+ comment.generator = true;
+ let numArgs;
+
+ if (t.isFlow(fnReturnType)) {
+ numArgs = FLOW_GENERATORS[returnType.expression.name];
+ } else if (t.isTSTypeAnnotation(fnReturnType)) {
+ numArgs = TS_GENERATORS[returnType.expression.name];
+ }
+
+ if (returnType.applications.length === numArgs) {
+ yieldsType = returnType.applications[0];
+
+ if (numArgs > 1) {
+ returnType = returnType.applications[1];
+ } else {
+ returnType = {
+ type: 'VoidLiteral'
+ };
+ }
+ }
+ }
+
+ if (yieldsType) {
+ if (comment.yields && comment.yields.length > 0) {
+ comment.yields[0].type = yieldsType;
+ } else {
+ comment.yields = [
+ {
+ title: 'yields',
+ type: yieldsType
+ }
+ ];
+ }
+ }
+
+ if (comment.returns && comment.returns.length > 0) {
+ comment.returns[0].type = returnType;
+ } else {
+ comment.returns = [
+ {
+ title: 'returns',
+ type: returnType
+ }
+ ];
+ }
+ }
+ return comment;
+}
+
+function getReturnType(fn) {
+ if (
+ t.isFunction(fn) ||
+ t.isTSDeclareFunction(fn) ||
+ t.isTSDeclareMethod(fn) ||
+ t.isFunctionTypeAnnotation(fn)
+ ) {
+ return fn.returnType;
+ }
+
+ if (t.isTSMethodSignature(fn)) {
+ return fn.typeAnnotation;
+ }
+}
diff --git a/src/infer/type.js b/src/infer/type.js
new file mode 100644
index 000000000..67779dff0
--- /dev/null
+++ b/src/infer/type.js
@@ -0,0 +1,73 @@
+import findTarget from './finders.js';
+import typeAnnotation from '../type_annotation.js';
+
+const constTypeMapping = {
+ BooleanLiteral: { type: 'BooleanTypeAnnotation' },
+ NumericLiteral: { type: 'NumberTypeAnnotation' },
+ StringLiteral: { type: 'StringTypeAnnotation' }
+};
+
+/**
+ * Infers type tags by using Flow/TypeScript type annotations
+ *
+ * @name inferType
+ * @param {Object} comment parsed comment
+ * @returns {Object} comment with type tag inferred
+ */
+export default function inferType(comment) {
+ if (comment.type) {
+ return comment;
+ }
+
+ const ast = comment.context.ast;
+ const path = findTarget(ast);
+ if (!path) {
+ return comment;
+ }
+
+ const n = path.node;
+ let type;
+ switch (n.type) {
+ case 'VariableDeclarator':
+ type = n.id.typeAnnotation;
+ if (!type && comment.kind === 'constant') {
+ type = constTypeMapping[n.init.type];
+ }
+ break;
+ case 'ClassProperty':
+ case 'TSTypeAliasDeclaration':
+ case 'TSPropertySignature':
+ type = n.typeAnnotation;
+ break;
+ case 'ClassMethod':
+ case 'TSDeclareMethod':
+ if (n.kind === 'get') {
+ type = n.returnType;
+ } else if (n.kind === 'set' && n.params[0]) {
+ type = n.params[0].typeAnnotation;
+ }
+ break;
+ case 'TypeAlias':
+ type = n.right;
+ break;
+ case 'TSEnumMember':
+ if (n.initializer) {
+ if (constTypeMapping[n.initializer.type]) {
+ type = constTypeMapping[n.initializer.type];
+ }
+ } else {
+ type = constTypeMapping.NumericLiteral;
+ }
+ break;
+ default:
+ if (ast.isObjectTypeProperty() && !ast.node.method) {
+ type = ast.node.value;
+ }
+ }
+ // Don't provide a `type` section when it's an ObjectTypeAnnotation,
+ // `properties` already exists and renders better.
+ if (type && type.type !== 'ObjectTypeAnnotation') {
+ comment.type = typeAnnotation(type);
+ }
+ return comment;
+}
diff --git a/src/input/dependency.js b/src/input/dependency.js
new file mode 100644
index 000000000..4a737e808
--- /dev/null
+++ b/src/input/dependency.js
@@ -0,0 +1,31 @@
+import mdeps from './moduleDeps.js';
+import internalOnly from '../module_filters.js';
+import smartGlob from './smart_glob.js';
+
+/**
+ * Returns a array of dependencies, given an array of entry
+ * points and an object of options to provide to module-deps.
+ *
+ * This stream requires filesystem access, and thus isn't suitable
+ * for a browser environment.
+ *
+ * @param indexes paths to entry files as strings
+ * @param config optional options passed
+ * @returns results
+ */
+export default async function dependencyStream(
+ indexes,
+ { parseExtension = [], requireExtension = [] }
+) {
+ const md = await mdeps(smartGlob(indexes, parseExtension), {
+ /**
+ * Determine whether a module should be included in documentation
+ * @param {string} id path to a module
+ * @returns {boolean} true if the module should be included.
+ */
+ filter: id => internalOnly(id),
+ extensions: [...parseExtension, ...requireExtension]
+ });
+
+ return md;
+}
diff --git a/src/input/moduleDeps.js b/src/input/moduleDeps.js
new file mode 100644
index 000000000..b2e8479fd
--- /dev/null
+++ b/src/input/moduleDeps.js
@@ -0,0 +1,108 @@
+import path from 'path';
+import util from 'util';
+import r from 'resolve';
+import readFileCode from './readFileCode.js';
+import konan from 'konan';
+import { parseToAst } from '../parsers/parse_to_ast.js';
+
+// const parseExst = ['.js', '.mjs', '.jsx', '.vue', '.ts', '.tsx'];
+const resolveExst = ['.json', '.css', '.less', '.sass'];
+const resolve = util.promisify(r);
+
+class Deps {
+ constructor(opts = {}) {
+ this.fileCache = opts.fileCache || {};
+ this.visited = {};
+ this.res = [];
+
+ this.options = { ...opts };
+ }
+
+ async flush(input) {
+ const promises = input.map(file => {
+ const dir = path.dirname(file);
+ return this.walk(file, {
+ basedir: dir,
+ filename: 'root'
+ });
+ });
+ await Promise.all(promises);
+
+ return this.res;
+ }
+
+ async readFile(file) {
+ if (this.fileCache[file]) {
+ return this.fileCache[file];
+ }
+
+ return readFileCode(file);
+ }
+
+ async walk(id, parent) {
+ const extensions = this.options.extensions;
+ const sortKey = parent.sortKey || '';
+ let file = null;
+
+ try {
+ file = await resolve(id, { ...parent, extensions });
+ } catch (err) {
+ if (err.code === 'MODULE_NOT_FOUND') {
+ console.warn(`module not found: "${id}" from file ${parent.filename}`);
+ return;
+ }
+ throw err;
+ }
+
+ if (this.visited[file] || resolveExst.includes(path.extname(file))) {
+ return file;
+ }
+ this.visited[file] = true;
+
+ const source = await this.readFile(file);
+ const depsArray = this.parseDeps(file, source);
+ if (!depsArray) {
+ return file;
+ }
+
+ const deps = {};
+ const promises = depsArray.map(async (id, i) => {
+ const filter = this.options.filter;
+ if (filter && !filter(id)) {
+ deps[id] = false;
+ return;
+ }
+ const number = i.toString().padStart(8, '0');
+ deps[id] = await this.walk(id, {
+ filename: file,
+ basedir: path.dirname(file),
+ sortKey: sortKey + '!' + file + ':' + number
+ });
+ });
+
+ await Promise.all(promises);
+
+ this.res.push({
+ id: file,
+ source,
+ deps,
+ file,
+ sortKey: sortKey + '!' + file
+ });
+ return file;
+ }
+
+ parseDeps(file, src) {
+ try {
+ const ast = parseToAst(src, file);
+ return konan(ast).strings;
+ } catch (ex) {
+ console.error(`Parsing file ${file}: ${ex}`);
+ }
+ }
+}
+
+export default async function (input = [], opts = {}) {
+ const dep = new Deps(opts);
+ return dep.flush(Array.from(new Set(input)));
+}
diff --git a/src/input/readFileCode.js b/src/input/readFileCode.js
new file mode 100644
index 000000000..5b71a610a
--- /dev/null
+++ b/src/input/readFileCode.js
@@ -0,0 +1,42 @@
+import path from 'path';
+import { readFile } from 'fs/promises';
+let vuecompiler = null;
+let vueVersion = 'v3';
+
+async function vueParser(source) {
+ if (!vuecompiler) {
+ try {
+ vuecompiler = await import('@vue/compiler-sfc');
+ } catch {
+ try {
+ vuecompiler = await import('vue-template-compiler');
+ vueVersion = 'v2';
+ } catch (err) {
+ console.error(
+ 'You need to load package vue-template-compiler for Vue 2 or @vue/compiler-sfc for Vue 3'
+ );
+ throw err;
+ }
+ }
+ }
+
+ let component = {};
+ if (vueVersion === 'v3') {
+ component = vuecompiler.parse(source).descriptor;
+ } else {
+ component = vuecompiler.parseComponent(source);
+ }
+
+ return component.script?.content || '';
+}
+
+export default async function readFileCode(file) {
+ let source = await readFile(file, {
+ encoding: 'utf8'
+ });
+
+ if (path.extname(file) === '.vue') {
+ source = await vueParser(source);
+ }
+ return source;
+}
diff --git a/src/input/shallow.js b/src/input/shallow.js
new file mode 100644
index 000000000..7ee6b6392
--- /dev/null
+++ b/src/input/shallow.js
@@ -0,0 +1,38 @@
+import smartGlob from './smart_glob.js';
+import readFileCode from './readFileCode.js';
+
+/**
+ * A readable source for content that doesn't do dependency resolution, but
+ * simply reads files and pushes them onto a stream.
+ *
+ * If an array of strings is provided as input to this method, then
+ * they will be treated as filenames and read into the stream.
+ *
+ * If an array of objects is provided, then we assume that they are valid
+ * objects with `source` and `file` properties, and don't use the filesystem
+ * at all. This is one way of getting documentation.js to run in a browser
+ * or without fs access.
+ *
+ * @param indexes entry points
+ * @param config parsing options
+ * @returns promise with parsed files
+ */
+export default async function (indexes, config) {
+ const objects = [];
+ const paths = indexes.filter(v => {
+ if (typeof v === 'object') {
+ v.file = v.file ?? '';
+ objects.push(v);
+ return false;
+ }
+ return typeof v === 'string';
+ });
+ const files = await Promise.all(
+ smartGlob(paths, config.parseExtension).map(async file => ({
+ source: await readFileCode(file),
+ file
+ }))
+ );
+
+ return [...objects, ...files];
+}
diff --git a/src/input/smart_glob.js b/src/input/smart_glob.js
new file mode 100644
index 000000000..c845d714c
--- /dev/null
+++ b/src/input/smart_glob.js
@@ -0,0 +1,131 @@
+import fs from 'fs';
+import path from 'path';
+import glob from 'glob';
+
+/**
+ * Replace Windows with posix style paths
+ *
+ * @param {string} filepath Path to convert
+ * @returns {string} Converted filepath
+ */
+function convertPathToPosix(filepath) {
+ const normalizedFilepath = path.normalize(filepath);
+ const posixFilepath = normalizedFilepath.replace(/\\/g, '/');
+
+ return posixFilepath;
+}
+
+/**
+ * Checks if a provided path is a directory and returns a glob string matching
+ * all files under that directory if so, the path itself otherwise.
+ *
+ * Reason for this is that `glob` needs `/**` to collect all the files under a
+ * directory where as our previous implementation without `glob` simply walked
+ * a directory that is passed. So this is to maintain backwards compatibility.
+ *
+ * Also makes sure all path separators are POSIX style for `glob` compatibility.
+ *
+ * @param {string[]} [extensions=['.js']] An array of accepted extensions
+ * @returns {Function} A function that takes a pathname and returns a glob that
+ * matches all files with the provided extensions if
+ * pathname is a directory.
+ */
+function processPath(extensions) {
+ const cwd = process.cwd();
+ extensions = extensions || ['.js'];
+
+ extensions = extensions.map(function (ext) {
+ return ext.replace(/^\./, '');
+ });
+
+ let suffix = '/**';
+
+ if (extensions.length === 1) {
+ suffix += '/*.' + extensions[0];
+ } else {
+ suffix += '/*.{' + extensions.join(',') + '}';
+ }
+
+ /**
+ * A function that converts a directory name to a glob pattern
+ *
+ * @param {string} pathname The directory path to be modified
+ * @returns {string} The glob path or the file path itself
+ * @private
+ */
+ return function (pathname) {
+ let newPath = pathname;
+ const resolvedPath = path.resolve(cwd, pathname);
+
+ if (
+ fs.existsSync(resolvedPath) &&
+ fs.lstatSync(resolvedPath).isDirectory()
+ ) {
+ newPath = pathname.replace(/[/\\]$/, '') + suffix;
+ }
+
+ return convertPathToPosix(newPath);
+ };
+}
+
+/**
+ * Resolves any directory patterns into glob-based patterns for easier handling.
+ * @param {string[]} patterns File patterns (such as passed on the command line).
+ * @param {Array} extensions A list of file extensions
+ * @returns {string[]} The equivalent glob patterns and filepath strings.
+ */
+function resolveFileGlobPatterns(patterns, extensions) {
+ const processPathExtensions = processPath(extensions);
+ return patterns.map(processPathExtensions);
+}
+
+/**
+ * Build a list of absolute filenames on which ESLint will act.
+ * Ignored files are excluded from the results, as are duplicates.
+ *
+ * @param globPatterns Glob patterns.
+ * @returns Resolved absolute filenames.
+ */
+function listFilesToProcess(globPatterns) {
+ const files = [];
+ const added = new Set();
+
+ const cwd = process.cwd();
+
+ /**
+ * Executes the linter on a file defined by the `filename`. Skips
+ * unsupported file extensions and any files that are already linted.
+ * @param {string} filename The file to be processed
+ * @returns {void}
+ */
+ function addFile(filename) {
+ if (added.has(filename)) {
+ return;
+ }
+ files.push(filename);
+ added.add(filename);
+ }
+
+ globPatterns.forEach(function (pattern) {
+ const file = path.resolve(cwd, pattern);
+ if (fs.existsSync(file) && fs.statSync(file).isFile()) {
+ addFile(fs.realpathSync(file));
+ } else {
+ const globOptions = {
+ nodir: true,
+ dot: true,
+ cwd
+ };
+
+ glob.sync(pattern, globOptions).forEach(function (globMatch) {
+ addFile(path.resolve(cwd, globMatch));
+ });
+ }
+ });
+
+ return files;
+}
+
+export default function smartGlob(indexes, extensions) {
+ return listFilesToProcess(resolveFileGlobPatterns(indexes, extensions));
+}
diff --git a/src/is_jsdoc_comment.js b/src/is_jsdoc_comment.js
new file mode 100644
index 000000000..1ea85e309
--- /dev/null
+++ b/src/is_jsdoc_comment.js
@@ -0,0 +1,23 @@
+/**
+ * Detect whether a comment is a JSDoc comment: it must be a block
+ * comment which starts with two asterisks, not any other number of asterisks.
+ *
+ * The code parser automatically strips out the first asterisk that's
+ * required for the comment to be a comment at all, so we count the remaining
+ * comments.
+ *
+ * @name isJSDocComment
+ * @param {Object} comment an ast path of the comment
+ * @returns {boolean} whether it is valid
+ */
+export default function isJSDocComment(
+ comment /*: {
+ value: string,
+ type: string
+}*/
+) {
+ const asterisks = comment.value.match(/^(\*+)/);
+ return (
+ comment.type === 'CommentBlock' && asterisks && asterisks[1].length === 1
+ );
+}
diff --git a/lib/lint.js b/src/lint.js
similarity index 50%
rename from lib/lint.js
rename to src/lint.js
index aa32990c0..163f864ed 100644
--- a/lib/lint.js
+++ b/src/lint.js
@@ -1,18 +1,17 @@
-'use strict';
+import { VFile } from 'vfile';
+import walk from './walk.js';
+import { sort as vfileSort } from 'vfile-sort';
+import { reporter } from 'vfile-reporter';
+import { nest } from './nest.js';
-var VFile = require('vfile'),
- walk = require('../lib/walk'),
- vfileSort = require('vfile-sort'),
- reporter = require('vfile-reporter');
-
-var CANONICAL = {
- 'String': 'string',
- 'Boolean': 'boolean',
- 'Undefined': 'undefined',
- 'Number': 'number',
- 'array': 'Array',
- 'date': 'Date',
- 'object': 'Object'
+const CANONICAL = {
+ String: 'string',
+ Boolean: 'boolean',
+ Undefined: 'undefined',
+ Number: 'number',
+ array: 'Array',
+ date: 'Date',
+ object: 'Object'
};
/**
@@ -22,12 +21,13 @@ var CANONICAL = {
* @param {Object} comment parsed comment
* @returns {Array} array of errors
*/
-function lintComments(comment) {
+export function lintComments(comment) {
comment.tags.forEach(function (tag) {
function nameInvariant(name) {
- if (CANONICAL[name]) {
+ if (name && typeof CANONICAL[name] === 'string') {
comment.errors.push({
- message: 'type ' + name + ' found, ' + CANONICAL[name] + ' is standard',
+ message:
+ 'type ' + name + ' found, ' + CANONICAL[name] + ' is standard',
commentLineNumber: tag.lineNumber
});
}
@@ -38,7 +38,12 @@ function lintComments(comment) {
nameInvariant(type.name);
}
- [type.elements, type.applications].forEach(checkSubtypes);
+ if (type.elements) {
+ checkSubtypes(type.elements);
+ }
+ if (type.applications) {
+ checkSubtypes(type.applications);
+ }
}
function checkSubtypes(subtypes) {
@@ -51,6 +56,8 @@ function lintComments(comment) {
checkCanonical(tag.type);
}
});
+ nest(comment);
+
return comment;
}
@@ -58,25 +65,22 @@ function lintComments(comment) {
* @private
* Extract lint instructions from comments and generate user-readable output.
* @param {Array} comments a list of comments
- * @return {string} user-readable output
+ * @returns {string} user-readable output
*/
-function formatLint(comments) {
- var vFiles = {};
+export function formatLint(comments) {
+ const vFiles = {};
walk(comments, function (comment) {
comment.errors.forEach(function (error) {
- var p = comment.context.file;
- vFiles[p] = vFiles[p] || new VFile({
- path: p
- });
- vFiles[p].warn(error.message, {
+ const p = comment.context.file;
+ vFiles[p] =
+ vFiles[p] ||
+ new VFile({
+ path: p
+ });
+ vFiles[p].message(error.message, {
line: comment.loc.start.line + (error.commentLineNumber || 0)
});
});
});
- return reporter(Object.keys(vFiles).map(function (p) {
- return vfileSort(vFiles[p]);
- }));
+ return reporter(Object.keys(vFiles).map(p => vfileSort(vFiles[p])));
}
-
-module.exports.lintComments = lintComments;
-module.exports.formatLint = formatLint;
diff --git a/src/merge_config.js b/src/merge_config.js
new file mode 100644
index 000000000..cea2591c6
--- /dev/null
+++ b/src/merge_config.js
@@ -0,0 +1,84 @@
+import conf from './config.js';
+import yaml from 'js-yaml';
+import fs from 'fs';
+import pify from 'pify';
+import { readPackageUp } from 'read-pkg-up';
+import path from 'path';
+import stripComments from 'strip-json-comments';
+
+function normalizeToc(config, basePath) {
+ if (!config || !config.toc) {
+ return config;
+ }
+
+ config.toc = config.toc.map(entry => {
+ if (entry && entry.file) {
+ entry.file = path.join(basePath, entry.file);
+ }
+ return entry;
+ });
+
+ return config;
+}
+
+/**
+ * Use the nearest package.json file for the default
+ * values of `name` and `version` config.
+ *
+ * @param {boolean} noPackage options which prevent ge info about project from package.json
+ * @returns {Promise} configuration with inferred parameters
+ */
+async function readPackage(noPackage) {
+ const global = conf.globalConfig;
+ if (noPackage) {
+ return {};
+ }
+ const param = ['name', 'homepage', 'version', 'description'];
+ try {
+ const { packageJson } = await readPackageUp();
+ return param.reduce((res, key) => {
+ res[`project-${key}`] = global[key] || packageJson[key];
+ return res;
+ }, {});
+ } catch (e) {
+ return {};
+ }
+}
+
+/**
+ * Merge a configuration file into program config, assuming that the location
+ * of the configuration file is given as one of those config.
+ *
+ * @param {String} config the user-provided config path, usually via argv
+ * @returns {Promise} configuration, which are parsed
+ * @throws {Error} if the file cannot be read.
+ */
+async function readConfigFile(config) {
+ if (typeof config !== 'string') {
+ return {};
+ }
+ const filePath = config;
+ const absFilePath = path.resolve(process.cwd(), filePath);
+ const rawFile = await pify(fs).readFile(absFilePath, 'utf8');
+ const basePath = path.dirname(absFilePath);
+
+ let obj = null;
+ if (path.extname(filePath) === '.json') {
+ obj = JSON.parse(stripComments(rawFile));
+ } else {
+ obj = yaml.load(rawFile);
+ }
+ if ('noPackage' in obj) {
+ obj['no-package'] = obj.noPackage;
+ delete obj.noPackage;
+ }
+ return normalizeToc(obj, basePath);
+}
+
+export default async function mergeConfig(config = {}) {
+ conf.add(config);
+ conf.add(await readConfigFile(conf.globalConfig.config));
+ conf.add(await readPackage(conf.globalConfig['no-package']));
+
+ return conf.globalConfig;
+}
diff --git a/src/module_filters.js b/src/module_filters.js
new file mode 100644
index 000000000..59cc92d50
--- /dev/null
+++ b/src/module_filters.js
@@ -0,0 +1,11 @@
+// Skip external modules. Based on http://git.io/pzPO.
+const internalModuleRegexp =
+ process.platform === 'win32'
+ ? /* istanbul ignore next */
+ /^(\.|\w:)/
+ : /^[/.]/;
+
+/**
+ * Module filters
+ */
+export default id => internalModuleRegexp.test(id);
diff --git a/src/nest.js b/src/nest.js
new file mode 100644
index 000000000..e8471c376
--- /dev/null
+++ b/src/nest.js
@@ -0,0 +1,102 @@
+import _ from 'lodash';
+
+const PATH_SPLIT = /(?:\[])?\./g;
+
+function removeUnnamedTags(tags) {
+ return tags.filter(tag => typeof tag.name === 'string');
+}
+
+const tagDepth = tag => tag.name.split(PATH_SPLIT).length;
+
+/**
+ * Nest nestable tags, like param and property, into nested
+ * arrays that are suitable for output.
+ * Okay, so we're building a tree of comments, with the tag.name
+ * being the indexer. We sort by depth, so that we add each
+ * level of the tree incrementally, and throw if we run against
+ * a node that doesn't have a parent.
+ *
+ * foo.abe
+ * foo.bar.baz
+ * foo.bar.a
+ * foo.bar[].bax
+ *
+ * foo -> .abe
+ * \-> .bar -> .baz
+ * \-> .a
+ * \-> [].baz
+ *
+ * @private
+ * @param {Array} tags a list of tags
+ * @returns {Object} nested comment
+ */
+export const nestTag = (
+ tags,
+ errors
+ // Use lodash here both for brevity and also because, unlike JavaScript's
+ // sort, it's stable.
+) =>
+ _.sortBy(removeUnnamedTags(tags), tagDepth).reduce(
+ (memo, tag) => {
+ function insertTag(node, parts) {
+ // The 'done' case: we're at parts.length === 1,
+ // this is where the node should be placed. We reliably
+ // get to this case because the recursive method
+ // is always passed parts.slice(1)
+ if (parts.length === 1) {
+ Object.assign(node, {
+ properties: (node.properties || []).concat(tag)
+ });
+ } else {
+ // The recursive case: try to find the child that owns
+ // this tag.
+ const child =
+ node.properties &&
+ node.properties.find(
+ property => parts[0] === _.last(property.name.split(PATH_SPLIT))
+ );
+
+ if (!child) {
+ if (tag.name.match(/^(\$\d+)/)) {
+ errors.push({
+ message:
+ `Parent of ${tag.name} not found. To document a destructuring\n` +
+ `type, add a @param tag in its position to specify the name of the\n` +
+ `destructured parameter`,
+ commentLineNumber: tag.lineNumber
+ });
+ } else {
+ errors.push({
+ message: `Parent of ${tag.name} not found`,
+ commentLineNumber: tag.lineNumber
+ });
+ }
+ } else {
+ insertTag(child, parts.slice(1));
+ }
+ }
+ }
+
+ insertTag(memo, tag.name.split(PATH_SPLIT));
+ return memo;
+ },
+ { properties: [] }
+ ).properties;
+
+/**
+ * Nests
+ * [parameters with properties](http://usejsdoc.org/tags-param.html#parameters-with-properties).
+ *
+ * A parameter `employee.name` will be attached to the parent parameter `employee` in
+ * a `properties` array.
+ *
+ * This assumes that incoming comments have been flattened.
+ *
+ * @param {Object} comment input comment
+ * @returns {Object} nested comment
+ */
+export const nest = comment =>
+ Object.assign(comment, {
+ params: nestTag(comment.params, comment.errors),
+ properties: nestTag(comment.properties, comment.errors)
+ });
diff --git a/lib/output/highlighter.js b/src/output/highlighter.js
similarity index 57%
rename from lib/output/highlighter.js
rename to src/output/highlighter.js
index 69caabfe4..4d43d52b8 100644
--- a/lib/output/highlighter.js
+++ b/src/output/highlighter.js
@@ -1,5 +1,5 @@
-var visit = require('unist-util-visit');
-var hljs = require('highlight.js');
+import { visit } from 'unist-util-visit';
+import hljs from 'highlight.js';
/**
* Adapted from remark-highlight.js
@@ -11,12 +11,14 @@ var hljs = require('highlight.js');
function visitor(node) {
if (node.lang) {
node.type = 'html';
- node.value = '' +
- hljs.highlightAuto(node.value, [node.lang]).value + ' ';
+ node.value =
+ "" +
+ hljs.highlightAuto(node.value, [node.lang]).value +
+ ' ';
}
}
-module.exports = function (ast) {
+export default function (ast) {
visit(ast, 'code', visitor);
return ast;
-};
+}
diff --git a/src/output/html.js b/src/output/html.js
new file mode 100644
index 000000000..34d004759
--- /dev/null
+++ b/src/output/html.js
@@ -0,0 +1,31 @@
+import path from 'path';
+import mergeConfig from '../merge_config.js';
+
+/**
+ * Formats documentation as HTML.
+ *
+ * @param {Array} comments parsed comments
+ * @param {Object} config Options that can customize the output
+ * @param {string} [config.theme='default_theme'] Name of a module used for an HTML theme.
+ * @returns {Promise>} Promise with results
+ * @name formats.html
+ * @public
+ * @example
+ * var documentation = require('documentation');
+ *
+ * documentation.build(['index.js'])
+ * .then(documentation.formats.html);
+ */
+export default async function html(comments, localConfig = {}) {
+ const config = await mergeConfig(localConfig);
+ let themePath = config.theme && path.resolve(process.cwd(), config.theme);
+ if (themePath) {
+ if (process.platform === 'win32'){
+ // On Windows, absolute paths must be prefixed with 'file:///' to avoid the ERR_UNSUPPORTED_ESM_URL_SCHEME error from import().
+ themePath = 'file:///' + themePath;
+ }
+
+ return (await import(themePath)).default(comments, config);
+ }
+ return (await import('../default_theme/index.js')).default(comments, config);
+}
diff --git a/src/output/json.js b/src/output/json.js
new file mode 100644
index 000000000..920c87514
--- /dev/null
+++ b/src/output/json.js
@@ -0,0 +1,30 @@
+import walk from '../walk.js';
+
+/**
+ * Formats documentation as a JSON string.
+ *
+ * @param {Array} comments parsed comments
+ * @returns {Promise}
+ * @name formats.json
+ * @public
+ * @example
+ * var documentation = require('documentation');
+ * var fs = require('fs');
+ *
+ * documentation.build(['index.js'])
+ * .then(documentation.formats.json)
+ * .then(output => {
+ * // output is a string of JSON data
+ * fs.writeFileSync('./output.json', output);
+ * });
+ */
+export default function json(comments) {
+ walk(comments, comment => {
+ delete comment.errors;
+ if (comment.context) {
+ delete comment.context.sortKey;
+ }
+ });
+
+ return Promise.resolve(JSON.stringify(comments, null, 2));
+}
diff --git a/src/output/markdown.js b/src/output/markdown.js
new file mode 100644
index 000000000..b7a76566c
--- /dev/null
+++ b/src/output/markdown.js
@@ -0,0 +1,32 @@
+import { remark } from 'remark';
+import remarkGfm from 'remark-gfm';
+import markdownAST from './markdown_ast.js';
+
+/**
+ * Formats documentation as
+ * [Markdown](https://daringfireball.net/projects/markdown/).
+ *
+ * @param {Array} comments parsed comments
+ * @param {Object} args Options that can customize the output
+ * @name formats.markdown
+ * @returns {Promise} a promise of the eventual value
+ * @public
+ * @example
+ * var documentation = require('documentation');
+ * var fs = require('fs');
+ *
+ * documentation.build(['index.js'])
+ * .then(documentation.formats.md)
+ * .then(output => {
+ * // output is a string of Markdown data
+ * fs.writeFileSync('./output.md', output);
+ * });
+ */
+export default function markdown(comments, args) {
+ if (!args) {
+ args = {};
+ }
+ return markdownAST(comments, args).then(ast =>
+ remark().use(remarkGfm).stringify(ast)
+ );
+}
diff --git a/src/output/markdown_ast.js b/src/output/markdown_ast.js
new file mode 100644
index 000000000..09ca97fe6
--- /dev/null
+++ b/src/output/markdown_ast.js
@@ -0,0 +1,395 @@
+import { u } from 'unist-builder';
+import { remark } from 'remark';
+import mergeConfig from '../merge_config.js';
+import toc from 'remark-toc';
+import links from 'remark-reference-links';
+import hljs from 'highlight.js';
+import GithubSlugger from 'github-slugger';
+import LinkerStack from './util/linker_stack.js';
+import rerouteLinks from './util/reroute_links.js';
+import _formatType from './util/format_type.js';
+
+const DEFAULT_LANGUAGE = 'javascript';
+
+/**
+ * Given a hierarchy-nested set of comments, generate an remark-compatible
+ * Abstract Syntax Tree usable for generating Markdown output
+ *
+ * @param comments nested comment
+ * @param {Object} args currently none accepted
+ * @param {boolean} [args.markdownToc=true] whether to include a table of contents
+ * in markdown output.
+ * @param {Object} [args.hljs={}] config to be passed to highlightjs for code highlighting:
+ * consult hljs.configure for the full list.
+ * @returns {Promise} returns an eventual Markdown value
+ */
+export default function markdownAST(comments, args) {
+ return mergeConfig(args).then(config => buildMarkdownAST(comments, config));
+}
+
+function buildMarkdownAST(comments, config) {
+ // Configure code highlighting
+ const hljsOptions = config.hljs || {};
+ hljs.configure(hljsOptions);
+
+ const linkerStack = new LinkerStack(config).namespaceResolver(
+ comments,
+ namespace => {
+ const slugger = new GithubSlugger();
+ return '#' + slugger.slug(namespace);
+ }
+ );
+
+ const formatType = _formatType.bind(undefined, linkerStack.link);
+
+ const generatorComment = [
+ u(
+ 'html',
+ ''
+ )
+ ];
+
+ const tableOfContentsHeading = [
+ u('heading', { depth: 3 }, [u('text', 'Table of Contents')])
+ ];
+
+ /**
+ * Generate an AST chunk for a comment at a given depth: this is
+ * split from the main function to handle hierarchically nested comments
+ *
+ * @param {number} depth nesting of the comment, starting at 1
+ * @param {Object} comment a single comment
+ * @returns {Object} remark-compatible AST
+ */
+ function generate(depth, comment) {
+ function typeSection(comment) {
+ return (
+ comment.type &&
+ u('paragraph', [u('text', 'Type: ')].concat(formatType(comment.type)))
+ );
+ }
+
+ function paramList(params) {
+ if (params.length === 0) return [];
+ return u(
+ 'list',
+ { ordered: false, spread: false },
+ params.map(param =>
+ u(
+ 'listItem',
+ [
+ u(
+ 'paragraph',
+ [
+ u('inlineCode', param.name),
+ u('text', ' '),
+ !!param.type && u('strong', formatType(param.type)),
+ u('text', ' ')
+ ]
+ .concat(param.description ? param.description.children : [])
+ .concat([
+ !!param.default &&
+ u('paragraph', [
+ u('text', ' (optional, default '),
+ u('inlineCode', param.default),
+ u('text', ')')
+ ])
+ ])
+ .filter(Boolean)
+ )
+ ]
+ .concat(param.properties && paramList(param.properties))
+ .filter(Boolean)
+ )
+ )
+ );
+ }
+
+ function paramSection(comment) {
+ return (
+ comment.params.length > 0 && [
+ u('heading', { depth: depth + 1 }, [u('text', 'Parameters')]),
+ paramList(comment.params)
+ ]
+ );
+ }
+
+ function propertySection(comment) {
+ return (
+ comment.properties.length > 0 && [
+ u('heading', { depth: depth + 1 }, [u('text', 'Properties')]),
+ propertyList(comment.properties)
+ ]
+ );
+ }
+
+ function propertyList(properties) {
+ return u(
+ 'list',
+ { ordered: false, spread: false },
+ properties.map(property =>
+ u(
+ 'listItem',
+ [
+ u(
+ 'paragraph',
+ [
+ u('inlineCode', property.name),
+ u('text', ' '),
+ u('strong', formatType(property.type)),
+ u('text', ' ')
+ ]
+ .concat(
+ property.description ? property.description.children : []
+ )
+ .filter(Boolean)
+ ),
+ property.properties && propertyList(property.properties)
+ ].filter(Boolean)
+ )
+ )
+ );
+ }
+
+ function examplesSection(comment) {
+ return (
+ comment.examples.length > 0 &&
+ [u('heading', { depth: depth + 1 }, [u('text', 'Examples')])].concat(
+ comment.examples.reduce(function (memo, example) {
+ const language = hljsOptions.highlightAuto
+ ? hljs.highlightAuto(example.description).language
+ : DEFAULT_LANGUAGE;
+ return memo
+ .concat(
+ example.caption
+ ? [u('paragraph', [u('emphasis', example.caption)])]
+ : []
+ )
+ .concat([u('code', { lang: language }, example.description)]);
+ }, [])
+ )
+ );
+ }
+
+ function returnsSection(comment) {
+ return (
+ comment.returns.length > 0 &&
+ comment.returns.map(returns =>
+ u(
+ 'paragraph',
+ [
+ u('text', 'Returns '),
+ u('strong', formatType(returns.type)),
+ u('text', ' ')
+ ].concat(returns.description ? returns.description.children : [])
+ )
+ )
+ );
+ }
+
+ function throwsSection(comment) {
+ return (
+ comment.throws.length > 0 &&
+ u(
+ 'list',
+ { ordered: false, spread: false },
+ comment.throws.map(returns =>
+ u('listItem', [
+ u(
+ 'paragraph',
+ [
+ u('text', 'Throws '),
+ u('strong', formatType(returns.type)),
+ u('text', ' ')
+ ].concat(
+ returns.description ? returns.description.children : []
+ )
+ )
+ ])
+ )
+ )
+ );
+ }
+
+ function augmentsLink(comment) {
+ return (
+ comment.augments.length > 0 &&
+ u('paragraph', [
+ u('strong', [
+ u('text', 'Extends '),
+ u('text', comment.augments.map(tag => tag.name).join(', '))
+ ])
+ ])
+ );
+ }
+
+ function seeLink({ sees = [] }) {
+ return (
+ sees.length > 0 &&
+ u(
+ 'list',
+ { ordered: false, spread: false },
+ sees.map(see =>
+ u('listItem', [
+ u(
+ 'paragraph',
+ [u('strong', [u('text', 'See')]), u('text', ': ')].concat(
+ see.description
+ )
+ )
+ ])
+ )
+ )
+ );
+ }
+
+ function githubLink(comment) {
+ return (
+ comment.context &&
+ comment.context.github &&
+ u('paragraph', [
+ u(
+ 'link',
+ {
+ title: 'Source code on GitHub',
+ url: comment.context.github.url
+ },
+ [
+ u(
+ 'text',
+ comment.context.github.path +
+ ':' +
+ comment.context.loc.start.line +
+ '-' +
+ comment.context.loc.end.line
+ )
+ ]
+ )
+ ])
+ );
+ }
+
+ function metaSection(comment) {
+ const meta = [
+ 'version',
+ 'since',
+ 'copyright',
+ 'author',
+ 'license',
+ 'deprecated'
+ ].filter(tag => comment[tag]);
+ return (
+ !!meta.length &&
+ [u('strong', [u('text', 'Meta')])].concat(
+ u(
+ 'list',
+ { ordered: false, spread: false },
+ meta.map(tag => {
+ let metaContent;
+ if (tag === 'copyright' || tag === 'deprecated') {
+ metaContent = comment[tag];
+ } else {
+ metaContent = u('text', comment[tag]);
+ }
+ return u('listItem', [
+ u('paragraph', [
+ u('strong', [u('text', tag)]),
+ u('text', ': '),
+ metaContent
+ ])
+ ]);
+ })
+ )
+ )
+ );
+ }
+
+ if (comment.kind === 'note') {
+ return [u('heading', { depth }, [u('text', comment.name || '')])]
+ .concat(comment.description)
+ .concat(
+ !!comment.members.static.length &&
+ comment.members.static.reduce(
+ (memo, child) => memo.concat(generate(depth + 1, child)),
+ []
+ )
+ )
+ .filter(Boolean);
+ }
+
+ return [u('heading', { depth }, [u('text', comment.name || '')])]
+ .concat(githubLink(comment))
+ .concat(augmentsLink(comment))
+ .concat(seeLink(comment))
+ .concat(comment.description ? comment.description.children : [])
+ .concat(typeSection(comment))
+ .concat(paramSection(comment))
+ .concat(propertySection(comment))
+ .concat(examplesSection(comment))
+ .concat(throwsSection(comment))
+ .concat(returnsSection(comment))
+ .concat(metaSection(comment))
+ .concat(
+ !!comment.members.global.length &&
+ comment.members.global.reduce(
+ (memo, child) => memo.concat(generate(depth + 1, child)),
+ []
+ )
+ )
+ .concat(
+ !!comment.members.instance.length &&
+ comment.members.instance.reduce(
+ (memo, child) => memo.concat(generate(depth + 1, child)),
+ []
+ )
+ )
+ .concat(
+ !!comment.members.static.length &&
+ comment.members.static.reduce(
+ (memo, child) => memo.concat(generate(depth + 1, child)),
+ []
+ )
+ )
+ .concat(
+ !!comment.members.inner.length &&
+ comment.members.inner.reduce(
+ (memo, child) => memo.concat(generate(depth + 1, child)),
+ []
+ )
+ )
+ .concat(
+ !!comment.members.events.length &&
+ comment.members.events.reduce(
+ (memo, child) => memo.concat(generate(depth + 1, child)),
+ []
+ )
+ )
+ .filter(Boolean);
+ }
+
+ let root = rerouteLinks(
+ linkerStack.link,
+ u(
+ 'root',
+ generatorComment
+ .concat(config.markdownToc ? tableOfContentsHeading : [])
+ .concat(
+ comments.reduce(
+ (memo, comment) => memo.concat(generate(2, comment)),
+ []
+ )
+ )
+ )
+ );
+
+ const pluginRemark = remark();
+ if (config.markdownToc)
+ pluginRemark.use(toc, {
+ tight: true,
+ maxDepth: config.markdownTocMaxDepth
+ });
+ if (config.noReferenceLinks !== true) pluginRemark.use(links);
+ root = pluginRemark.run(root);
+
+ return Promise.resolve(root);
+}
diff --git a/lib/output/util/format_type.js b/src/output/util/format_type.js
similarity index 50%
rename from lib/output/util/format_type.js
rename to src/output/util/format_type.js
index ff7b47302..d66e03678 100644
--- a/lib/output/util/format_type.js
+++ b/src/output/util/format_type.js
@@ -1,5 +1,6 @@
-var Syntax = require('doctrine').Syntax,
- u = require('unist-builder');
+import doctrine from 'doctrine-temporary-fork';
+const Syntax = doctrine.Syntax;
+import { u } from 'unist-builder';
/**
* Shortcut to create a new text node
@@ -25,15 +26,19 @@ function t(text) {
* link('string').url // => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String'
*/
function link(text, getHref, description) {
- var href = getHref(text);
+ const href = getHref(text);
if (href) {
// TODO: this is a temporary fix until we drop remark 3.x support,
// and then we should remove the 'href' property and only
// have the url property of links
- return u('link', {
- href: href,
- url: href
- }, [t(description || text)]);
+ return u(
+ 'link',
+ {
+ href,
+ url: href
+ },
+ [t(description || text)]
+ );
}
return t(text);
}
@@ -52,11 +57,11 @@ function link(text, getHref, description) {
* @returns {Array} formatted remark AST
*/
function commaList(getHref, items, start, end, sep) {
- var res = [];
+ let res = [];
if (start) {
res.push(t(start));
}
- for (var i = 0, iz = items.length; i < iz; ++i) {
+ for (let i = 0, iz = items.length; i < iz; ++i) {
res = res.concat(formatType(getHref, items[i]));
if (i + 1 !== iz) {
res.push(t(sep || ', '));
@@ -95,92 +100,97 @@ function decorate(formatted, str, prefix) {
* formatType({ type: 'NameExpression', name: 'String' })[0].url
* // => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String'
*/
-function formatType(getHref, node) {
- var result = [];
+export default function formatType(getHref, node) {
+ let result = [];
if (!node) {
return [t('any')];
}
switch (node.type) {
- case Syntax.NullableLiteral:
- return [t('?')];
- case Syntax.AllLiteral:
- return [t('any')];
- case Syntax.NullLiteral:
- return [t('null')];
- case Syntax.VoidLiteral:
- return [t('void')];
- case Syntax.UndefinedLiteral:
- return [link('undefined', getHref)];
- case Syntax.NameExpression:
- return [link(node.name, getHref)];
- case Syntax.ParameterType:
- return [t(node.name + ': ')].concat(formatType(getHref, node.expression));
-
- case Syntax.TypeApplication:
- return formatType(getHref, node.expression)
- .concat(commaList(getHref, node.applications, '<', '>'));
- case Syntax.UnionType:
- return commaList(getHref, node.elements, '(', ')', ' | ');
- case Syntax.ArrayType:
- return commaList(getHref, node.elements, '[', ']');
- case Syntax.RecordType:
- return commaList(getHref, node.fields, '{', '}');
-
- case Syntax.FieldType:
- if (node.value) {
- return [t(node.key + ': ')].concat(formatType(getHref, node.value));
- }
- return [t(node.key)];
+ case Syntax.NullableLiteral:
+ return [t('?')];
+ case Syntax.AllLiteral:
+ return [t('any')];
+ case Syntax.NullLiteral:
+ return [t('null')];
+ case Syntax.VoidLiteral:
+ return [t('void')];
+ case Syntax.UndefinedLiteral:
+ return [link('undefined', getHref)];
+ case Syntax.NameExpression:
+ return [link(node.name, getHref)];
+ case Syntax.ParameterType:
+ if (node.name) {
+ result.push(t(node.name + ': '));
+ }
+ return result.concat(formatType(getHref, node.expression));
+
+ case Syntax.TypeApplication:
+ return formatType(getHref, node.expression).concat(
+ commaList(getHref, node.applications, '<', '>')
+ );
+ case Syntax.UnionType:
+ return commaList(getHref, node.elements, '(', ')', ' | ');
+ case Syntax.ArrayType:
+ return commaList(getHref, node.elements, '[', ']');
+ case Syntax.RecordType:
+ return commaList(getHref, node.fields, '{', '}');
+
+ case Syntax.FieldType:
+ if (node.value) {
+ return [t(node.key + ': ')].concat(formatType(getHref, node.value));
+ }
+ return [t(node.key)];
- case Syntax.FunctionType:
- result = [t('function (')];
+ case Syntax.FunctionType:
+ result = [t('function (')];
- if (node['this']) {
- if (node['new']) {
- result.push(t('new: '));
- } else {
- result.push(t('this: '));
- }
+ if (node['this']) {
+ if (node['new']) {
+ result.push(t('new: '));
+ } else {
+ result.push(t('this: '));
+ }
- result = result.concat(formatType(getHref, node['this']));
+ result = result.concat(formatType(getHref, node['this']));
- if (node.params.length !== 0) {
- result.push(t(', '));
+ if (node.params.length !== 0) {
+ result.push(t(', '));
+ }
}
- }
- result = result.concat(commaList(getHref, node.params, '', ')'));
+ result = result.concat(commaList(getHref, node.params, '', ')'));
- if (node.result) {
- result = result.concat([t(': ')].concat(formatType(getHref, node.result)));
- }
- return result;
-
- case Syntax.RestType:
- // note that here we diverge from doctrine itself, which
- // lets the expression be omitted.
- return decorate(formatType(getHref, node.expression), '...', true);
- case Syntax.OptionalType:
- if (node.default) {
- return decorate(formatType(getHref, node.expression), '?')
- .concat(t('= ' + node.default));
- }
- return decorate(formatType(getHref, node.expression), '?');
- case Syntax.NonNullableType:
- return decorate(formatType(getHref, node.expression), '!', node.prefix);
- case Syntax.NullableType:
- return decorate(formatType(getHref, node.expression), '?');
- case Syntax.StringLiteralType:
- return [u('inlineCode', JSON.stringify(node.value))];
- case Syntax.NumericLiteralType:
- case Syntax.BooleanLiteralType:
- return [u('inlineCode', String(node.value))];
-
- default:
- throw new Error('Unknown type ' + node.type);
+ if (node.result) {
+ result = result.concat(
+ [t(': ')].concat(formatType(getHref, node.result))
+ );
+ }
+ return result;
+
+ case Syntax.RestType:
+ // note that here we diverge from doctrine itself, which
+ // lets the expression be omitted.
+ return decorate(formatType(getHref, node.expression), '...', true);
+ case Syntax.OptionalType:
+ if (node.default) {
+ return decorate(formatType(getHref, node.expression), '?').concat(
+ t('= ' + node.default)
+ );
+ }
+ return decorate(formatType(getHref, node.expression), '?');
+ case Syntax.NonNullableType:
+ return decorate(formatType(getHref, node.expression), '!', node.prefix);
+ case Syntax.NullableType:
+ return decorate(formatType(getHref, node.expression), '?');
+ case Syntax.StringLiteralType:
+ return [u('inlineCode', JSON.stringify(node.value))];
+ case Syntax.NumericLiteralType:
+ case Syntax.BooleanLiteralType:
+ return [u('inlineCode', String(node.value))];
+
+ default:
+ throw new Error('Unknown type ' + node.type);
}
}
-
-module.exports = formatType;
diff --git a/lib/output/util/formatters.js b/src/output/util/formatters.js
similarity index 68%
rename from lib/output/util/formatters.js
rename to src/output/util/formatters.js
index d2cb1b036..15ab86e6f 100644
--- a/lib/output/util/formatters.js
+++ b/src/output/util/formatters.js
@@ -1,22 +1,23 @@
-var remark = require('remark'),
- html = require('remark-html'),
- Syntax = require('doctrine').Syntax,
- u = require('unist-builder'),
- _rerouteLinks = require('./reroute_links'),
- highlighter = require('../highlighter'),
- formatType = require('./format_type');
+import { remark } from 'remark';
+import html from 'remark-html';
+import doctrine from 'doctrine-temporary-fork';
+const Syntax = doctrine.Syntax;
+import { u } from 'unist-builder';
+import _rerouteLinks from './reroute_links.js';
+import highlighter from '../highlighter.js';
+import formatType from './format_type.js';
/**
* Create a formatter group, given a linker method that resolves
* namespaces to URLs
*
- * @param {Function} getHref linker method
+ * @param getHref linker method
* @returns {formatters} formatter object
*/
-module.exports = function (getHref) {
- var rerouteLinks = _rerouteLinks.bind(undefined, getHref);
+export default function (getHref) {
+ const rerouteLinks = _rerouteLinks.bind(undefined, getHref);
- var formatters = {};
+ const formatters = {};
/**
* Format a parameter name. This is used in formatParameters
@@ -51,6 +52,7 @@ module.exports = function (getHref) {
.use(html)
.stringify(highlighter(rerouteLinks(ast)));
}
+ return '';
};
/**
@@ -60,25 +62,34 @@ module.exports = function (getHref) {
* @returns {string} HTML
*/
formatters.type = function (type) {
- return formatters.markdown(u('root', formatType(getHref, type))).replace(/\n/g, '');
+ return formatters
+ .markdown(u('root', formatType(getHref, type)))
+ .replace(/\n/g, '');
};
/**
* Link text to this page or to a central resource.
* @param {string} text inner text of the link
- * @param {string} description link text override
* @returns {string} potentially linked HTML
*/
formatters.autolink = function (text) {
- var href = getHref(text);
+ const href = getHref(text);
if (href) {
// TODO: this is a temporary fix until we drop remark 3.x support,
// and then we should remove the 'href' property and only
// have the url property of links
- return formatters.markdown(u('link', {
- href: href,
- url: href
- }, [u('text', text)])).replace(/\n/g, '');
+ return formatters
+ .markdown(
+ u(
+ 'link',
+ {
+ href,
+ url: href
+ },
+ [u('text', text)]
+ )
+ )
+ .replace(/\n/g, '');
}
return formatters.markdown(u('text', text)).replace(/\n/g, '');
};
@@ -94,12 +105,18 @@ module.exports = function (getHref) {
*/
formatters.parameters = function (section, short) {
if (section.params) {
- return '(' + section.params.map(function (param) {
- return formatters.parameter(param, short);
- }).join(', ') + ')';
+ return (
+ '(' +
+ section.params
+ .map(function (param) {
+ return formatters.parameter(param, short);
+ })
+ .join(', ') +
+ ')'
+ );
}
return '()';
};
return formatters;
-};
+}
diff --git a/src/output/util/linker_stack.js b/src/output/util/linker_stack.js
new file mode 100644
index 000000000..10c731838
--- /dev/null
+++ b/src/output/util/linker_stack.js
@@ -0,0 +1,108 @@
+import globalsDocs from 'globals-docs';
+import walk from '../../walk.js';
+
+/**
+ * Generate a linker method that links given hardcoded namepaths to URLs
+ *
+ * @param {Object} paths an object specified in documentation.yml of hard paths
+ * @returns {Function} linker
+ */
+function pathsLinker(paths /* Object */) {
+ return function (namespace) {
+ if (paths[namespace]) {
+ return paths[namespace];
+ }
+ };
+}
+
+/**
+ * Given an array of functions, call each of them with `input`
+ * and return the output of the first one that returns a truthy value.
+ *
+ * @param {Array} fns array of methods
+ * @param {*} input any input
+ * @returns {*} any output
+ */
+function firstPass(fns, input) {
+ for (let i = 0; i < fns.length; i++) {
+ const output = fns[i](input);
+ if (output) {
+ return output;
+ }
+ }
+}
+
+/**
+ * Create a linking method that takes a namepath and returns a URI
+ * or a falsy value
+ *
+ * @param {Object} config - configuration value
+ * @returns {Function} linker method
+ */
+export default class LinkerStack {
+ constructor(config) {
+ this.stack = [];
+
+ if (config.defaultGlobals !== false) {
+ this.stack.unshift(namespace => {
+ if (namespace) {
+ return globalsDocs.getDoc(namespace, config.defaultGlobalsEnvs);
+ }
+ });
+ }
+
+ if (config.paths) {
+ this.stack.unshift(pathsLinker(config.paths));
+ }
+
+ this.link = this._link.bind(this);
+ }
+
+ /**
+ * Given that the linker stack is a stack of functions, each of which might
+ * be able to resolve the URL target of a given namespace, namespaceResolver
+ * adds a function to the stack. You give it a list of comments and it
+ * adds a function that, if it matches a namespace to a comment, runs
+ * `resolver` on that comment's namespace in order to get a URL. This makes
+ * it possible for themes to put each function on a separate page, or at
+ * different anchors on the same page, and the resolver does stuff like
+ * adding '#' in front of the namespace or turning the namespace into a URL
+ * path.
+ *
+ * @param {Array} comments a list of comments
+ * @param {Function} resolver a method that turns a namespace into a URL
+ * @returns {LinkerStack} returns this
+ * @private
+ * @example
+ * var linkerStack = new LinkerStack(options)
+ * .namespaceResolver(comments, function (namespace) {
+ * var slugger = new GithubSlugger();
+ * return '#' + slugger.slug(namespace);
+ * });
+ */
+ namespaceResolver(comments, resolver) {
+ const namespaces = {};
+ walk(comments, comment => {
+ namespaces[comment.namespace] = true;
+ });
+ this.stack.unshift(namespace => {
+ if (namespaces[namespace] === true) {
+ return resolver(namespace);
+ }
+ });
+ return this;
+ }
+
+ /**
+ * Now that you've configured the LinkerStack with `namespaceResolver`
+ * and a configuration, run it against a namepath. Might return a URL if
+ * it can resolve a target, otherwise returns undefined.
+ *
+ * @param {string} namepath the namepath of a comment
+ * @returns {string?} URL target or maybe undefined
+ * @private
+ */
+ _link(namepath) {
+ return firstPass(this.stack, namepath);
+ }
+}
diff --git a/src/output/util/reroute_links.js b/src/output/util/reroute_links.js
new file mode 100644
index 000000000..cedb07b5b
--- /dev/null
+++ b/src/output/util/reroute_links.js
@@ -0,0 +1,21 @@
+import { visit } from 'unist-util-visit';
+
+/**
+ * Reroute inline jsdoc links in documentation
+ * @param getHref a method that resolves namespaces
+ * @param ast remark AST
+ * @returns {Object} that ast with rerouted links
+ * @private
+ */
+export default function rerouteLinks(getHref, ast) {
+ visit(ast, 'link', function (node) {
+ if (
+ node.jsdoc &&
+ !node.url.match(/^(http|https|\.)/) &&
+ getHref(node.url)
+ ) {
+ node.url = getHref(node.url);
+ }
+ });
+ return ast;
+}
diff --git a/lib/parse.js b/src/parse.js
similarity index 70%
rename from lib/parse.js
rename to src/parse.js
index f74306630..a10c7b2b8 100644
--- a/lib/parse.js
+++ b/src/parse.js
@@ -1,7 +1,5 @@
-'use strict';
-
-var doctrine = require('doctrine');
-var parseMarkdown = require('./parse_markdown');
+import doctrine from 'doctrine-temporary-fork';
+import parseMarkdown from './remark-parse.js';
/**
* Flatteners: these methods simplify the structure of JSDoc comments
@@ -9,8 +7,8 @@ var parseMarkdown = require('./parse_markdown');
* information where appropriate.
* @private
*/
-var flatteners = {
- 'abstract': flattenBoolean,
+const flatteners = {
+ abstract: flattenBoolean,
/**
* Parse tag
* @private
@@ -18,12 +16,14 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'access': function (result, tag) {
+ access(result, tag) {
+ // doctrine ensures that tag.access is valid
result.access = tag.access;
},
- 'alias': flattenName,
- 'arg': synonym('param'),
- 'argument': synonym('param'),
+ alias: flattenName,
+ arg: synonym('param'),
+ argument: synonym('param'),
+ async: flattenBoolean,
/**
* Parse tag
* @private
@@ -31,10 +31,7 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'augments': function (result, tag) {
- if (!result.augments) {
- result.augments = [];
- }
+ augments(result, tag) {
// Google variation of augments/extends tag:
// uses type with brackets instead of name.
// https://github.com/google/closure-library/issues/746
@@ -42,13 +39,13 @@ var flatteners = {
tag.name = tag.type.name;
}
if (!tag.name) {
- console.error('@extends from complex types is not supported yet'); // eslint-disable-line no-console
+ console.error('@extends from complex types is not supported yet'); // eslint-disable-line no-console
return;
}
result.augments.push(tag);
},
- 'author': flattenDescription,
- 'borrows': todo,
+ author: flattenDescription,
+ borrows: todo,
/**
* Parse tag
* @private
@@ -56,7 +53,7 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'callback': function (result, tag) {
+ callback(result, tag) {
result.kind = 'typedef';
if (tag.description) {
@@ -68,20 +65,27 @@ var flatteners = {
name: 'Function'
};
},
- 'class': flattenKindShorthand,
- 'classdesc': flattenMarkdownDescription,
- 'const': synonym('constant'),
- 'constant': flattenKindShorthand,
- 'constructor': synonym('class'),
- 'constructs': todo,
- 'copyright': flattenMarkdownDescription,
- 'default': todo,
- 'defaultvalue': synonym('default'),
- 'deprecated': flattenMarkdownDescription,
- 'desc': synonym('description'),
- 'description': flattenMarkdownDescription,
- 'emits': synonym('fires'),
- 'enum': todo,
+ class: flattenKindShorthand,
+ classdesc: flattenMarkdownDescription,
+ const: synonym('constant'),
+ constant: flattenKindShorthand,
+ constructor: synonym('class'),
+ constructs: todo,
+ copyright: flattenMarkdownDescription,
+ default: todo,
+ defaultvalue: synonym('default'),
+ deprecated(result, tag) {
+ const description = tag.description || 'This is deprecated.';
+ result.deprecated = parseMarkdown(description);
+ },
+ flattenMarkdownDescription,
+ desc: synonym('description'),
+ description: flattenMarkdownDescription,
+ emits: synonym('fires'),
+ enum(result, tag) {
+ result.kind = 'enum';
+ result.type = tag.type;
+ },
/**
* Parse tag
* @private
@@ -89,7 +93,7 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'event': function (result, tag) {
+ event(result, tag) {
result.kind = 'event';
if (tag.description) {
@@ -103,7 +107,7 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'example': function (result, tag) {
+ example(result, tag) {
if (!tag.description) {
result.errors.push({
message: '@example without code',
@@ -112,11 +116,7 @@ var flatteners = {
return;
}
- if (!result.examples) {
- result.examples = [];
- }
-
- var example = {
+ const example = {
description: tag.description
};
@@ -126,9 +126,9 @@ var flatteners = {
result.examples.push(example);
},
- 'exception': synonym('throws'),
- 'exports': todo,
- 'extends': synonym('augments'),
+ exception: synonym('throws'),
+ exports: todo,
+ extends: synonym('augments'),
/**
* Parse tag
* @private
@@ -136,7 +136,7 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'external': function (result, tag) {
+ external(result, tag) {
result.kind = 'external';
if (tag.description) {
@@ -150,37 +150,46 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'file': function (result, tag) {
+ file(result, tag) {
result.kind = 'file';
if (tag.description) {
result.description = parseMarkdown(tag.description);
}
},
- 'fileoverview': synonym('file'),
- 'fires': todo,
- 'func': synonym('function'),
- 'function': flattenKindShorthand,
+ fileoverview: synonym('file'),
+ fires: todo,
+ func: synonym('function'),
+ function: flattenKindShorthand,
+ generator: flattenBoolean,
/**
* Parse tag
* @private
* @param {Object} result target comment
* @returns {undefined} has side-effects
*/
- 'global': function (result) {
+ global(result) {
result.scope = 'global';
},
- 'host': synonym('external'),
- 'ignore': flattenBoolean,
- 'implements': todo,
- 'inheritdoc': todo,
+ hideconstructor: flattenBoolean,
+ host: synonym('external'),
+ ignore: flattenBoolean,
+ implements(result, tag) {
+ // Match @extends/@augments above.
+ if (!tag.name && tag.type && tag.type.name) {
+ tag.name = tag.type.name;
+ }
+
+ result.implements.push(tag);
+ },
+ inheritdoc: todo,
/**
* Parse tag
* @private
* @param {Object} result target comment
* @returns {undefined} has side-effects
*/
- 'inner': function (result) {
+ inner(result) {
result.scope = 'inner';
},
/**
@@ -189,7 +198,7 @@ var flatteners = {
* @param {Object} result target comment
* @returns {undefined} has side-effects
*/
- 'instance': function (result) {
+ instance(result) {
result.scope = 'instance';
},
/**
@@ -199,8 +208,8 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'interface': function (result, tag) {
- result.interface = true;
+ interface(result, tag) {
+ result.kind = 'interface';
if (tag.description) {
result.name = tag.description;
}
@@ -212,22 +221,23 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'kind': function (result, tag) {
+ kind(result, tag) {
+ // doctrine ensures that tag.kind is valid
result.kind = tag.kind;
},
- 'lends': flattenDescription,
- 'license': flattenDescription,
- 'listens': todo,
- 'member': flattenKindShorthand,
- 'memberof': flattenDescription,
- 'method': synonym('function'),
- 'mixes': todo,
- 'mixin': flattenKindShorthand,
- 'module': flattenKindShorthand,
- 'name': flattenName,
- 'namespace': flattenKindShorthand,
- 'override': flattenBoolean,
- 'overview': synonym('file'),
+ lends: flattenDescription,
+ license: flattenDescription,
+ listens: todo,
+ member: flattenKindShorthand,
+ memberof: flattenDescription,
+ method: synonym('function'),
+ mixes: todo,
+ mixin: flattenKindShorthand,
+ module: flattenKindShorthand,
+ name: flattenName,
+ namespace: flattenKindShorthand,
+ override: flattenBoolean,
+ overview: synonym('file'),
/**
* Parse tag
* @private
@@ -235,12 +245,9 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'param': function (result, tag) {
- if (!result.params) {
- result.params = [];
- }
-
- var param = {
+ param(result, tag) {
+ const param = {
+ title: 'param',
name: tag.name,
lineNumber: tag.lineNumber // TODO: remove
};
@@ -255,6 +262,9 @@ var flatteners = {
if (tag.default) {
param.default = tag.default;
+ if (param.type && param.type.type === 'OptionalType') {
+ param.type = param.type.expression;
+ }
}
result.params.push(param);
@@ -265,10 +275,10 @@ var flatteners = {
* @param {Object} result target comment
* @returns {undefined} has side-effects
*/
- 'private': function (result) {
+ private(result) {
result.access = 'private';
},
- 'prop': synonym('property'),
+ prop: synonym('property'),
/**
* Parse tag
* @private
@@ -276,12 +286,9 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'property': function (result, tag) {
- if (!result.properties) {
- result.properties = [];
- }
-
- var property = {
+ property(result, tag) {
+ const property = {
+ title: 'property',
name: tag.name,
lineNumber: tag.lineNumber // TODO: remove
};
@@ -302,7 +309,7 @@ var flatteners = {
* @param {Object} result target comment
* @returns {undefined} has side-effects
*/
- 'protected': function (result) {
+ protected(result) {
result.access = 'protected';
},
/**
@@ -311,12 +318,12 @@ var flatteners = {
* @param {Object} result target comment
* @returns {undefined} has side-effects
*/
- 'public': function (result) {
+ public(result) {
result.access = 'public';
},
- 'readonly': flattenBoolean,
- 'requires': todo,
- 'return': synonym('returns'),
+ readonly: flattenBoolean,
+ requires: todo,
+ return: synonym('returns'),
/**
* Parse tag
* @private
@@ -324,13 +331,10 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'returns': function (result, tag) {
- if (!result.returns) {
- result.returns = [];
- }
-
- var returns = {
- description: parseMarkdown(tag.description)
+ returns(result, tag) {
+ const returns = {
+ description: parseMarkdown(tag.description),
+ title: 'returns'
};
if (tag.type) {
@@ -346,24 +350,30 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'see': function (result, tag) {
- if (!result.sees) {
- result.sees = [];
+ see(result, tag) {
+ const sees = {
+ description: parseMarkdown(tag.description),
+ title: 'sees'
+ };
+
+ if (tag.type) {
+ sees.type = tag.type;
}
- result.sees.push(parseMarkdown(tag.description));
+
+ result.sees.push(sees);
},
- 'since': flattenDescription,
+ since: flattenDescription,
/**
* Parse tag
* @private
* @param {Object} result target comment
* @returns {undefined} has side-effects
*/
- 'static': function (result) {
+ static(result) {
result.scope = 'static';
},
- 'summary': flattenMarkdownDescription,
- 'this': todo,
+ summary: flattenMarkdownDescription,
+ this: todo,
/**
* Parse tag
* @private
@@ -371,12 +381,8 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'throws': function (result, tag) {
- if (!result.throws) {
- result.throws = [];
- }
-
- var throws = {};
+ throws(result, tag) {
+ const throws = {};
if (tag.description) {
throws.description = parseMarkdown(tag.description);
@@ -395,16 +401,15 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'todo': function (result, tag) {
- if (!result.todos) {
- result.todos = [];
- }
+ todo(result, tag) {
result.todos.push(parseMarkdown(tag.description));
},
- 'tutorial': todo,
- 'type': todo,
- 'typedef': flattenKindShorthand,
- 'var': synonym('member'),
+ tutorial: todo,
+ type(result, tag) {
+ result.type = tag.type;
+ },
+ typedef: flattenKindShorthand,
+ var: synonym('member'),
/**
* Parse tag
* @private
@@ -412,11 +417,31 @@ var flatteners = {
* @param {Object} tag the tag
* @returns {undefined} has side-effects
*/
- 'variation': function (result, tag) {
+ variation(result, tag) {
result.variation = tag.variation;
},
- 'version': flattenDescription,
- 'virtual': synonym('abstract')
+ version: flattenDescription,
+ virtual: synonym('abstract'),
+ yield: synonym('yields'),
+ /**
+ * Parse tag
+ * @private
+ * @param {Object} result target comment
+ * @param {Object} tag the tag
+ * @returns {undefined} has side-effects
+ */
+ yields(result, tag) {
+ const yields = {
+ description: parseMarkdown(tag.description),
+ title: 'yields'
+ };
+
+ if (tag.type) {
+ yields.type = tag.type;
+ }
+
+ result.yields.push(yields);
+ }
};
/**
@@ -433,7 +458,8 @@ function todo() {}
*/
function synonym(key) {
return function (result, tag) {
- return flatteners[key](result, tag, key);
+ const fun = flatteners[key];
+ fun.apply(null, [result, tag, key].slice(0, fun.length));
};
}
@@ -461,7 +487,6 @@ function flattenName(result, tag, key) {
result[key] = tag.name;
}
-
/**
* Flatten a usable-once description tag into a key
* @private
@@ -581,11 +606,11 @@ function flattenKindShorthand(result, tag, key) {
* @param {string} comment input to be parsed
* @param {Object} loc location of the input
* @param {Object} context code context of the input
- * @return {Comment} an object conforming to the
+ * @returns {Comment} an object conforming to the
* [documentation schema](https://github.com/documentationjs/api-json)
*/
-function parseJSDoc(comment, loc, context) {
- var result = doctrine.parse(comment, {
+export default function parseJSDoc(comment, loc, context) {
+ const result = doctrine.parse(comment, {
// have doctrine itself remove the comment asterisks from content
unwrap: true,
// enable parsing of optional parameters in brackets, JSDoc3 style
@@ -598,16 +623,38 @@ function parseJSDoc(comment, loc, context) {
result.loc = loc;
result.context = context;
+
+ result.augments = [];
result.errors = [];
+ result.examples = [];
+ result.implements = [];
+ result.params = [];
+ result.properties = [];
+ result.returns = [];
+ result.sees = [];
+ result.throws = [];
+ result.todos = [];
+ result.yields = [];
if (result.description) {
result.description = parseMarkdown(result.description);
}
+ // Reject parameter tags without a parameter name
+ result.tags.filter(function (tag) {
+ if (tag.title === 'param' && tag.name === undefined) {
+ result.errors.push({
+ message: 'A @param tag without a parameter name was rejected'
+ });
+ return false;
+ }
+ return true;
+ });
+
result.tags.forEach(function (tag) {
if (tag.errors) {
- for (var j = 0; j < tag.errors.length; j++) {
- result.errors.push({message: tag.errors[j]});
+ for (let j = 0; j < tag.errors.length; j++) {
+ result.errors.push({ message: tag.errors[j] });
}
} else if (flatteners[tag.title]) {
flatteners[tag.title](result, tag, tag.title);
@@ -619,7 +666,11 @@ function parseJSDoc(comment, loc, context) {
}
});
+ // Using the @name tag, or any other tag that sets the name of a comment,
+ // disconnects the comment from its surrounding code.
+ if (context && result.name) {
+ delete context.ast;
+ }
+
return result;
}
-
-module.exports = parseJSDoc;
diff --git a/lib/parsers/README.md b/src/parsers/README.md
similarity index 100%
rename from lib/parsers/README.md
rename to src/parsers/README.md
diff --git a/src/parsers/javascript.js b/src/parsers/javascript.js
new file mode 100644
index 000000000..880af6547
--- /dev/null
+++ b/src/parsers/javascript.js
@@ -0,0 +1,117 @@
+import _ from 'lodash';
+import t from '@babel/types';
+import parse from '../parse.js';
+import walkComments from '../extractors/comments.js';
+import walkExported from '../extractors/exported.js';
+import util from 'util';
+import findTarget from '../infer/finders.js';
+import { parseToAst } from './parse_to_ast.js';
+
+const debuglog = util.debuglog('documentation');
+
+/**
+ * Receives a module-dep item,
+ * reads the file, parses the JavaScript, and parses the JSDoc.
+ *
+ * @param {Object} data a chunk of data provided by module-deps
+ * @param {Object} config config
+ * @returns {Array} an array of parsed comments
+ */
+export default function parseJavaScript(data, config) {
+ const visited = new Set();
+ const commentsByNode = new Map();
+
+ const ast = parseToAst(data.source, data.file);
+ const addComment = _addComment.bind(null, visited, commentsByNode);
+
+ const extensions = []
+ .concat(config.parseExtension, config.requireExtension)
+ .filter(Boolean);
+
+ return _.flatMap(
+ config.documentExported
+ ? [walkExported.bind(null, { extensions })]
+ : [
+ walkComments.bind(null, 'leadingComments', true),
+ walkComments.bind(null, 'innerComments', false),
+ walkComments.bind(null, 'trailingComments', false)
+ ],
+ fn => fn(ast, data, addComment)
+ ).filter(comment => comment && !comment.lends);
+}
+
+function _addComment(
+ visited,
+ commentsByNode,
+ data,
+ commentValue,
+ commentLoc,
+ path,
+ nodeLoc,
+ includeContext
+) {
+ // Avoid visiting the same comment twice as a leading
+ // and trailing node
+ const key =
+ data.file + ':' + commentLoc.start.line + ':' + commentLoc.start.column;
+ if (!visited.has(key)) {
+ visited.add(key);
+
+ const context /* : {
+ loc: Object,
+ file: string,
+ sortKey: string,
+ ast?: Object,
+ code?: string
+ }*/ = {
+ loc: nodeLoc,
+ file: data.file,
+ sortKey:
+ data.sortKey + ' ' + nodeLoc.start.line.toString().padStart(8, '0')
+ };
+
+ if (includeContext) {
+ // This is non-enumerable so that it doesn't get stringified in
+ // output; e.g. by the documentation binary.
+ Object.defineProperty(context, 'ast', {
+ configurable: true,
+ enumerable: false,
+ value: path
+ });
+
+ if (path.parentPath && path.parentPath.node) {
+ const parentNode = path.parentPath.node;
+ context.code = data.source.substring(parentNode.start, parentNode.end);
+ }
+ }
+ const comment = parse(commentValue, commentLoc, context);
+ if (includeContext) {
+ commentsByNode.set((findTarget(path) || path).node, comment);
+
+ if (t.isClassMethod(path) && path.node.kind === 'constructor') {
+ // #689
+ if (
+ comment.tags.some(
+ tag => tag.title !== 'param' && tag.title !== 'hideconstructor'
+ )
+ ) {
+ debuglog(
+ 'A constructor was documented explicitly: document along with the class instead'
+ );
+ }
+
+ const parentComment = commentsByNode.get(
+ path.parentPath.parentPath.node
+ );
+ if (parentComment) {
+ parentComment.constructorComment = comment;
+ return;
+ }
+ if (comment.hideconstructor) {
+ return;
+ }
+ }
+ }
+ return comment;
+ }
+}
diff --git a/src/parsers/parse_to_ast.js b/src/parsers/parse_to_ast.js
new file mode 100644
index 000000000..0eed35d0a
--- /dev/null
+++ b/src/parsers/parse_to_ast.js
@@ -0,0 +1,60 @@
+import babelParser from '@babel/parser';
+import path from 'path';
+
+const TYPESCRIPT_EXTS = {
+ '.ts': ['typescript'],
+ '.tsx': ['typescript', 'jsx']
+};
+
+// this list is roughly the same as the one in prettier
+// https://github.com/prettier/prettier/blob/24d39a906834cf449304dc684b280a5ca9a0a6d7/src/language-js/parser-babel.js#L23
+export const standardBabelParserPlugins = [
+ 'classPrivateMethods',
+ 'classPrivateProperties',
+ 'classProperties',
+ 'classStaticBlock',
+ 'decimal',
+ ['decorators', { decoratorsBeforeExport: false }],
+ 'doExpressions',
+ 'exportDefaultFrom',
+ 'functionBind',
+ 'functionSent',
+ 'importAssertions',
+ 'moduleBlocks',
+ 'moduleStringNames',
+ 'partialApplication',
+ ['pipelineOperator', { proposal: 'minimal' }],
+ 'privateIn',
+ ['recordAndTuple', { syntaxType: 'hash' }],
+ 'throwExpressions',
+ 'v8intrinsic'
+];
+
+function getParserOpts(file) {
+ return {
+ allowImportExportEverywhere: true,
+ sourceType: 'module',
+ plugins: [
+ ...standardBabelParserPlugins,
+ ...(TYPESCRIPT_EXTS[path.extname(file || '')] || ['flow', 'jsx'])
+ ]
+ };
+}
+
+/**
+ * Convert flow comment types into flow annotations so that
+ * they end up in the final AST. If the source does not contain
+ * a flow pragma, the code is returned verbatim.
+ * @param {*} source code with flow type comments
+ * @returns {string} code with flow annotations
+ */
+export function commentToFlow(source) {
+ if (!/@flow/.test(source)) return source;
+ return source
+ .replace(/\/\*::([^]+?)\*\//g, '$1')
+ .replace(/\/\*:\s*([^]+?)\s*\*\//g, ':$1');
+}
+
+export function parseToAst(source, file) {
+ return babelParser.parse(commentToFlow(source), getParserOpts(file));
+}
diff --git a/src/remark-jsDoc-link.js b/src/remark-jsDoc-link.js
new file mode 100644
index 000000000..dfbfd4200
--- /dev/null
+++ b/src/remark-jsDoc-link.js
@@ -0,0 +1,115 @@
+import { findAndReplace } from 'mdast-util-find-and-replace';
+import { markdownLineEnding } from 'micromark-util-character';
+
+const link = '@link';
+const tutorial = '@tutorial';
+
+function tokenizeJsDoclink(effects, ok, nok) {
+ let index = 0;
+ let focus = link;
+
+ function atext(code) {
+ if (index !== link.length) {
+ if (focus.charCodeAt(index) === code) {
+ effects.consume(code);
+ index++;
+ return atext;
+ } else if (tutorial.charCodeAt(index) === code) {
+ focus = tutorial;
+ }
+ return nok(code);
+ }
+ if (code === 125) {
+ effects.consume(code);
+ effects.exit('literalJsDoclink');
+ return ok(code);
+ }
+
+ if (markdownLineEnding(code)) {
+ return nok(code);
+ }
+
+ effects.consume(code);
+ return atext;
+ }
+
+ return function (code) {
+ effects.enter('literalJsDoclink');
+ effects.consume(code);
+ return atext;
+ };
+}
+
+const text = {};
+text[123] = {
+ tokenize: tokenizeJsDoclink,
+ previous(code) {
+ return code === null || code === 32 || markdownLineEnding(code);
+ }
+};
+
+const linkRegExp = /\{@link\s+(.+?)(?:[\s|](.*?))?\}/;
+const tutorialRegExp = /\{@tutorial\s+(.+?)(?:[\s|](.*?))?\}/;
+
+/**
+ * A remark plugin that installs
+ * for JSDoc inline `{@link}` and `{@tutorial}` tags.
+ *
+ * This does not handle the `[text]({@link url})` and `[text]({@tutorial url})` forms of these tags.
+ * That's a JSDoc misfeature; just use regular markdown syntax instead: `[text](url)`.
+ *
+ * @returns {Function}
+ */
+export default function () {
+ const data = this.data();
+ function replace(type) {
+ return (match, matchUrl, matchValue) => {
+ return {
+ type,
+ url: matchUrl,
+ title: null,
+ jsdoc: true,
+ children: [
+ {
+ type: 'text',
+ value: matchValue || matchUrl
+ }
+ ]
+ };
+ };
+ }
+
+ add('micromarkExtensions', { text });
+ add('fromMarkdownExtensions', {
+ transforms: [
+ function (markdownAST) {
+ return findAndReplace(markdownAST, [
+ [new RegExp(linkRegExp.source, 'g'), replace('link')],
+ [new RegExp(tutorialRegExp.source, 'g'), replace('tutorial')]
+ ]);
+ }
+ ],
+ enter: {
+ literalJsDoclink(token) {
+ const str = this.sliceSerialize(token);
+ let match = null;
+ if (str.startsWith('{@link')) {
+ match = linkRegExp.exec(str);
+ } else {
+ match = tutorialRegExp.exec(str);
+ }
+
+ this.enter(replace('link')(...match), token);
+ }
+ },
+ exit: {
+ literalJsDoclink(token) {
+ this.exit(token);
+ }
+ }
+ });
+ function add(field, value) {
+ if (data[field]) data[field].push(value);
+ else data[field] = [value];
+ }
+}
diff --git a/src/remark-parse.js b/src/remark-parse.js
new file mode 100644
index 000000000..79d643947
--- /dev/null
+++ b/src/remark-parse.js
@@ -0,0 +1,14 @@
+import { remark } from 'remark';
+import gfm from 'remark-gfm';
+import removePosition from './remark-remove-position.js';
+import jsDocLink from './remark-jsDoc-link.js';
+
+/**
+ * Parse a string of Markdown into a Remark
+ * abstract syntax tree.
+ *
+ * @param {string} string markdown text
+ * @returns {Object} abstract syntax tree
+ * @private
+ */
+export default remark().use([jsDocLink, gfm, removePosition]).parse;
diff --git a/src/remark-remove-position.js b/src/remark-remove-position.js
new file mode 100644
index 000000000..fca981a64
--- /dev/null
+++ b/src/remark-remove-position.js
@@ -0,0 +1,16 @@
+import { visit } from 'unist-util-visit';
+
+export default function () {
+ const data = this.data();
+ add('fromMarkdownExtensions', {
+ transforms: [
+ function (markdownAST) {
+ visit(markdownAST, node => delete node.position);
+ }
+ ]
+ });
+ function add(field, value) {
+ if (data[field]) data[field].push(value);
+ else data[field] = [value];
+ }
+}
diff --git a/src/sort.js b/src/sort.js
new file mode 100644
index 000000000..db27b02d5
--- /dev/null
+++ b/src/sort.js
@@ -0,0 +1,138 @@
+import parseMarkdown from './remark-parse.js';
+import chalk from 'chalk';
+import path from 'path';
+import fs from 'fs';
+
+/**
+ * Sort two documentation objects, given an optional order object. Returns
+ * a numeric sorting value that is compatible with stream-sort.
+ *
+ * @param {Array} comments all comments
+ * @param {Object} options options from documentation.yml
+ * @returns {number} sorting value
+ * @private
+ */
+export default function (comments, options) {
+ if (!options || !options.toc) {
+ return sortComments(comments, options && options.sortOrder);
+ }
+ let i = 0;
+ const indexes = Object.create(null);
+ const toBeSorted = Object.create(null);
+ const paths = Object.create(null);
+ const fixed = [];
+ const walk = function (tocPath, val) {
+ if (typeof val === 'object' && val.name) {
+ val.kind = 'note';
+ indexes[val.name] = i++;
+ if (typeof val.file === 'string') {
+ let filename = val.file;
+ if (!path.isAbsolute(val.file)) {
+ filename = path.join(process.cwd(), val.file);
+ }
+
+ try {
+ val.description = fs.readFileSync(filename).toString();
+ delete val.file;
+ } catch (err) {
+ process.stderr.write(chalk.red(`Failed to read file ${filename}`));
+ }
+ } else if (!val.description) {
+ val.description = '';
+ }
+ if (typeof val.description === 'string') {
+ val.description = parseMarkdown(val.description);
+ }
+ const childPath = tocPath.concat({ scope: 'static', name: val.name });
+ val.path = childPath;
+ if (val.children) {
+ val.children.forEach(walk.bind(null, childPath));
+ }
+ fixed.push(val);
+ } else {
+ indexes[val] = i++;
+ toBeSorted[val] = false;
+ paths[val] = tocPath.concat({ scope: 'static', name: val, toc: true });
+ }
+ };
+ // Table of contents 'theme' entries: defined as objects
+ // in the YAML list
+ options.toc.forEach(walk.bind(null, []));
+ const unfixed = [];
+ comments.forEach(function (comment) {
+ let commentPath;
+ if (!comment.memberof && (commentPath = paths[comment.name])) {
+ comment.path = commentPath;
+ delete paths[comment.name];
+ }
+
+ // If comment is of kind 'note', this means that we must be _re_ sorting
+ // the list, and the TOC note entries were already added to the list. Bail
+ // out here so that we don't add duplicates.
+ if (comment.kind === 'note') {
+ return;
+ }
+
+ // If comment is top-level and `name` matches a TOC entry, add it to the
+ // to-be-sorted list.
+ if (!comment.memberof && indexes[comment.name] !== undefined) {
+ fixed.push(comment);
+ toBeSorted[comment.name] = true;
+ } else {
+ unfixed.push(comment);
+ }
+ });
+ fixed.sort((a, b) => {
+ if (indexes[a.name] !== undefined && indexes[b.name] !== undefined) {
+ return indexes[a.name] - indexes[b.name];
+ }
+ return 0;
+ });
+ sortComments(unfixed, options.sortOrder);
+ Object.keys(toBeSorted)
+ .filter(key => toBeSorted[key] === false)
+ .forEach(key => {
+ process.stderr.write(
+ chalk.red(
+ 'Table of contents defined sorting of ' +
+ key +
+ ' but no documentation with that namepath was found\n'
+ )
+ );
+ });
+ return fixed.concat(unfixed);
+}
+
+function compareCommentsByField(field, a, b) {
+ const akey = a[field];
+ const bkey = b[field];
+
+ if (akey && bkey) {
+ return akey.localeCompare(bkey, undefined, { caseFirst: 'upper' });
+ }
+ if (akey) return 1;
+ if (bkey) return -1;
+ return 0;
+}
+
+function compareCommentsBySourceLocation(a, b) {
+ return a.context.sortKey.localeCompare(b.context.sortKey);
+}
+
+const sortFns = {
+ alpha: compareCommentsByField.bind(null, 'name'),
+ source: compareCommentsBySourceLocation,
+ kind: compareCommentsByField.bind(null, 'kind'),
+ access: compareCommentsByField.bind(null, 'access'),
+ memberof: compareCommentsByField.bind(null, 'memberof')
+};
+
+function sortComments(comments, sortOrder) {
+ return comments.sort((a, b) => {
+ for (const sortMethod of sortOrder || ['source']) {
+ const r = sortFns[sortMethod](a, b);
+ if (r !== 0) return r;
+ }
+ return 0;
+ });
+}
diff --git a/src/ts_doctrine.js b/src/ts_doctrine.js
new file mode 100644
index 000000000..d31a0a50b
--- /dev/null
+++ b/src/ts_doctrine.js
@@ -0,0 +1,180 @@
+import generator from '@babel/generator';
+const generate = generator.default || generator;
+
+const namedTypes = {
+ TSBigIntKeyword: 'bigint',
+ TSNumberKeyword: 'number',
+ TSBooleanKeyword: 'boolean',
+ TSStringKeyword: 'string',
+ TSSymbolKeyword: 'symbol',
+ TSThisType: 'this',
+ TSObjectKeyword: 'object',
+ TSNeverKeyword: 'never'
+};
+
+const oneToOne = {
+ TSAnyKeyword: 'AllLiteral',
+ TSUnknownKeyword: 'AllLiteral',
+ TSNullKeyword: 'NullLiteral',
+ TSUndefinedKeyword: 'UndefinedLiteral',
+ TSVoidKeyword: 'VoidLiteral'
+};
+
+function propertyToField(property) {
+ if (!property.typeAnnotation) return null;
+
+ let type = tsDoctrine(property.typeAnnotation.typeAnnotation);
+ if (property.optional) {
+ // Doctrine does not support optional fields but it does have something called optional types
+ // (which makes no sense, but let's play along).
+ type = {
+ type: 'OptionalType',
+ expression: type
+ };
+ }
+ return {
+ type: 'FieldType',
+ key: property.key ? property.key.name || property.key.value : '',
+ value: type
+ };
+}
+
+/**
+ * Babel parses TypeScript annotations in JavaScript into AST nodes. documentation.js uses
+ * Babel to parse TypeScript. This method restructures those Babel-generated
+ * objects into objects that fit the output of Doctrine, the module we use
+ * to parse JSDoc annotations. This lets us use TypeScript annotations _as_
+ * JSDoc annotations.
+ *
+ * @private
+ * @param {Object} type babel-parsed typescript type
+ * @returns {Object} doctrine compatible type
+ */
+function tsDoctrine(type) {
+ if (type.type in namedTypes) {
+ const doctrineType = {
+ type: 'NameExpression',
+ name: namedTypes[type.type]
+ };
+ return doctrineType;
+ }
+
+ // TODO: unhandled types
+ // TSIntersectionType, TSConditionalType, TSInferType, TSTypeOperator, TSIndexedAccessType
+ // TSMappedType, TSImportType, TSTypePredicate, TSTypeQuery, TSExpressionWithTypeArguments
+
+ if (type.type in oneToOne) {
+ return { type: oneToOne[type.type] };
+ }
+
+ switch (type.type) {
+ case 'TSOptionalType':
+ return {
+ type: 'NullableType',
+ expression: tsDoctrine(type.typeAnnotation)
+ };
+ case 'TSParenthesizedType':
+ return tsDoctrine(type.typeAnnotation);
+ case 'TSUnionType':
+ return {
+ type: 'UnionType',
+ elements: type.types.map(tsDoctrine)
+ };
+ // [number]
+ // [string, boolean, number]
+ case 'TSTupleType':
+ return {
+ type: 'ArrayType',
+ elements: type.elementTypes.map(tsDoctrine)
+ };
+ // number[]
+ case 'TSArrayType':
+ return {
+ type: 'TypeApplication',
+ expression: {
+ type: 'NameExpression',
+ name: 'Array'
+ },
+ applications: [tsDoctrine(type.elementType)]
+ };
+ // ...string
+ case 'TSRestType':
+ return {
+ type: 'RestType',
+ expression: tsDoctrine(type.typeAnnotation)
+ };
+ // (y: number) => bool
+ case 'TSFunctionType':
+ case 'TSConstructorType':
+ case 'TSMethodSignature':
+ return {
+ type: 'FunctionType',
+ params: type.parameters.map(param => {
+ if (param.type === 'RestElement') {
+ return {
+ type: 'RestType',
+ expression: {
+ type: 'ParameterType',
+ name: param.argument.name,
+ expression: tsDoctrine(param.typeAnnotation.typeAnnotation)
+ }
+ };
+ }
+
+ return {
+ type: 'ParameterType',
+ name: param.name,
+ expression: tsDoctrine(param.typeAnnotation.typeAnnotation)
+ };
+ }),
+ result: tsDoctrine(type.typeAnnotation.typeAnnotation)
+ };
+
+ case 'TSTypeReference':
+ if (type.typeParameters) {
+ return {
+ type: 'TypeApplication',
+ expression: {
+ type: 'NameExpression',
+ name: generate(type.typeName, {
+ compact: true
+ }).code
+ },
+ applications: type.typeParameters.params.map(tsDoctrine)
+ };
+ }
+
+ return {
+ type: 'NameExpression',
+ name: generate(type.typeName, {
+ compact: true
+ }).code
+ };
+
+ case 'TSTypeLiteral':
+ if (type.members) {
+ return {
+ type: 'RecordType',
+ fields: type.members.map(propertyToField).filter(x => x)
+ };
+ }
+
+ return {
+ type: 'NameExpression',
+ name: generate(type.id, {
+ compact: true
+ }).code
+ };
+ case 'TSLiteralType':
+ return {
+ type: `${type.literal.type}Type`,
+ value: type.literal.value
+ };
+ default:
+ return {
+ type: 'AllLiteral'
+ };
+ }
+}
+
+export default tsDoctrine;
diff --git a/src/type_annotation.js b/src/type_annotation.js
new file mode 100644
index 000000000..b1e327ced
--- /dev/null
+++ b/src/type_annotation.js
@@ -0,0 +1,21 @@
+import t from '@babel/types';
+import flowDoctrine from './flow_doctrine.js';
+import tsDoctrine from './ts_doctrine.js';
+
+function typeAnnotation(type) {
+ if (t.isFlow(type)) {
+ if (t.isTypeAnnotation(type)) {
+ type = type.typeAnnotation;
+ }
+
+ return flowDoctrine(type);
+ }
+
+ if (t.isTSTypeAnnotation(type)) {
+ type = type.typeAnnotation;
+ }
+
+ return tsDoctrine(type);
+}
+
+export default typeAnnotation;
diff --git a/lib/walk.js b/src/walk.js
similarity index 75%
rename from lib/walk.js
rename to src/walk.js
index dc9069b59..255d83160 100644
--- a/lib/walk.js
+++ b/src/walk.js
@@ -7,14 +7,12 @@
* @param {Object} [options] options passed through to walker function
* @returns {Array} comments
*/
-function walk(comments, fn, options) {
- comments.forEach(function (comment) {
+export default function walk(comments, fn, options) {
+ comments.forEach(comment => {
fn(comment, options);
- for (var scope in comment.members) {
+ for (const scope in comment.members) {
walk(comment.members[scope], fn, options);
}
});
return comments;
}
-
-module.exports = walk;
diff --git a/test/bin-readme.js b/test/bin-readme.js
deleted file mode 100644
index 2337ac8c7..000000000
--- a/test/bin-readme.js
+++ /dev/null
@@ -1,114 +0,0 @@
-var test = require('tap').test,
- path = require('path'),
- os = require('os'),
- exec = require('child_process').exec,
- tmp = require('tmp'),
- fs = require('fs-extra');
-
-function documentation(args, options, callback, parseJSON) {
- if (!callback) {
- callback = options;
- options = {};
- }
-
- if (!options.cwd) {
- options.cwd = __dirname;
- }
-
- options.maxBuffer = 1024 * 1024;
-
- args.unshift(path.join(__dirname, '../bin/documentation.js'));
-
- exec(args.join(' '), options, callback);
-}
-
-var UPDATE = !!process.env.UPDATE;
-
-test('readme command', function (group) {
- var fixtures = path.join(__dirname, 'fixture/readme');
- var sourceFile = path.join(fixtures, 'index.js');
-
- tmp.dir({unsafeCleanup: true}, function (err, d) {
- group.error(err);
- fs.copySync(path.join(fixtures, 'README.input.md'), path.join(d, 'README.md'));
- fs.copySync(path.join(fixtures, 'index.js'), path.join(d, 'index.js'));
-
- // run tests after setting up temp dir
-
- group.test('--diff-only: changes needed', function (t) {
- t.error(err);
- var before = fs.readFileSync(path.join(d, 'README.md'), 'utf-8');
- documentation(['readme index.js --diff-only -s API'], {cwd: d}, function (err, stdout, stderr) {
- var after = fs.readFileSync(path.join(d, 'README.md'), 'utf-8');
- t.ok(err);
- t.notEqual(err.code, 0, 'exit nonzero');
- t.same(after, before, 'readme unchanged');
- t.end();
- });
- });
-
- var expectedFile = path.join(fixtures, 'README.output.md');
- var expectedPath = path.join(fixtures, 'README.output.md');
- var expected = fs.readFileSync(expectedFile, 'utf-8');
-
- group.test('updates README.md', function (t) {
- documentation(['readme index.js -s API'], {cwd: d}, function (err, stdout) {
- var outputPath = path.join(d, 'README.md');
- t.error(err);
-
- if (UPDATE) {
- fs.writeFileSync(expectedPath, fs.readFileSync(outputPath, 'utf-8'));
- }
-
- var actual = fs.readFileSync(outputPath, 'utf-8');
- t.same(actual, expected, 'generated readme output');
- t.end();
- });
- });
-
- group.test('--readme-file', function (t) {
- fs.copySync(path.join(fixtures, 'README.input.md'), path.join(d, 'other.md'));
- documentation(['readme index.js -s API --readme-file other.md'], {cwd: d}, function (err, stdout) {
- t.error(err);
- var actualPath = path.join(d, 'other.md');
- if (UPDATE) {
- fs.writeFileSync(actualPath, expected);
- }
- var actual = fs.readFileSync(actualPath, 'utf-8');
- t.same(actual, expected, 'generated readme output');
- t.end();
- });
- });
-
- group.test('--diff-only: changes NOT needed', function (t) {
- t.error(err);
- fs.copySync(path.join(fixtures, 'README.output.md'), path.join(d, 'uptodate.md'));
- documentation(['readme index.js --diff-only -s API --readme-file uptodate.md'],
- {cwd: d}, function (err, stdout, stderr) {
- t.error(err);
- t.match(stdout, 'is up to date.');
- t.end();
- });
- });
-
- group.test('requires -s option', function (t) {
- documentation(['readme index.js'], {cwd: d}, function (err, stdout, stderr) {
- t.ok(err);
- t.ok(err.code !== 0, 'exit nonzero');
- t.match(stderr, 'Missing required argument: s');
- t.end();
- });
- });
-
- group.test('errors if specified readme section is missing', function (t) {
- documentation(['readme index.js -s DUMMY'], {cwd: d}, function (err, stdout, stderr) {
- t.ok(err);
- t.ok(err.code !== 0, 'exit nonzero');
- t.end();
- });
- });
-
- group.end();
- });
-});
-
diff --git a/test/bin-watch-serve.js b/test/bin-watch-serve.js
deleted file mode 100644
index b54d3da49..000000000
--- a/test/bin-watch-serve.js
+++ /dev/null
@@ -1,129 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- path = require('path'),
- os = require('os'),
- get = require('./utils').get,
- spawn = require('child_process').spawn,
- fs = require('fs');
-
-function documentation(args, options, callback, parseJSON) {
- if (!callback) {
- callback = options;
- options = {};
- }
-
- if (!options.cwd) {
- options.cwd = __dirname;
- }
-
- options.maxBuffer = 1024 * 1024;
-
- return spawn(
- path.join(__dirname, '../bin/documentation.js'),
- args,
- options);
-}
-
-function normalize(result) {
- result.forEach(function (item) {
- item.context.file = '[path]';
- });
- return result;
-}
-
-var options = { timeout: 1000 * 120 };
-
-test('harness', options, function (t) {
- var docProcess = documentation(['fixture/simple.input.js', '--serve']);
- t.ok(docProcess, 'creates a subprocess object');
- docProcess.kill();
- t.end();
-});
-
-test('provides index.html', options, function (t) {
- var docProcess = documentation(['serve', 'fixture/simple.input.js']);
- docProcess.stdout.on('data', function (data) {
- t.equal(data.toString().trim(), 'documentation.js serving on port 4001', 'shows listening message');
- get('http://localhost:4001/', function (text) {
- t.ok(text.match(//), 'sends an html index file');
- docProcess.kill();
- t.end();
- });
- });
-});
-
-test('accepts port argument', options, function (t) {
- var docProcess = documentation(['serve', 'fixture/simple.input.js', '--port=4004']);
- docProcess.stdout.on('data', function (data) {
- t.equal(data.toString().trim(), 'documentation.js serving on port 4004', 'shows listening message');
- get('http://localhost:4004/', function (text) {
- t.ok(text.match(//), 'sends an html index file');
- docProcess.kill();
- t.end();
- });
- });
-});
-
-test('--watch', options, function (t) {
- var tmpFile = path.join(os.tmpdir(), '/simple.js');
- fs.writeFileSync(tmpFile, '/** a function */function apples() {}');
- var docProcess = documentation(['serve', tmpFile, '--watch']);
- docProcess.stdout.on('data', function (data) {
- get('http://localhost:4001/', function (text) {
- t.ok(text.match(/apples/), 'sends an html index file');
- fs.writeFileSync(tmpFile, '/** a function */function bananas() {}');
- function doGet() {
- get('http://localhost:4001/', function (text) {
- if (text.match(/bananas/)) {
- docProcess.kill();
- t.end();
- } else {
- setTimeout(doGet, 100);
- }
- });
- }
- doGet();
- });
- });
-});
-
-test('--watch', options, function (t) {
- var tmpDir = os.tmpdir();
- var a = path.join(tmpDir, '/simple.js');
- var b = path.join(tmpDir, '/required.js');
- fs.writeFileSync(a, 'require("./required")');
- fs.writeFileSync(b, '/** soup */function soup() {}');
- var docProcess = documentation(['serve', a, '--watch']);
- docProcess.stdout.on('data', function (data) {
- get('http://localhost:4001/', function (text) {
- t.ok(text.match(/soup/), 'sends an html index file');
- fs.writeFileSync(b, '/** nuts */function nuts() {}');
- function doGet() {
- get('http://localhost:4001/', function (text) {
- if (text.match(/nuts/)) {
- docProcess.kill();
- t.end();
- } else {
- setTimeout(doGet, 100);
- }
- });
- }
- doGet();
- });
- });
-});
-
-test('error page', options, function (t) {
- var tmpDir = os.tmpdir();
- var a = path.join(tmpDir, '/simple.js');
- fs.writeFileSync(a, '**');
- var docProcess = documentation(['serve', a, '--watch']);
- docProcess.stdout.on('data', function (data) {
- get('http://localhost:4001/', function (text) {
- t.ok(text.match(/Unexpected token/), 'emits an error page');
- docProcess.kill();
- t.end();
- });
- });
-});
diff --git a/test/bin.js b/test/bin.js
deleted file mode 100644
index 24301843a..000000000
--- a/test/bin.js
+++ /dev/null
@@ -1,377 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- path = require('path'),
- os = require('os'),
- exec = require('child_process').exec,
- tmp = require('tmp'),
- fs = require('fs-extra');
-
-function documentation(args, options, callback, parseJSON) {
- if (!callback) {
- parseJSON = callback;
- callback = options;
- options = {};
- }
-
- if (!options.cwd) {
- options.cwd = __dirname;
- }
-
- options.maxBuffer = 1024 * 1024;
-
- args.unshift(path.join(__dirname, '../bin/documentation.js'));
-
- exec(args.join(' '), options, function (err, stdout, stderr) {
- if (err) {
- return callback(err, stdout, stderr);
- }
- if (parseJSON === false) {
- callback(err, stdout, stderr);
- } else {
- callback(err, JSON.parse(stdout), stderr);
- }
- });
-}
-
-function normalize(result) {
- result.forEach(function (item) {
- item.context.file = '[path]';
- });
- return result;
-}
-
-var options = { timeout: 1000 * 120 };
-
-test('documentation binary', options, function (t) {
- documentation(['build fixture/simple.input.js'], function (err, data) {
- t.error(err);
- t.equal(data.length, 1, 'simple has no dependencies');
- t.end();
- });
-});
-
-test('defaults to parsing package.json main', options, function (t) {
- documentation(['build'], { cwd: path.join(__dirname, '..') }, function (err, data) {
- t.error(err);
- t.ok(data.length, 'we document ourself');
- t.end();
- });
-});
-
-test('polyglot mode', options, function (t) {
- documentation(['build fixture/polyglot/blend.cpp --polyglot'],
- function (err, data) {
- t.ifError(err);
- if (process.env.UPDATE) {
- fs.writeFileSync(
- path.resolve(__dirname,
- 'fixture',
- 'polyglot/blend.json'), JSON.stringify(normalize(data), null, 2), 'utf8');
- }
- var expected = fs.readFileSync(
- path.resolve(__dirname,
- 'fixture',
- 'polyglot/blend.json'), 'utf8');
- t.deepEqual(
- normalize(data),
- JSON.parse(expected),
- 'parsed C++ file');
- t.end();
- });
-});
-
-test('accepts config file', options, function (t) {
- documentation(['build fixture/sorting/input.js -c fixture/config.json'],
- function (err, data) {
- t.error(err);
- if (process.env.UPDATE) {
- fs.writeFileSync(
- path.resolve(__dirname,
- 'fixture',
- 'sorting/output.json'), JSON.stringify(normalize(data), null, 2), 'utf8');
- }
- var expected = fs.readFileSync(
- path.resolve(__dirname,
- 'fixture',
- 'sorting/output.json'), 'utf8');
- t.deepEqual(
- normalize(data),
- JSON.parse(expected),
- 'respected sort order from config file');
- t.end();
- });
-});
-
-test('accepts config file - reports failures', options, function (t) {
- documentation(['build fixture/sorting/input.js -c fixture/config-bad.yml'], {},
- function (err, data, stderr) {
- t.error(err);
- if (process.env.UPDATE) {
- fs.writeFileSync(
- path.resolve(__dirname,
- 'fixture',
- 'sorting/output-bad.txt'), stderr, 'utf8');
- }
- var expected = fs.readFileSync(
- path.resolve(__dirname,
- 'fixture',
- 'sorting/output-bad.txt'), 'utf8');
- t.equal(stderr, expected, 'reported a missing toc entry');
- t.end();
- }, false);
-});
-
-test('--shallow option', function (t) {
- documentation(['build --shallow fixture/internal.input.js'], function (err, data) {
- t.error(err);
- t.equal(data.length, 0, 'should not check dependencies');
- t.end();
- });
-});
-
-test('external modules option', function (t) {
- documentation(['build fixture/external.input.js ' +
- '--external=external --external=external/node_modules'], function (err, data) {
- t.ifError(err);
- t.equal(data.length, 2, 'Includes external file');
- t.end();
- });
-});
-
-test('extension option', function (t) {
- documentation(['build fixture/extension/index.otherextension ' +
- '--extension=otherextension'], function (err, data) {
- t.ifError(err);
- t.equal(data.length, 1, 'includes a file with an arbitrary extension');
- t.end();
- });
-});
-
-test('extension option', function (t) {
- documentation(['build fixture/extension.jsx'], function (err, data) {
- t.ifError(err);
- t.end();
- });
-});
-
-test('invalid arguments', function (group) {
- group.test('bad -f option', options, function (t) {
- documentation(['build -f DOES-NOT-EXIST fixture/internal.input.js'], {}, function (err) {
- t.ok(err, 'returns error');
- t.end();
- }, false);
- });
-
- group.test('html with no destination', options, function (t) {
- documentation(['build -f html fixture/internal.input.js'], function (err) {
- t.ok(err.toString()
- .match(/The HTML output mode requires a destination directory set with -o/),
- 'needs dest for html');
- t.end();
- });
- });
-
- group.test('bad command', function (t) {
- documentation(['-f html fixture/internal.input.js'], {}, function (err, stdout, stderr) {
- t.ok(err.code, 'exits nonzero');
- t.end();
- }, false);
- });
-
- group.end();
-});
-
-test('--config', options, function (t) {
- var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString());
- fs.mkdirSync(dst);
- var outputIndex = path.join(dst, 'index.html');
- var expectedOutputPath = path.join(__dirname, 'fixture/html/nested.config-output.html');
- documentation(['build -c fixture/html/documentation.yml -f html fixture/html/nested.input.js -o ' +
- dst], function (err) {
- t.notOk(err);
- var output = fs.readFileSync(outputIndex, 'utf8');
- if (process.env.UPDATE) {
- fs.writeFileSync(expectedOutputPath, output);
- }
- var expectedOutput = fs.readFileSync(expectedOutputPath, 'utf8');
- t.equal(expectedOutput, output, 'generates correct output');
- t.end();
- }, false);
-});
-
-test('--version', options, function (t) {
- documentation(['--version'], {}, function (err, output) {
- t.ok(output, 'outputs version');
- t.end();
- }, false);
-});
-
-test('lint command', function (group) {
-
- group.test('generates lint output', options, function (t) {
- documentation(['lint fixture/lint/lint.input.js'], function (err, data) {
- var output = path.join(__dirname, 'fixture/lint/lint.output.js');
- data = data.toString().split('\n').slice(2).join('\n');
- if (process.env.UPDATE) {
- fs.writeFileSync(output, data);
- }
- t.equal(err.code, 1);
- t.equal(data, fs.readFileSync(output, 'utf8'), 'outputs lint');
- t.end();
- });
- });
-
- group.test('generates no output on a good file', options, function (t) {
- documentation(['lint fixture/simple.input.js'], {}, function (err, data) {
- t.equal(err, null);
- t.equal(data, '', 'no output');
- t.end();
- }, false);
- });
-
- group.test('exposes syntax error on a bad file', options, function (t) {
- documentation(['lint fixture/bad/syntax.input.js'], {}, function (err, data) {
- t.ok(err.code > 0, 'exits with a > 0 exit code');
- t.end();
- }, false);
- });
-
- group.end();
-});
-
-test('given no files', options, function (t) {
- documentation(['build'], function (err) {
- t.ok(err.toString()
- .match(/documentation was given no files and was not run in a module directory/),
- 'no files given');
- t.end();
- });
-});
-
-test('with an invalid command', options, function (t) {
- documentation(['invalid'], {}, function (err) {
- t.ok(err, 'returns error');
- t.end();
- }, false);
-});
-
-test('--access flag', function (t) {
- documentation(['build --shallow fixture/internal.input.js -a public'], {}, function (err, data) {
- t.error(err);
- t.equal(data, '[]');
- t.end();
- }, false);
-});
-
-test('--private flag', function (t) {
- documentation(['build fixture/internal.input.js --private'], {}, function (err, data) {
- t.error(err);
- t.ok(data.length > 2, 'outputs docs');
- t.end();
- }, false);
-});
-
-test('--infer-private flag', function (t) {
- documentation(['build fixture/infer-private.input.js --infer-private ^_'], {}, function (err, data) {
- t.error(err);
-
- // This uses JSON.parse with a reviver used as a visitor.
- JSON.parse(data, function (n, v) {
- // Make sure we do not see any names that match `^_`.
- if (n === 'name') {
- t.equal(typeof v, 'string');
- t.ok(!/_$/.test(v));
- }
- return v;
- });
- t.end();
- }, false);
-});
-
-test('write to file', options, function (t) {
-
- var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString());
-
- documentation(['build --shallow fixture/internal.input.js -o ' + dst], {}, function (err, data) {
- t.error(err);
- t.equal(data, '');
- t.ok(fs.existsSync(dst), 'created file');
- t.end();
- }, false);
-});
-
-test('write to html', options, function (t) {
-
- var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString());
- fs.mkdirSync(dstDir);
-
- documentation(['build --shallow fixture/internal.input.js -f html -o ' + dstDir], {},
- function (err, data) {
- t.error(err);
- t.equal(data, '');
- t.ok(fs.existsSync(path.join(dstDir, 'index.html')), 'created index.html');
- t.end();
- }, false);
-});
-
-test('write to html with custom theme', options, function (t) {
-
- var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString());
- fs.mkdirSync(dstDir);
-
- documentation(['build -t fixture/custom_theme --shallow fixture/internal.input.js -f html -o ' + dstDir], {},
- function (err, data) {
- t.error(err);
- t.equal(data, '');
- t.ok(fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8'), 'Hello world');
- t.end();
- }, false);
-});
-
-test('write to html, highlightAuto', options, function (t) {
-
- var fixture = 'fixture/auto_lang_hljs/multilanguage.input.js',
- config = 'fixture/auto_lang_hljs/config.yml',
- dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString());
-
- fs.mkdirSync(dstDir);
-
- documentation(['build --shallow ' + fixture + ' -c ' + config + ' -f html -o ' + dstDir], {},
- function (err) {
- t.ifErr(err);
- var result = fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8');
- t.ok(result.indexOf('42 ') > 0,
- 'javascript is recognized by highlightjs');
- t.ok(result.indexOf('[data-foo] ') > 0,
- 'css is recognized by highlightjs');
- t.ok(result.indexOf('data-foo ') > 0,
- 'html is recognized by highlightjs');
- t.end();
- }, false);
-});
-
-test('fatal error', options, function (t) {
-
- documentation(['build --shallow fixture/bad/syntax.input.js'], {},
- function (err) {
- t.ok(err.toString().match(/Unexpected token/), 'reports syntax error');
- t.end();
- }, false);
-});
-
-test('build --document-exported', function (t) {
-
- documentation(['build fixture/document-exported.input.js --document-exported -f md'], {}, function (err, data) {
- t.error(err);
-
- var outputfile = path.join(__dirname, 'fixture', 'document-exported.output.md');
- if (process.env.UPDATE) {
- fs.writeFileSync(outputfile, data, 'utf8');
- }
-
- var expect = fs.readFileSync(outputfile, 'utf-8');
- t.equal(data, expect);
- t.end();
- }, false);
-}, options);
diff --git a/test/fixture/boolean-literal-type.output.json b/test/fixture/boolean-literal-type.output.json
deleted file mode 100644
index 2ea4eb916..000000000
--- a/test/fixture/boolean-literal-type.output.json
+++ /dev/null
@@ -1,79 +0,0 @@
-[
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 1,
- "column": 6
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 2,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "f",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "t",
- "lineNumber": 2,
- "type": {
- "type": "BooleanLiteralType",
- "value": true
- }
- },
- {
- "title": "param",
- "name": "f",
- "lineNumber": 2,
- "type": {
- "type": "BooleanLiteralType",
- "value": false
- }
- }
- ],
- "returns": [
- {
- "type": {
- "type": "ArrayType",
- "elements": [
- {
- "type": "BooleanLiteralType",
- "value": true
- },
- {
- "type": "BooleanLiteralType",
- "value": false
- }
- ]
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "f",
- "kind": "function"
- }
- ],
- "namespace": "f"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/boolean-literal-type.output.md b/test/fixture/boolean-literal-type.output.md
deleted file mode 100644
index a3dbe313e..000000000
--- a/test/fixture/boolean-literal-type.output.md
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-# f
-
-**Parameters**
-
-- `t` **`true`**
-- `f` **`false`**
-
-Returns **\[`true`, `false`]**
diff --git a/test/fixture/boolean-literal-type.output.md.json b/test/fixture/boolean-literal-type.output.md.json
deleted file mode 100644
index 81739d92b..000000000
--- a/test/fixture/boolean-literal-type.output.md.json
+++ /dev/null
@@ -1,134 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "f"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "t"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "inlineCode",
- "value": "true"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "f"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "inlineCode",
- "value": "false"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "["
- },
- {
- "type": "inlineCode",
- "value": "true"
- },
- {
- "type": "text",
- "value": ", "
- },
- {
- "type": "inlineCode",
- "value": "false"
- },
- {
- "type": "text",
- "value": "]"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/class.output.json b/test/fixture/class.output.json
deleted file mode 100644
index c539e4535..000000000
--- a/test/fixture/class.output.json
+++ /dev/null
@@ -1,581 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is my class, a demo thing.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- }
- }
- },
- "tags": [
- {
- "title": "class",
- "description": null,
- "lineNumber": 2,
- "type": null,
- "name": "MyClass"
- },
- {
- "title": "property",
- "description": "how many things it contains",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "howMany"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 6,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 1
- }
- }
- },
- "errors": [],
- "kind": "class",
- "name": "MyClass",
- "properties": [
- {
- "name": "howMany",
- "lineNumber": 3,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "how many things it contains",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "members": {
- "instance": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Get the number 42",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "whether to get the number",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "boolean"
- },
- "name": "getIt"
- },
- {
- "title": "returns",
- "description": "forty-two",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 14,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 15,
- "column": 0
- },
- "end": {
- "line": 17,
- "column": 2
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "getIt",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "whether to get the number",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "boolean"
- }
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "forty-two",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "getFoo",
- "kind": "function",
- "memberof": "MyClass",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "MyClass",
- "kind": "class"
- },
- {
- "name": "getFoo",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "MyClass#getFoo"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Get undefined",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "does not return anything.",
- "lineNumber": 2,
- "type": {
- "type": "UndefinedLiteral"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 19,
- "column": 0
- },
- "end": {
- "line": 22,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 23,
- "column": 0
- },
- "end": {
- "line": 23,
- "column": 49
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "does not return anything.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- }
- }
- },
- "type": {
- "type": "UndefinedLiteral"
- }
- }
- ],
- "name": "getUndefined",
- "kind": "function",
- "memberof": "MyClass",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "MyClass",
- "kind": "class"
- },
- {
- "name": "getUndefined",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "MyClass#getUndefined"
- }
- ],
- "static": [],
- "events": []
- },
- "path": [
- {
- "name": "MyClass",
- "kind": "class"
- }
- ],
- "namespace": "MyClass"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/class.output.md b/test/fixture/class.output.md
deleted file mode 100644
index 371b57287..000000000
--- a/test/fixture/class.output.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-# MyClass
-
-This is my class, a demo thing.
-
-**Properties**
-
-- `howMany` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains
-
-## getFoo
-
-Get the number 42
-
-**Parameters**
-
-- `getIt` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to get the number
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two
-
-## getUndefined
-
-Get undefined
-
-Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything.
diff --git a/test/fixture/class.output.md.json b/test/fixture/class.output.md.json
deleted file mode 100644
index 1e7d5837a..000000000
--- a/test/fixture/class.output.md.json
+++ /dev/null
@@ -1,448 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "MyClass"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is my class, a demo thing.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Properties"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "howMany"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "how many things it contains",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "getFoo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Get the number 42",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "getIt"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "boolean"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "whether to get the number",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "forty-two",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "getUndefined"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Get undefined",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "undefined"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "does not return anything.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/document-exported.output.json b/test/fixture/document-exported.output.json
deleted file mode 100644
index b886f3cbc..000000000
--- a/test/fixture/document-exported.output.json
+++ /dev/null
@@ -1,1445 +0,0 @@
-[
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 1
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "z",
- "kind": "class",
- "members": {
- "instance": [
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 2,
- "column": 2
- },
- "end": {
- "line": 2,
- "column": 14
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 2,
- "column": 2
- },
- "end": {
- "line": 2,
- "column": 14
- }
- }
- },
- "errors": [],
- "name": "zMethod",
- "kind": "function",
- "memberof": "z",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "z",
- "kind": "class"
- },
- {
- "name": "zMethod",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "z#zMethod"
- }
- ],
- "static": [],
- "events": []
- },
- "path": [
- {
- "name": "z",
- "kind": "class"
- }
- ],
- "namespace": "z"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 1,
- "column": 28
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 1,
- "column": 28
- }
- }
- },
- "errors": [],
- "name": "x",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "yparam",
- "lineNumber": 1
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "x",
- "kind": "function"
- }
- ],
- "namespace": "x"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 3,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 1
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 3,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "Class",
- "kind": "class",
- "members": {
- "instance": [
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 4,
- "column": 2
- },
- "end": {
- "line": 4,
- "column": 18
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 2
- },
- "end": {
- "line": 4,
- "column": 18
- }
- }
- },
- "errors": [],
- "name": "classMethod",
- "kind": "function",
- "memberof": "Class",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Class",
- "kind": "class"
- },
- {
- "name": "classMethod",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "Class#classMethod"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 5,
- "column": 2
- },
- "end": {
- "line": 5,
- "column": 22
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 2
- },
- "end": {
- "line": 5,
- "column": 22
- }
- }
- },
- "errors": [],
- "name": "classGetter",
- "kind": "member",
- "memberof": "Class",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Class",
- "kind": "class"
- },
- {
- "name": "classGetter",
- "kind": "member",
- "scope": "instance"
- }
- ],
- "namespace": "Class#classGetter"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 6,
- "column": 2
- },
- "end": {
- "line": 6,
- "column": 23
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 6,
- "column": 2
- },
- "end": {
- "line": 6,
- "column": 23
- }
- }
- },
- "errors": [],
- "name": "classSetter",
- "kind": "member",
- "params": [
- {
- "title": "param",
- "name": "v",
- "lineNumber": 6
- }
- ],
- "memberof": "Class",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Class",
- "kind": "class"
- },
- {
- "name": "classSetter",
- "kind": "member",
- "scope": "instance"
- }
- ],
- "namespace": "Class#classSetter"
- }
- ],
- "static": [
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 7,
- "column": 2
- },
- "end": {
- "line": 7,
- "column": 26
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 7,
- "column": 2
- },
- "end": {
- "line": 7,
- "column": 26
- }
- }
- },
- "errors": [],
- "name": "staticMethod",
- "kind": "function",
- "memberof": "Class",
- "scope": "static",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Class",
- "kind": "class"
- },
- {
- "name": "staticMethod",
- "kind": "function",
- "scope": "static"
- }
- ],
- "namespace": "Class.staticMethod"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 8,
- "column": 2
- },
- "end": {
- "line": 8,
- "column": 30
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 8,
- "column": 2
- },
- "end": {
- "line": 8,
- "column": 30
- }
- }
- },
- "errors": [],
- "name": "staticGetter",
- "kind": "member",
- "memberof": "Class",
- "scope": "static",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Class",
- "kind": "class"
- },
- {
- "name": "staticGetter",
- "kind": "member",
- "scope": "static"
- }
- ],
- "namespace": "Class.staticGetter"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 9,
- "column": 2
- },
- "end": {
- "line": 9,
- "column": 31
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 9,
- "column": 2
- },
- "end": {
- "line": 9,
- "column": 31
- }
- }
- },
- "errors": [],
- "name": "staticSetter",
- "kind": "member",
- "params": [
- {
- "title": "param",
- "name": "v",
- "lineNumber": 9
- }
- ],
- "memberof": "Class",
- "scope": "static",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Class",
- "kind": "class"
- },
- {
- "name": "staticSetter",
- "kind": "member",
- "scope": "static"
- }
- ],
- "namespace": "Class.staticSetter"
- }
- ],
- "events": []
- },
- "path": [
- {
- "name": "Class",
- "kind": "class"
- }
- ],
- "namespace": "Class"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 3,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 25
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 3,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 25
- }
- }
- },
- "errors": [],
- "name": "T5",
- "kind": "typedef",
- "type": {
- "type": "NameExpression",
- "name": "boolean"
- },
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "T5",
- "kind": "typedef"
- }
- ],
- "namespace": "T5"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 18
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 18
- }
- }
- },
- "errors": [],
- "name": "y2Default",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "y2Default"
- }
- ],
- "namespace": "y2Default"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Description of y3",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 24
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 8,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 31
- }
- }
- },
- "errors": [],
- "name": "y4",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "p",
- "lineNumber": 8,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "returns": [
- {
- "type": {
- "type": "VoidLiteral"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "y4",
- "kind": "function"
- }
- ],
- "namespace": "y4"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 12,
- "column": 0
- },
- "end": {
- "line": 18,
- "column": 2
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 12,
- "column": 0
- },
- "end": {
- "line": 18,
- "column": 2
- }
- }
- },
- "errors": [],
- "name": "object",
- "members": {
- "instance": [],
- "static": [
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 16,
- "column": 2
- },
- "end": {
- "line": 16,
- "column": 10
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 16,
- "column": 2
- },
- "end": {
- "line": 16,
- "column": 10
- }
- }
- },
- "errors": [],
- "name": "prop",
- "memberof": "object",
- "scope": "static",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "object"
- },
- {
- "name": "prop",
- "scope": "static"
- }
- ],
- "namespace": "object.prop"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 17,
- "column": 2
- },
- "end": {
- "line": 17,
- "column": 21
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 17,
- "column": 2
- },
- "end": {
- "line": 17,
- "column": 21
- }
- }
- },
- "errors": [],
- "name": "func",
- "kind": "function",
- "memberof": "object",
- "scope": "static",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "object"
- },
- {
- "name": "func",
- "kind": "function",
- "scope": "static"
- }
- ],
- "namespace": "object.func"
- }
- ]
- },
- "path": [
- {
- "name": "object"
- }
- ],
- "namespace": "object"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 13,
- "column": 2
- },
- "end": {
- "line": 13,
- "column": 13
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 13,
- "column": 2
- },
- "end": {
- "line": 13,
- "column": 13
- }
- }
- },
- "errors": [],
- "name": "method",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "method",
- "kind": "function"
- }
- ],
- "namespace": "method"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 14,
- "column": 2
- },
- "end": {
- "line": 14,
- "column": 17
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 14,
- "column": 2
- },
- "end": {
- "line": 14,
- "column": 17
- }
- }
- },
- "errors": [],
- "name": "getter",
- "kind": "member",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "getter",
- "kind": "member"
- }
- ],
- "namespace": "getter"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 15,
- "column": 2
- },
- "end": {
- "line": 15,
- "column": 18
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 15,
- "column": 2
- },
- "end": {
- "line": 15,
- "column": 18
- }
- }
- },
- "errors": [],
- "name": "setter",
- "kind": "member",
- "params": [
- {
- "title": "param",
- "name": "v",
- "lineNumber": 15
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "setter",
- "kind": "member"
- }
- ],
- "namespace": "setter"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 54,
- "column": 0
- },
- "end": {
- "line": 54,
- "column": 16
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 54,
- "column": 0
- },
- "end": {
- "line": 54,
- "column": 16
- }
- }
- },
- "errors": [],
- "name": "f1",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "f1",
- "kind": "function"
- }
- ],
- "namespace": "f1"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 55,
- "column": 0
- },
- "end": {
- "line": 55,
- "column": 16
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 55,
- "column": 0
- },
- "end": {
- "line": 55,
- "column": 16
- }
- }
- },
- "errors": [],
- "name": "f3",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "f3",
- "kind": "function"
- }
- ],
- "namespace": "f3"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 59,
- "column": 0
- },
- "end": {
- "line": 59,
- "column": 23
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 59,
- "column": 0
- },
- "end": {
- "line": 59,
- "column": 23
- }
- }
- },
- "errors": [],
- "name": "T",
- "kind": "typedef",
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "T",
- "kind": "typedef"
- }
- ],
- "namespace": "T"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 60,
- "column": 0
- },
- "end": {
- "line": 60,
- "column": 17
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 60,
- "column": 0
- },
- "end": {
- "line": 60,
- "column": 17
- }
- }
- },
- "errors": [],
- "name": "T2",
- "kind": "typedef",
- "type": {
- "type": "NameExpression",
- "name": "string"
- },
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "T2",
- "kind": "typedef"
- }
- ],
- "namespace": "T2"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 61,
- "column": 0
- },
- "end": {
- "line": 61,
- "column": 17
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 61,
- "column": 0
- },
- "end": {
- "line": 61,
- "column": 17
- }
- }
- },
- "errors": [],
- "name": "T4",
- "kind": "typedef",
- "type": {
- "type": "NameExpression",
- "name": "string"
- },
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "T4",
- "kind": "typedef"
- }
- ],
- "namespace": "T4"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 67,
- "column": 0
- },
- "end": {
- "line": 67,
- "column": 33
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 67,
- "column": 0
- },
- "end": {
- "line": 67,
- "column": 33
- }
- }
- },
- "errors": [],
- "name": "f4",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "x",
- "lineNumber": 67,
- "type": {
- "type": "NameExpression",
- "name": "X"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "f4",
- "kind": "function"
- }
- ],
- "namespace": "f4"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 72,
- "column": 0
- },
- "end": {
- "line": 74,
- "column": 1
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 72,
- "column": 0
- },
- "end": {
- "line": 74,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "o1",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "o1"
- }
- ],
- "namespace": "o1"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 73,
- "column": 2
- },
- "end": {
- "line": 73,
- "column": 10
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 73,
- "column": 2
- },
- "end": {
- "line": 73,
- "column": 10
- }
- }
- },
- "errors": [],
- "name": "om1",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "om1",
- "kind": "function"
- }
- ],
- "namespace": "om1"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "f5 comment",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 76,
- "column": 0
- },
- "end": {
- "line": 76,
- "column": 17
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 77,
- "column": 0
- },
- "end": {
- "line": 80,
- "column": 4
- }
- }
- },
- "errors": [],
- "name": "f5",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "y",
- "lineNumber": 77,
- "type": {
- "type": "NameExpression",
- "name": "Y"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "f5",
- "kind": "function"
- }
- ],
- "namespace": "f5"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 78,
- "column": 2
- },
- "end": {
- "line": 80,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 78,
- "column": 2
- },
- "end": {
- "line": 80,
- "column": 3
- }
- }
- },
- "errors": [],
- "name": "o2",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "o2"
- }
- ],
- "namespace": "o2"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 79,
- "column": 4
- },
- "end": {
- "line": 79,
- "column": 12
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 79,
- "column": 4
- },
- "end": {
- "line": 79,
- "column": 12
- }
- }
- },
- "errors": [],
- "name": "om2",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "om2",
- "kind": "function"
- }
- ],
- "namespace": "om2"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/document-exported.output.md b/test/fixture/document-exported.output.md
deleted file mode 100644
index 050ee4474..000000000
--- a/test/fixture/document-exported.output.md
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-# z
-
-## zMethod
-
-# x
-
-**Parameters**
-
-- `yparam`
-
-# Class
-
-## classMethod
-
-## classGetter
-
-## classSetter
-
-**Parameters**
-
-- `v`
-
-## staticMethod
-
-## staticGetter
-
-## staticSetter
-
-**Parameters**
-
-- `v`
-
-# T5
-
-# y2Default
-
-# y4
-
-Description of y3
-
-**Parameters**
-
-- `p` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-
-Returns **void**
-
-# object
-
-## prop
-
-## func
-
-# method
-
-# getter
-
-# setter
-
-**Parameters**
-
-- `v`
-
-# f1
-
-# f3
-
-# T
-
-# T2
-
-# T4
-
-# f4
-
-**Parameters**
-
-- `x` **X**
-
-# o1
-
-# om1
-
-# f5
-
-f5 comment
-
-**Parameters**
-
-- `y` **Y**
-
-# o2
-
-# om2
diff --git a/test/fixture/document-exported.output.md.json b/test/fixture/document-exported.output.md.json
deleted file mode 100644
index ea3cff981..000000000
--- a/test/fixture/document-exported.output.md.json
+++ /dev/null
@@ -1,694 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "z"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "zMethod"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "x"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "yparam"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Class"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "classMethod"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "classGetter"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "classSetter"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "v"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "staticMethod"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "staticGetter"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "staticSetter"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "v"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "T5"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "y2Default"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "y4"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Description of y3",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "p"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "void"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "object"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "prop"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "func"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "method"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "getter"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "setter"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "v"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "f1"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "f3"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "T"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "T2"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "T4"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "f4"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "X"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "o1"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "om1"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "f5"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "f5 comment",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "y"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Y"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "o2"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "om2"
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/document-exported/x.js b/test/fixture/document-exported/x.js
deleted file mode 100644
index 1757ae6d0..000000000
--- a/test/fixture/document-exported/x.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export {y as x, y3} from './y.js';
-
-export type T5 = boolean;
diff --git a/test/fixture/es6-class.input.js b/test/fixture/es6-class.input.js
deleted file mode 100644
index 256d954db..000000000
--- a/test/fixture/es6-class.input.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * This is my component. This is from issue #458
- */
-class Foo extends React.Component {}
-
-/**
- * Does nothing. This is from issue #556
- */
-export default class Bar {
-
- /**
- * Creates a new instance
- * @param {string} str
- */
- constructor(str) {
- /**
- * A useless property
- * @type {string}
- */
- this.bar = "";
- }
-}
diff --git a/test/fixture/es6-class.output.json b/test/fixture/es6-class.output.json
deleted file mode 100644
index acdacf6b3..000000000
--- a/test/fixture/es6-class.output.json
+++ /dev/null
@@ -1,417 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is my component. This is from issue #458",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 46,
- "offset": 45
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 46,
- "offset": 45
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 46,
- "offset": 45
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 36
- }
- }
- },
- "errors": [],
- "name": "Foo",
- "augments": [
- {
- "title": "augments",
- "name": "React.Component"
- }
- ],
- "kind": "class",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Foo",
- "kind": "class"
- }
- ],
- "namespace": "Foo"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Does nothing. This is from issue #556",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 6,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 9,
- "column": 0
- },
- "end": {
- "line": 22,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "Bar",
- "kind": "class",
- "members": {
- "instance": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Creates a new instance",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": null,
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "string"
- },
- "name": "str"
- }
- ],
- "loc": {
- "start": {
- "line": 11,
- "column": 4
- },
- "end": {
- "line": 14,
- "column": 7
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 15,
- "column": 4
- },
- "end": {
- "line": 21,
- "column": 5
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "str",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ],
- "name": "constructor",
- "kind": "function",
- "memberof": "Bar",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Bar",
- "kind": "class"
- },
- {
- "name": "constructor",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "Bar#constructor"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A useless property",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- }
- }
- },
- "tags": [
- {
- "title": "type",
- "description": null,
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 16,
- "column": 8
- },
- "end": {
- "line": 19,
- "column": 11
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 20,
- "column": 8
- },
- "end": {
- "line": 20,
- "column": 22
- }
- }
- },
- "errors": [],
- "name": "bar",
- "memberof": "Bar",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Bar",
- "kind": "class"
- },
- {
- "name": "bar",
- "scope": "instance"
- }
- ],
- "namespace": "Bar#bar"
- }
- ],
- "static": [],
- "events": []
- },
- "path": [
- {
- "name": "Bar",
- "kind": "class"
- }
- ],
- "namespace": "Bar"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/es6-class.output.md b/test/fixture/es6-class.output.md
deleted file mode 100644
index 43266e7ba..000000000
--- a/test/fixture/es6-class.output.md
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-# Foo
-
-**Extends React.Component**
-
-This is my component. This is from issue #458
-
-# Bar
-
-Does nothing. This is from issue #556
-
-## constructor
-
-Creates a new instance
-
-**Parameters**
-
-- `str` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
-
-## bar
-
-A useless property
diff --git a/test/fixture/es6-class.output.md.json b/test/fixture/es6-class.output.md.json
deleted file mode 100644
index b05fc7990..000000000
--- a/test/fixture/es6-class.output.md.json
+++ /dev/null
@@ -1,260 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Foo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Extends "
- },
- {
- "type": "text",
- "value": "React.Component"
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is my component. This is from issue #458",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 46,
- "offset": 45
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 46,
- "offset": 45
- },
- "indent": []
- }
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Bar"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Does nothing. This is from issue #556",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "constructor"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Creates a new instance",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "str"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "bar"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A useless property",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/es6-default2.input.js b/test/fixture/es6-default2.input.js
deleted file mode 100644
index 7bb836e7b..000000000
--- a/test/fixture/es6-default2.input.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * @public
- */
-export default (thisIsTheArgument) => {};
diff --git a/test/fixture/es6-default2.output.json b/test/fixture/es6-default2.output.json
deleted file mode 100644
index 17bb6cac3..000000000
--- a/test/fixture/es6-default2.output.json
+++ /dev/null
@@ -1,56 +0,0 @@
-[
- {
- "description": "",
- "tags": [
- {
- "title": "public",
- "description": null,
- "lineNumber": 1
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 41
- }
- }
- },
- "errors": [],
- "access": "public",
- "name": "es6-default2.input",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "thisIsTheArgument",
- "lineNumber": 4
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "es6-default2.input",
- "kind": "function"
- }
- ],
- "namespace": "es6-default2.input"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/es6-default2.output.md b/test/fixture/es6-default2.output.md
deleted file mode 100644
index 946f20dba..000000000
--- a/test/fixture/es6-default2.output.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-# es6-default2.input
-
-**Parameters**
-
-- `thisIsTheArgument`
diff --git a/test/fixture/es6-default2.output.md.json b/test/fixture/es6-default2.output.md.json
deleted file mode 100644
index 764e3731a..000000000
--- a/test/fixture/es6-default2.output.md.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "es6-default2.input"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "thisIsTheArgument"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/es6-import.input.js b/test/fixture/es6-import.input.js
deleted file mode 100644
index 19d21072c..000000000
--- a/test/fixture/es6-import.input.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import hasEx6 from './es6-ext';
-import multiply from "./simple.input.js";
-import * as foo from "some-other-module";
-
-/**
- * This function returns the number one.
- * @returns {Number} numberone
- */
-var multiplyTwice = (a) => a * multiply(a);
-
-export default multiplyTwice;
diff --git a/test/fixture/es6-import.output.json b/test/fixture/es6-import.output.json
deleted file mode 100644
index 8388f25d0..000000000
--- a/test/fixture/es6-import.output.json
+++ /dev/null
@@ -1,420 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 9,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 43
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "name": "multiplyTwice",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "a",
- "lineNumber": 9
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "multiplyTwice",
- "kind": "function"
- }
- ],
- "namespace": "multiplyTwice"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is the default export frogs!",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 18
- }
- }
- },
- "errors": [],
- "name": "es6-ext",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "es6-ext"
- }
- ],
- "namespace": "es6-ext"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 2
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "simple.input",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "simple.input",
- "kind": "function"
- }
- ],
- "namespace": "simple.input"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/es6-import.output.md b/test/fixture/es6-import.output.md
deleted file mode 100644
index bea585d89..000000000
--- a/test/fixture/es6-import.output.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-# multiplyTwice
-
-This function returns the number one.
-
-**Parameters**
-
-- `a`
-
-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
-
-# es6-ext
-
-This is the default export frogs!
-
-# simple.input
-
-This function returns the number one.
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
diff --git a/test/fixture/es6-import.output.md.json b/test/fixture/es6-import.output.md.json
deleted file mode 100644
index eded2cef2..000000000
--- a/test/fixture/es6-import.output.md.json
+++ /dev/null
@@ -1,309 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "multiplyTwice"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "es6-ext"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is the default export frogs!",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "simple.input"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json
deleted file mode 100644
index 4e899117d..000000000
--- a/test/fixture/es6.output.json
+++ /dev/null
@@ -1,2614 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 33,
- "offset": 88
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 33,
- "offset": 88
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 33,
- "offset": 88
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "destructure",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "$0",
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "default": "{}",
- "properties": [
- {
- "title": "param",
- "name": "$0.phoneNumbers",
- "default": "[]"
- },
- {
- "title": "param",
- "name": "$0.emailAddresses",
- "default": "[]"
- },
- {
- "title": "param",
- "name": "$0.params",
- "lineNumber": 5,
- "type": {
- "type": "RestType"
- }
- }
- ]
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "destructure",
- "kind": "function"
- }
- ],
- "namespace": "destructure"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Similar, but with an array",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- }
- }
- },
- "tags": [
- {
- "title": "example",
- "description": "destructure([1, 2, 3])",
- "lineNumber": 2
- }
- ],
- "loc": {
- "start": {
- "line": 8,
- "column": 0
- },
- "end": {
- "line": 12,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 13,
- "column": 0
- },
- "end": {
- "line": 14,
- "column": 1
- }
- }
- },
- "errors": [],
- "examples": [
- {
- "description": "destructure([1, 2, 3])"
- }
- ],
- "name": "destructure",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "$0",
- "type": {
- "type": "NameExpression",
- "name": "Array"
- },
- "properties": [
- {
- "title": "param",
- "name": "$0.a",
- "lineNumber": 13
- },
- {
- "title": "param",
- "name": "$0.b",
- "lineNumber": 13
- },
- {
- "title": "param",
- "name": "$0.c",
- "lineNumber": 13
- }
- ]
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "destructure",
- "kind": "function"
- }
- ],
- "namespace": "destructure"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "an array of numbers",
- "lineNumber": 2,
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "Number"
- }
- ]
- },
- "name": "a"
- },
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 16,
- "column": 0
- },
- "end": {
- "line": 20,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 21,
- "column": 0
- },
- "end": {
- "line": 21,
- "column": 31
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "a",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "an array of numbers",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 20,
- "offset": 19
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 20,
- "offset": 19
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 20,
- "offset": 19
- }
- }
- },
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "Number"
- }
- ]
- }
- },
- {
- "title": "param",
- "name": "b",
- "lineNumber": 21
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "name": "multiply",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "multiply",
- "kind": "function"
- }
- ],
- "namespace": "multiply"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is a sink",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 23,
- "column": 0
- },
- "end": {
- "line": 25,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 26,
- "column": 0
- },
- "end": {
- "line": 62,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "Sink",
- "kind": "class",
- "members": {
- "instance": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is a property of the sink.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 27,
- "column": 2
- },
- "end": {
- "line": 29,
- "column": 5
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 30,
- "column": 2
- },
- "end": {
- "line": 30,
- "column": 18
- }
- }
- },
- "errors": [],
- "name": "staticProp",
- "kind": "member",
- "memberof": "Sink",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Sink",
- "kind": "class"
- },
- {
- "name": "staticProp",
- "kind": "member",
- "scope": "instance"
- }
- ],
- "namespace": "Sink#staticProp"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Is it empty",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 32,
- "column": 2
- },
- "end": {
- "line": 34,
- "column": 5
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 35,
- "column": 2
- },
- "end": {
- "line": 37,
- "column": 3
- }
- }
- },
- "errors": [],
- "name": "empty",
- "kind": "function",
- "memberof": "Sink",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Sink",
- "kind": "class"
- },
- {
- "name": "empty",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "Sink#empty"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is a getter method: it should be documented\nas a property.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 15,
- "offset": 63
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 15,
- "offset": 63
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 15,
- "offset": 63
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 46,
- "column": 2
- },
- "end": {
- "line": 49,
- "column": 5
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 50,
- "column": 2
- },
- "end": {
- "line": 52,
- "column": 3
- }
- }
- },
- "errors": [],
- "name": "aGetter",
- "kind": "member",
- "memberof": "Sink",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Sink",
- "kind": "class"
- },
- {
- "name": "aGetter",
- "kind": "member",
- "scope": "instance"
- }
- ],
- "namespace": "Sink#aGetter"
- },
- {
- "description": "",
- "tags": [
- {
- "title": "param",
- "description": "the height of the thing",
- "lineNumber": 1,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "height"
- },
- {
- "title": "param",
- "description": "the width of the thing",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "width"
- }
- ],
- "loc": {
- "start": {
- "line": 54,
- "column": 2
- },
- "end": {
- "line": 57,
- "column": 5
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 58,
- "column": 2
- },
- "end": {
- "line": 61,
- "column": 3
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "height",
- "lineNumber": 1,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the height of the thing",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "name": "width",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the width of the thing",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "constructor",
- "kind": "function",
- "memberof": "Sink",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Sink",
- "kind": "class"
- },
- {
- "name": "constructor",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "Sink#constructor"
- }
- ],
- "static": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method says hello",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 39,
- "column": 2
- },
- "end": {
- "line": 41,
- "column": 5
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 42,
- "column": 2
- },
- "end": {
- "line": 44,
- "column": 3
- }
- }
- },
- "errors": [],
- "name": "hello",
- "kind": "function",
- "memberof": "Sink",
- "scope": "static",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Sink",
- "kind": "class"
- },
- {
- "name": "hello",
- "kind": "function",
- "scope": "static"
- }
- ],
- "namespace": "Sink.hello"
- }
- ],
- "events": []
- },
- "path": [
- {
- "name": "Sink",
- "kind": "class"
- }
- ],
- "namespace": "Sink"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method returns a basket. The type should not be linked.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 61,
- "offset": 60
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 61,
- "offset": 60
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 61,
- "offset": 60
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "a basket",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "Basket"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 64,
- "column": 0
- },
- "end": {
- "line": 68,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 69,
- "column": 0
- },
- "end": {
- "line": 70,
- "column": 1
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "a basket",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Basket"
- }
- }
- ],
- "name": "makeABasket",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "makeABasket",
- "kind": "function"
- }
- ],
- "namespace": "makeABasket"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method returns a ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- },
- {
- "type": "link",
- "url": "Sink",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "sink"
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "end": {
- "line": 1,
- "column": 40,
- "offset": 39
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ". The type should be linked.\nIt takes a ",
- "position": {
- "start": {
- "line": 1,
- "column": 40,
- "offset": 39
- },
- "end": {
- "line": 2,
- "column": 12,
- "offset": 79
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "link",
- "url": "number",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ],
- "position": {
- "start": {
- "line": 2,
- "column": 12,
- "offset": 79
- },
- "end": {
- "line": 2,
- "column": 26,
- "offset": 93
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": " which should also be linked.",
- "position": {
- "start": {
- "line": 2,
- "column": 26,
- "offset": 93
- },
- "end": {
- "line": 2,
- "column": 55,
- "offset": 122
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 55,
- "offset": 122
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 55,
- "offset": 122
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "a sink",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "Sink"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 72,
- "column": 0
- },
- "end": {
- "line": 77,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 78,
- "column": 0
- },
- "end": {
- "line": 79,
- "column": 1
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "a sink",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 7,
- "offset": 6
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 7,
- "offset": 6
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 7,
- "offset": 6
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Sink"
- }
- }
- ],
- "name": "makeASink",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "makeASink",
- "kind": "function"
- }
- ],
- "namespace": "makeASink"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function takes rest params",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 81,
- "column": 0
- },
- "end": {
- "line": 83,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 84,
- "column": 0
- },
- "end": {
- "line": 85,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "functionWithRest",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "someParams",
- "lineNumber": 84,
- "type": {
- "type": "RestType"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "functionWithRest",
- "kind": "function"
- }
- ],
- "namespace": "functionWithRest"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "So does this one, with types",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 87,
- "column": 0
- },
- "end": {
- "line": 89,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 90,
- "column": 0
- },
- "end": {
- "line": 91,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "functionWithRestAndType",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "someParams",
- "lineNumber": 90,
- "type": {
- "type": "RestType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "functionWithRestAndType",
- "kind": "function"
- }
- ],
- "namespace": "functionWithRestAndType"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is an async method",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 95,
- "column": 0
- },
- "end": {
- "line": 97,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 98,
- "column": 0
- },
- "end": {
- "line": 98,
- "column": 24
- }
- }
- },
- "errors": [],
- "name": "foo",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "foo",
- "kind": "function"
- }
- ],
- "namespace": "foo"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 102,
- "column": 0
- },
- "end": {
- "line": 105,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 106,
- "column": 0
- },
- "end": {
- "line": 106,
- "column": 38
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "name": "es6.input",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "es6.input",
- "kind": "function"
- }
- ],
- "namespace": "es6.input"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This tests our support of optional parameters in ES6",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 53,
- "offset": 52
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 53,
- "offset": 52
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 53,
- "offset": 52
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 108,
- "column": 0
- },
- "end": {
- "line": 110,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 111,
- "column": 0
- },
- "end": {
- "line": 113,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "veryImportantTransform",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "foo",
- "default": "'bar'"
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "veryImportantTransform",
- "kind": "function"
- }
- ],
- "namespace": "veryImportantTransform"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A protected function",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- }
- }
- },
- "tags": [
- {
- "title": "protected",
- "description": null,
- "lineNumber": 2
- }
- ],
- "loc": {
- "start": {
- "line": 123,
- "column": 0
- },
- "end": {
- "line": 126,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 127,
- "column": 0
- },
- "end": {
- "line": 127,
- "column": 27
- }
- }
- },
- "errors": [],
- "access": "protected",
- "name": "iAmProtected",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "iAmProtected",
- "kind": "function"
- }
- ],
- "namespace": "iAmProtected"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A public function",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- }
- }
- },
- "tags": [
- {
- "title": "public",
- "description": null,
- "lineNumber": 2
- }
- ],
- "loc": {
- "start": {
- "line": 129,
- "column": 0
- },
- "end": {
- "line": 132,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 133,
- "column": 0
- },
- "end": {
- "line": 133,
- "column": 24
- }
- }
- },
- "errors": [],
- "access": "public",
- "name": "iAmPublic",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "iAmPublic",
- "kind": "function"
- }
- ],
- "namespace": "iAmPublic"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is re-exported",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 20,
- "offset": 19
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 20,
- "offset": 19
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 20,
- "offset": 19
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 141,
- "column": 0
- },
- "end": {
- "line": 143,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 144,
- "column": 0
- },
- "end": {
- "line": 144,
- "column": 42
- }
- }
- },
- "errors": [],
- "name": "execute",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "execute"
- }
- ],
- "namespace": "execute"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Regression check for #498",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 146,
- "column": 0
- },
- "end": {
- "line": 146,
- "column": 32
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 147,
- "column": 0
- },
- "end": {
- "line": 153,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "isArrayEqualWith",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "array1",
- "lineNumber": 148,
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "T"
- }
- ]
- }
- },
- {
- "title": "param",
- "name": "array2",
- "lineNumber": 149,
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "T"
- }
- ]
- }
- },
- {
- "title": "param",
- "name": "compareFunction",
- "default": "(a: T, b: T): boolean => a === b",
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "FunctionType",
- "params": [
- {
- "type": "ParameterType",
- "name": "a",
- "expression": {
- "type": "NameExpression",
- "name": "T"
- }
- },
- {
- "type": "ParameterType",
- "name": "b",
- "expression": {
- "type": "NameExpression",
- "name": "T"
- }
- }
- ],
- "result": {
- "type": "NameExpression",
- "name": "boolean"
- }
- }
- }
- }
- ],
- "returns": [
- {
- "type": {
- "type": "NameExpression",
- "name": "boolean"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "isArrayEqualWith",
- "kind": "function"
- }
- ],
- "namespace": "isArrayEqualWith"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json
deleted file mode 100644
index 512fd2610..000000000
--- a/test/fixture/es6.output.md.json
+++ /dev/null
@@ -1,2233 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "destructure"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 33,
- "offset": 88
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 33,
- "offset": 88
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "{}"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0.phoneNumbers"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "[]"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0.emailAddresses"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "[]"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0.params"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "..."
- },
- {
- "type": "text",
- "value": "any"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "destructure"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Similar, but with an array",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0.a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0.b"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0.c"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Examples"
- }
- ]
- },
- {
- "lang": "javascript",
- "type": "code",
- "value": "destructure([1, 2, 3])"
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "multiply"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "<"
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- },
- {
- "type": "text",
- "value": ">"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "an array of numbers",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 20,
- "offset": 19
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 20,
- "offset": 19
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "b"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Sink"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is a sink",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "staticProp"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is a property of the sink.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "empty"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Is it empty",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "aGetter"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is a getter method: it should be documented\nas a property.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 15,
- "offset": 63
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 15,
- "offset": 63
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "constructor"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "height"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the height of the thing",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "width"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the width of the thing",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "hello"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method says hello",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "makeABasket"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method returns a basket. The type should not be linked.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 61,
- "offset": 60
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 61,
- "offset": 60
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Basket"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "a basket",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "makeASink"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method returns a ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- },
- {
- "type": "link",
- "url": "#sink",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "sink"
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "end": {
- "line": 1,
- "column": 40,
- "offset": 39
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ". The type should be linked.\nIt takes a ",
- "position": {
- "start": {
- "line": 1,
- "column": 40,
- "offset": 39
- },
- "end": {
- "line": 2,
- "column": 12,
- "offset": 79
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "link",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ],
- "position": {
- "start": {
- "line": 2,
- "column": 12,
- "offset": 79
- },
- "end": {
- "line": 2,
- "column": 26,
- "offset": 93
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": " which should also be linked.",
- "position": {
- "start": {
- "line": 2,
- "column": 26,
- "offset": 93
- },
- "end": {
- "line": 2,
- "column": 55,
- "offset": 122
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 55,
- "offset": 122
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "#sink",
- "url": "#sink",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Sink"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "a sink",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 7,
- "offset": 6
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 7,
- "offset": 6
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "functionWithRest"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function takes rest params",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "someParams"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "..."
- },
- {
- "type": "text",
- "value": "any"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "functionWithRestAndType"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "So does this one, with types",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "someParams"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "..."
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is an async method",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "es6.input"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "veryImportantTransform"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This tests our support of optional parameters in ES6",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 53,
- "offset": 52
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 53,
- "offset": 52
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "foo"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "'bar'"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "iAmProtected"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A protected function",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "iAmPublic"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A public function",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "execute"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is re-exported",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 20,
- "offset": 19
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 20,
- "offset": 19
- },
- "indent": []
- }
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "isArrayEqualWith"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Regression check for #498",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "array1"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "<"
- },
- {
- "type": "text",
- "value": "T"
- },
- {
- "type": "text",
- "value": ">"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "array2"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "<"
- },
- {
- "type": "text",
- "value": "T"
- },
- {
- "type": "text",
- "value": ">"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "compareFunction"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "function ("
- },
- {
- "type": "text",
- "value": "a: "
- },
- {
- "type": "text",
- "value": "T"
- },
- {
- "type": "text",
- "value": ", "
- },
- {
- "type": "text",
- "value": "b: "
- },
- {
- "type": "text",
- "value": "T"
- },
- {
- "type": "text",
- "value": ")"
- },
- {
- "type": "text",
- "value": ": "
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "boolean"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "(a: T, b: T): boolean => a === b"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "boolean"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/event.output.json b/test/fixture/event.output.json
deleted file mode 100644
index 934cbf267..000000000
--- a/test/fixture/event.output.json
+++ /dev/null
@@ -1,250 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Mouse event",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- }
- }
- },
- "tags": [
- {
- "title": "event",
- "description": "Map#mousemove",
- "lineNumber": 3
- },
- {
- "title": "type",
- "description": null,
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "Object"
- }
- },
- {
- "title": "property",
- "description": "the pixel location of the event",
- "lineNumber": 5,
- "type": {
- "type": "NameExpression",
- "name": "Point"
- },
- "name": "point"
- },
- {
- "title": "property",
- "description": "the original DOM event",
- "lineNumber": 6,
- "type": {
- "type": "NameExpression",
- "name": "Event"
- },
- "name": "originalEvent"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 0
- }
- }
- },
- "errors": [],
- "kind": "event",
- "name": "Map#mousemove",
- "properties": [
- {
- "name": "point",
- "lineNumber": 5,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the pixel location of the event",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Point"
- }
- },
- {
- "name": "originalEvent",
- "lineNumber": 6,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the original DOM event",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Event"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Map#mousemove",
- "kind": "event"
- }
- ],
- "namespace": ".event:Map#mousemove"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/event.output.md b/test/fixture/event.output.md
deleted file mode 100644
index 7ef8b9ff9..000000000
--- a/test/fixture/event.output.md
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-# Map#mousemove
-
-Mouse event
-
-**Properties**
-
-- `point` **Point** the pixel location of the event
-- `originalEvent` **[Event](https://developer.mozilla.org/en-US/docs/Web/API/Event)** the original DOM event
diff --git a/test/fixture/event.output.md.json b/test/fixture/event.output.md.json
deleted file mode 100644
index f4902ed49..000000000
--- a/test/fixture/event.output.md.json
+++ /dev/null
@@ -1,208 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Map#mousemove"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Mouse event",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Properties"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "point"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Point"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the pixel location of the event",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "originalEvent"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/API/Event",
- "url": "https://developer.mozilla.org/en-US/docs/Web/API/Event",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Event"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the original DOM event",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/example-caption.output.json b/test/fixture/example-caption.output.json
deleted file mode 100644
index 1a9091b06..000000000
--- a/test/fixture/example-caption.output.json
+++ /dev/null
@@ -1,226 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- {
- "title": "example",
- "description": "foo(1);",
- "lineNumber": 3,
- "caption": "demonstrates how to run foo"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 1
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "examples": [
- {
- "description": "foo(1);",
- "caption": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "demonstrates how to run foo",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- }
- }
- }
- }
- ],
- "name": "foo",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "foo",
- "kind": "function"
- }
- ],
- "namespace": "foo"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/example-caption.output.md b/test/fixture/example-caption.output.md
deleted file mode 100644
index ca436eccd..000000000
--- a/test/fixture/example-caption.output.md
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-# foo
-
-This function returns the number one.
-
-**Examples**
-
-_demonstrates how to run foo_
-
-```javascript
-foo(1);
-```
-
-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
diff --git a/test/fixture/example-caption.output.md.json b/test/fixture/example-caption.output.md.json
deleted file mode 100644
index 454136a7e..000000000
--- a/test/fixture/example-caption.output.md.json
+++ /dev/null
@@ -1,189 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Examples"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "emphasis",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "demonstrates how to run foo",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- }
- }
- }
- ]
- },
- {
- "lang": "javascript",
- "type": "code",
- "value": "foo(1);"
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/external.output.json b/test/fixture/external.output.json
deleted file mode 100644
index 929a6a4c4..000000000
--- a/test/fixture/external.output.json
+++ /dev/null
@@ -1,127 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "I am in ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "external.input.js",
- "position": {
- "start": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ".",
- "position": {
- "start": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 13,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "foo",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "foo",
- "kind": "function"
- }
- ],
- "namespace": "foo"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/external.output.md b/test/fixture/external.output.md
deleted file mode 100644
index 44bc64403..000000000
--- a/test/fixture/external.output.md
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-# foo
-
-I am in `external.input.js`.
diff --git a/test/fixture/external.output.md.json b/test/fixture/external.output.md.json
deleted file mode 100644
index f7b9d2962..000000000
--- a/test/fixture/external.output.md.json
+++ /dev/null
@@ -1,88 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "I am in ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "external.input.js",
- "position": {
- "start": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ".",
- "position": {
- "start": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/factory.output.json b/test/fixture/factory.output.json
deleted file mode 100644
index 4b9d07561..000000000
--- a/test/fixture/factory.output.json
+++ /dev/null
@@ -1,331 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "an area chart generator",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "chart",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "area"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 21,
- "column": 2
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "chart",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 6,
- "offset": 5
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 6,
- "offset": 5
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 6,
- "offset": 5
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "area"
- }
- }
- ],
- "name": "area",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "area",
- "kind": "function"
- }
- ],
- "namespace": "area"
- },
- {
- "description": "",
- "tags": [
- {
- "title": "class",
- "description": null,
- "lineNumber": 1,
- "type": null,
- "name": "area"
- }
- ],
- "loc": {
- "start": {
- "line": 7,
- "column": 2
- },
- "end": {
- "line": 9,
- "column": 5
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 10,
- "column": 2
- },
- "end": {
- "line": 11,
- "column": 4
- }
- }
- },
- "errors": [],
- "kind": "class",
- "name": "area",
- "params": [
- {
- "title": "param",
- "name": "selection",
- "lineNumber": 10
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "area",
- "kind": "class"
- }
- ],
- "namespace": "area"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Sets the chart data.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- }
- }
- },
- "tags": [
- {
- "title": "function",
- "description": null,
- "lineNumber": 2,
- "name": null
- }
- ],
- "loc": {
- "start": {
- "line": 13,
- "column": 2
- },
- "end": {
- "line": 16,
- "column": 5
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 17,
- "column": 2
- },
- "end": {
- "line": 18,
- "column": 4
- }
- }
- },
- "errors": [
- {
- "message": "@memberof reference to chart not found",
- "commentLineNumber": 0
- }
- ],
- "kind": "function",
- "name": "data",
- "params": [
- {
- "title": "param",
- "name": "_",
- "lineNumber": 17
- }
- ],
- "memberof": "chart",
- "scope": "static",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "data",
- "kind": "function",
- "scope": "static"
- }
- ],
- "namespace": ".data"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/factory.output.md b/test/fixture/factory.output.md
deleted file mode 100644
index 8447aea0e..000000000
--- a/test/fixture/factory.output.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-# area
-
-an area chart generator
-
-Returns **[area](#area)** chart
-
-# area
-
-**Parameters**
-
-- `selection`
-
-# data
-
-Sets the chart data.
-
-**Parameters**
-
-- `_`
diff --git a/test/fixture/factory.output.md.json b/test/fixture/factory.output.md.json
deleted file mode 100644
index f0927c235..000000000
--- a/test/fixture/factory.output.md.json
+++ /dev/null
@@ -1,247 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "area"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "an area chart generator",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "#area",
- "url": "#area",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "area"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "chart",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 6,
- "offset": 5
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 6,
- "offset": 5
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "area"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "selection"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "data"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Sets the chart data.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "_"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/html/nested.config-output.html b/test/fixture/html/nested.config-output.html
deleted file mode 100644
index 470ecf382..000000000
--- a/test/fixture/html/nested.config-output.html
+++ /dev/null
@@ -1,1307 +0,0 @@
-
-
-
-
- | Documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Highlighted section
-
-
-
- The public key is a base64 encoded string of a protobuf containing an RSA DER
-buffer. This uses a node buffer to pass the base64 encoded public key protobuf
-to the multihash for ID generation.
-var PeerId = require ('peer-id' )
-
-PeerId.create({ bits : 1024 }, (err, id) => {
- console .log(JSON .stringify(id.toJSON(), null , 2 )
-})
-{
- "id": "Qma9T5YraSnpRDZqRR4krcSJabThc8nwZuJV3LercPHufi",
- "privKey": "CAAS4AQwggJcAgEAAoGBAMBgbIqyOL26oV3nGPBYrdpbv..",
- "pubKey": "CAASogEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMBgbIqyOL26oV3nGPBYrdpbvzCY..."
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Klass
-
-
-
-
-
-
- Creates a new Klass
-
-
- new Klass(foo: any)
-
-
-
- Extends
-
- Stream.Writable
-
-
-
-
-
-
-
-
-
-
-
- Parameters
-
-
-
-
-
-
-
-
-
-
-
-
- Static Members
-
-
-
-
-
-
▸
-
isClass(other, also)
-
-
-
-
-
-
-
- Decide whether an object is a Klass instance
-This is a [klasssic]Klass
-This is a [link to something that does not exist]DoesNot
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameters
-
-
-
-
-
-
-
- Returns
- boolean
:
- whether the other thing is a Klass
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A function that triggers the case where the autolinker doesn't find
-the referenced class type
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameters
-
-
-
-
- other (Weird)
-
-
-
-
-
-
-
-
-
-
-
-
- Returns
- boolean
:
- whether the other thing is a Klass
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
▸
-
isBuffer(buf, size = 0)
-
-
-
-
-
-
-
- This method takes a Buffer object that will be linked to nodejs.org
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameters
-
-
-
-
-
-
-
size (number ?
- = 0
)
- size
-
-
-
-
-
-
-
-
-
-
-
-
- Returns
- boolean
:
- whether the other thing is a Klass
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
▸
-
isArrayOfBuffers(buffers)
-
-
-
-
-
-
-
- This method takes an array of buffers and counts them
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameters
-
-
-
-
-
-
-
- Returns
- number
:
- how many
-
-
-
-
-
-
-
-
- Example
-
-
- var k = new Klass();
-k.isArrayOfBuffers();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A magic number that identifies this Klass.
-
-
- MAGIC_NUMBER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Klass event
-
-
- event
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Instance Members
-
-
-
-
-
-
-
-
-
- Get this Klass's foo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns
- Number
:
- foo
-
-
-
-
-
-
-
-
- Example
-
-
this shows you how to getFoo
-
- var x = foo.getFoo();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
▸
-
withOptions(options, otherOptions)
-
-
-
-
-
-
-
- A function with an options parameter
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameters
-
-
-
-
-
-
-
-
-
-
-
-
- Name
- Description
-
-
-
-
-
- options.foo string
-
-
-
-
-
- options.bar number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CustomError
-
-
-
-
-
-
- a typedef with nested properties
-
-
- CustomError
-
-
-
-
-
-
-
-
-
-
-
-
- Properties
-
-
-
-
error (object )
- : An error
-
-
-
-
- error.code
string
-
- The error's code
-
-
- error.description
string
-
- The error's description
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- bar
-
-
-
-
-
-
- Get an instance of Klass . Will make
-a klass instance multiword ,
-like a klass
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns
- Klass
:
- that class
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- bar
-
-
-
-
-
-
- Rest property function
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parameters
-
-
-
-
-
-
-
- Returns
- undefined
:
- nothing
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Foo
-
-
-
-
-
-
- This is Foo
-
-
- new Foo()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Instance Members
-
-
-
-
-
-
-
-
-
- This is bar
-
-
- bar
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- customStreams
-
-
-
-
-
-
- I am the container of stream types
-
-
- customStreams
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Static Members
-
-
-
-
-
-
▸
-
new passthrough()
-
-
-
-
-
-
-
- I am a passthrough stream that belongs to customStreams
-
-
- new passthrough()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/fixture/infer-params.output.json b/test/fixture/infer-params.output.json
deleted file mode 100644
index 1e241cdc1..000000000
--- a/test/fixture/infer-params.output.json
+++ /dev/null
@@ -1,341 +0,0 @@
-[
- {
- "description": "This function returns the number one.",
- "tags": [
- {
- "title": "param",
- "description": "the second param",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "b"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 1
- }
- },
- "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n"
- },
- "errors": [],
- "params": [
- {
- "title": "param",
- "name": "a",
- "lineNumber": 5
- },
- {
- "title": "param",
- "description": "the second param",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "b"
- },
- {
- "title": "param",
- "name": "c",
- "lineNumber": 5
- },
- {
- "title": "param",
- "name": "$3",
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "properties": [
- {
- "title": "param",
- "name": "$3.d",
- "lineNumber": 5
- },
- {
- "title": "param",
- "name": "$3.e",
- "lineNumber": 5
- },
- {
- "title": "param",
- "name": "$3.f",
- "lineNumber": 5
- }
- ]
- }
- ],
- "name": "addThem",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- "addThem"
- ]
- },
- {
- "description": "This method has partially inferred params",
- "tags": [
- {
- "title": "param",
- "description": "number of kinds of fish",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "String"
- },
- "name": "$0.fishes"
- }
- ],
- "loc": {
- "start": {
- "line": 9,
- "column": 0
- },
- "end": {
- "line": 12,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 13,
- "column": 0
- },
- "end": {
- "line": 15,
- "column": 1
- }
- },
- "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n"
- },
- "errors": [],
- "params": [
- {
- "title": "param",
- "name": "$0",
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "properties": [
- {
- "title": "param",
- "description": "number of kinds of fish",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "String"
- },
- "name": "$0.fishes"
- },
- {
- "title": "param",
- "name": "$0.foxes",
- "lineNumber": 13
- }
- ]
- }
- ],
- "name": "fishesAndFoxes",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- "fishesAndFoxes"
- ]
- },
- {
- "description": "This is foo's documentation",
- "tags": [],
- "loc": {
- "start": {
- "line": 25,
- "column": 0
- },
- "end": {
- "line": 27,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 28,
- "column": 0
- },
- "end": {
- "line": 35,
- "column": 1
- }
- },
- "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n"
- },
- "errors": [],
- "name": "Foo",
- "kind": "class",
- "members": {
- "instance": [
- {
- "description": "The method",
- "tags": [
- {
- "title": "param",
- "description": "Param to method",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "x"
- }
- ],
- "loc": {
- "start": {
- "line": 29,
- "column": 2
- },
- "end": {
- "line": 32,
- "column": 5
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 33,
- "column": 2
- },
- "end": {
- "line": 34,
- "column": 3
- }
- },
- "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n"
- },
- "errors": [],
- "params": [
- {
- "title": "param",
- "description": "Param to method",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "x"
- }
- ],
- "name": "method",
- "kind": "function",
- "memberof": "Foo",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- "Foo",
- "method"
- ]
- }
- ],
- "static": []
- },
- "path": [
- "Foo"
- ]
- },
- {
- "description": "This method has a type in the description and a default in the code",
- "tags": [
- {
- "title": "param",
- "description": null,
- "lineNumber": 2,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- },
- "default": "2"
- },
- "name": "x"
- }
- ],
- "loc": {
- "start": {
- "line": 17,
- "column": 0
- },
- "end": {
- "line": 20,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 21,
- "column": 0
- },
- "end": {
- "line": 23,
- "column": 1
- }
- },
- "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n"
- },
- "errors": [],
- "params": [
- {
- "title": "param",
- "description": null,
- "lineNumber": 2,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- },
- "default": "2"
- },
- "name": "x"
- }
- ],
- "name": "withDefault",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- "withDefault"
- ]
- }
-]
\ No newline at end of file
diff --git a/test/fixture/infer-params.output.md b/test/fixture/infer-params.output.md
deleted file mode 100644
index 6ae10e7ff..000000000
--- a/test/fixture/infer-params.output.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# addThem
-
-This function returns the number one.
-
-**Parameters**
-
-- `a`
-- `b` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the second param
-- `c`
-- `$3` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- - `$3.d`
- - `$3.e`
- - `$3.f`
-
-# fishesAndFoxes
-
-This method has partially inferred params
-
-**Parameters**
-
-- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- - `$0.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish
- - `$0.foxes`
-
-# Foo
-
-This is foo's documentation
-
-## method
-
-The method
-
-**Parameters**
-
-- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Param to method
-
-# withDefault
-
-This method has a type in the description and a default in the code
-
-**Parameters**
-
-- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)=(default 2)**
diff --git a/test/fixture/infer-params.output.md.json b/test/fixture/infer-params.output.md.json
deleted file mode 100644
index 1147857d1..000000000
--- a/test/fixture/infer-params.output.md.json
+++ /dev/null
@@ -1,737 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "addThem"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 38
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 38
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "b"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the second param",
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 17
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "c"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$3"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$3.d"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$3.e"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$3.f"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "fishesAndFoxes"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method has partially inferred params",
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 42
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 42
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0.fishes"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "String"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "number of kinds of fish",
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 24
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0.foxes"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Foo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is foo's documentation",
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 28
- },
- "indent": []
- }
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "method"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The method",
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 11
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Param to method",
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 16
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "withDefault"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method has a type in the description and a default in the code",
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 68
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 68
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "="
- },
- {
- "type": "text",
- "value": "(default 2)"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/infer-private.output.json b/test/fixture/infer-private.output.json
deleted file mode 100644
index 1b7a0a27b..000000000
--- a/test/fixture/infer-private.output.json
+++ /dev/null
@@ -1,193 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "C description",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 8,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 20
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 9,
- "column": 0
- },
- "end": {
- "line": 14,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "C",
- "kind": "class",
- "members": {
- "instance": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "m description",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 10,
- "column": 2
- },
- "end": {
- "line": 10,
- "column": 22
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 11,
- "column": 2
- },
- "end": {
- "line": 11,
- "column": 8
- }
- }
- },
- "errors": [],
- "name": "m",
- "kind": "function",
- "memberof": "C",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "C",
- "kind": "class"
- },
- {
- "name": "m",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "C#m"
- }
- ],
- "static": [],
- "events": []
- },
- "path": [
- {
- "name": "C",
- "kind": "class"
- }
- ],
- "namespace": "C"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/infer-private.output.md b/test/fixture/infer-private.output.md
deleted file mode 100644
index 7437d067b..000000000
--- a/test/fixture/infer-private.output.md
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-# C
-
-C description
-
-## m
-
-m description
diff --git a/test/fixture/infer-private.output.md.json b/test/fixture/infer-private.output.md.json
deleted file mode 100644
index 61222fd70..000000000
--- a/test/fixture/infer-private.output.md.json
+++ /dev/null
@@ -1,99 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "C"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "C description",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "m"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "m description",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/inheritance.output.json b/test/fixture/inheritance.output.json
deleted file mode 100644
index e39a63b91..000000000
--- a/test/fixture/inheritance.output.json
+++ /dev/null
@@ -1,161 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "With ES6, built-in types are extensible!",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 41,
- "offset": 40
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 41,
- "offset": 40
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 41,
- "offset": 40
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "SpecialArray",
- "augments": [
- {
- "title": "augments",
- "name": "Array"
- }
- ],
- "kind": "class",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "SpecialArray",
- "kind": "class"
- }
- ],
- "namespace": "SpecialArray"
- },
- {
- "description": "",
- "tags": [
- {
- "title": "class",
- "description": null,
- "lineNumber": 0,
- "type": null,
- "name": "Foo"
- }
- ],
- "loc": {
- "start": {
- "line": 9,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 17
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 43
- }
- }
- },
- "errors": [
- {
- "message": "@memberof reference to module not found",
- "commentLineNumber": 0
- }
- ],
- "kind": "class",
- "name": "Foo",
- "augments": [
- {
- "title": "augments",
- "name": "Bar"
- }
- ],
- "memberof": "module",
- "scope": "static",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Foo",
- "kind": "class",
- "scope": "static"
- }
- ],
- "namespace": ".Foo"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/inheritance.output.md b/test/fixture/inheritance.output.md
deleted file mode 100644
index ced286130..000000000
--- a/test/fixture/inheritance.output.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-# SpecialArray
-
-**Extends Array**
-
-With ES6, built-in types are extensible!
-
-# Foo
-
-**Extends Bar**
diff --git a/test/fixture/inheritance.output.md.json b/test/fixture/inheritance.output.md.json
deleted file mode 100644
index 14563e2e8..000000000
--- a/test/fixture/inheritance.output.md.json
+++ /dev/null
@@ -1,100 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "SpecialArray"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Extends "
- },
- {
- "type": "text",
- "value": "Array"
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "With ES6, built-in types are extensible!",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 41,
- "offset": 40
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 41,
- "offset": 40
- },
- "indent": []
- }
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Foo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Extends "
- },
- {
- "type": "text",
- "value": "Bar"
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/inline-link.output.json b/test/fixture/inline-link.output.json
deleted file mode 100644
index 4e5b54dce..000000000
--- a/test/fixture/inline-link.output.json
+++ /dev/null
@@ -1,647 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Adds one to a number",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "the input",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "a"
- },
- {
- "title": "returns",
- "description": "the output",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 6,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "a",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the input",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the output",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "addOne",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "addOne",
- "kind": "function"
- }
- ],
- "namespace": "addOne"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one. Internally, this uses\n",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 1,
- "offset": 60
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "link",
- "url": "addOne",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "addOne"
- }
- ],
- "position": {
- "start": {
- "line": 2,
- "column": 1,
- "offset": 60
- },
- "end": {
- "line": 2,
- "column": 15,
- "offset": 74
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": " to do the math. This demonstrates\n",
- "position": {
- "start": {
- "line": 2,
- "column": 15,
- "offset": 74
- },
- "end": {
- "line": 3,
- "column": 1,
- "offset": 109
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "link",
- "url": "https://en.wikipedia.org/wiki/Addition",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "Addition"
- }
- ],
- "position": {
- "start": {
- "line": 3,
- "column": 1,
- "offset": 109
- },
- "end": {
- "line": 3,
- "column": 56,
- "offset": 164
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": "\nand ",
- "position": {
- "start": {
- "line": 3,
- "column": 56,
- "offset": 164
- },
- "end": {
- "line": 4,
- "column": 5,
- "offset": 169
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "link",
- "url": "https://en.wikipedia.org/wiki/Addition",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "https://en.wikipedia.org/wiki/Addition"
- }
- ],
- "position": {
- "start": {
- "line": 4,
- "column": 5,
- "offset": 169
- },
- "end": {
- "line": 4,
- "column": 51,
- "offset": 215
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 4,
- "column": 51,
- "offset": 215
- },
- "indent": [
- 1,
- 1,
- 1
- ]
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This link refers to nothing: ",
- "position": {
- "start": {
- "line": 6,
- "column": 1,
- "offset": 217
- },
- "end": {
- "line": 6,
- "column": 30,
- "offset": 246
- },
- "indent": []
- }
- },
- {
- "type": "link",
- "url": "nothing",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "nothing"
- }
- ],
- "position": {
- "start": {
- "line": 6,
- "column": 30,
- "offset": 246
- },
- "end": {
- "line": 6,
- "column": 45,
- "offset": 261
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 6,
- "column": 1,
- "offset": 217
- },
- "end": {
- "line": 6,
- "column": 45,
- "offset": 261
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 6,
- "column": 45,
- "offset": 261
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "the input",
- "lineNumber": 8,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "a"
- },
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 9,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 20,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 21,
- "column": 0
- },
- "end": {
- "line": 23,
- "column": 2
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "a",
- "lineNumber": 8,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the input",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "inline-link.input",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "inline-link.input",
- "kind": "function"
- }
- ],
- "namespace": "inline-link.input"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/inline-link.output.md b/test/fixture/inline-link.output.md
deleted file mode 100644
index 0e6f105f1..000000000
--- a/test/fixture/inline-link.output.md
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-# addOne
-
-Adds one to a number
-
-**Parameters**
-
-- `a` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the input
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the output
-
-# inline-link.input
-
-This function returns the number one. Internally, this uses
-[addOne](#addone) to do the math. This demonstrates
-[Addition](https://en.wikipedia.org/wiki/Addition)
-and
-
-This link refers to nothing: [nothing](nothing)
-
-**Parameters**
-
-- `a` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the input
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
diff --git a/test/fixture/inline-link.output.md.json b/test/fixture/inline-link.output.md.json
deleted file mode 100644
index 22cf26b50..000000000
--- a/test/fixture/inline-link.output.md.json
+++ /dev/null
@@ -1,582 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "addOne"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Adds one to a number",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the input",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the output",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "inline-link.input"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one. Internally, this uses\n",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 1,
- "offset": 60
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "link",
- "url": "#addone",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "addOne"
- }
- ],
- "position": {
- "start": {
- "line": 2,
- "column": 1,
- "offset": 60
- },
- "end": {
- "line": 2,
- "column": 15,
- "offset": 74
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": " to do the math. This demonstrates\n",
- "position": {
- "start": {
- "line": 2,
- "column": 15,
- "offset": 74
- },
- "end": {
- "line": 3,
- "column": 1,
- "offset": 109
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "link",
- "url": "https://en.wikipedia.org/wiki/Addition",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "Addition"
- }
- ],
- "position": {
- "start": {
- "line": 3,
- "column": 1,
- "offset": 109
- },
- "end": {
- "line": 3,
- "column": 56,
- "offset": 164
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": "\nand ",
- "position": {
- "start": {
- "line": 3,
- "column": 56,
- "offset": 164
- },
- "end": {
- "line": 4,
- "column": 5,
- "offset": 169
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "link",
- "url": "https://en.wikipedia.org/wiki/Addition",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "https://en.wikipedia.org/wiki/Addition"
- }
- ],
- "position": {
- "start": {
- "line": 4,
- "column": 5,
- "offset": 169
- },
- "end": {
- "line": 4,
- "column": 51,
- "offset": 215
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 4,
- "column": 51,
- "offset": 215
- },
- "indent": [
- 1,
- 1,
- 1
- ]
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This link refers to nothing: ",
- "position": {
- "start": {
- "line": 6,
- "column": 1,
- "offset": 217
- },
- "end": {
- "line": 6,
- "column": 30,
- "offset": 246
- },
- "indent": []
- }
- },
- {
- "type": "link",
- "url": "nothing",
- "title": null,
- "jsdoc": true,
- "children": [
- {
- "type": "text",
- "value": "nothing"
- }
- ],
- "position": {
- "start": {
- "line": 6,
- "column": 30,
- "offset": 246
- },
- "end": {
- "line": 6,
- "column": 45,
- "offset": 261
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 6,
- "column": 1,
- "offset": 217
- },
- "end": {
- "line": 6,
- "column": 45,
- "offset": 261
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the input",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/internal.output.json b/test/fixture/internal.output.json
deleted file mode 100644
index 929a6a4c4..000000000
--- a/test/fixture/internal.output.json
+++ /dev/null
@@ -1,127 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "I am in ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "external.input.js",
- "position": {
- "start": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ".",
- "position": {
- "start": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 13,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "foo",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "foo",
- "kind": "function"
- }
- ],
- "namespace": "foo"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/internal.output.md b/test/fixture/internal.output.md
deleted file mode 100644
index 44bc64403..000000000
--- a/test/fixture/internal.output.md
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-# foo
-
-I am in `external.input.js`.
diff --git a/test/fixture/internal.output.md.json b/test/fixture/internal.output.md.json
deleted file mode 100644
index f7b9d2962..000000000
--- a/test/fixture/internal.output.md.json
+++ /dev/null
@@ -1,88 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "I am in ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "external.input.js",
- "position": {
- "start": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ".",
- "position": {
- "start": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/lint/lint.output.js b/test/fixture/lint/lint.output.js
deleted file mode 100644
index 4725962b4..000000000
--- a/test/fixture/lint/lint.output.js
+++ /dev/null
@@ -1,12 +0,0 @@
- 2:1 warning type String found, string is standard
- 3:1 warning type Number found, number is standard
- 4:1 warning type Number found, number is standard
- 5:1 warning type Number found, number is standard
- 6:1 warning type object found, Object is standard
- 7:1 warning type object found, Object is standard
- 8:1 warning @memberof reference to notfound not found
- 11:1 warning could not determine @name for hierarchy
- 12:1 warning type String found, string is standard
- 13:1 warning type String found, string is standard
-
-⚠ 11 warnings
diff --git a/test/fixture/literal_types.output.json b/test/fixture/literal_types.output.json
deleted file mode 100644
index 2aa36d096..000000000
--- a/test/fixture/literal_types.output.json
+++ /dev/null
@@ -1,189 +0,0 @@
-[
- {
- "description": "",
- "tags": [
- {
- "title": "param",
- "description": null,
- "lineNumber": 1,
- "type": {
- "type": "UnionType",
- "elements": [
- {
- "type": "StringLiteralType",
- "value": "a"
- },
- {
- "type": "StringLiteralType",
- "value": "b"
- },
- {
- "type": "StringLiteralType",
- "value": ""
- },
- {
- "type": "NumericLiteralType",
- "value": 0
- },
- {
- "type": "NumericLiteralType",
- "value": -42
- },
- {
- "type": "NumericLiteralType",
- "value": 3.14
- }
- ]
- },
- "name": "x"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 16
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "x",
- "lineNumber": 1,
- "type": {
- "type": "UnionType",
- "elements": [
- {
- "type": "StringLiteralType",
- "value": "a"
- },
- {
- "type": "StringLiteralType",
- "value": "b"
- },
- {
- "type": "StringLiteralType",
- "value": ""
- },
- {
- "type": "NumericLiteralType",
- "value": 0
- },
- {
- "type": "NumericLiteralType",
- "value": -42
- },
- {
- "type": "NumericLiteralType",
- "value": 3.14
- }
- ]
- }
- }
- ],
- "name": "f",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "f",
- "kind": "function"
- }
- ],
- "namespace": "f"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 6,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 6
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 49
- }
- }
- },
- "errors": [],
- "name": "g",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "x",
- "lineNumber": 7,
- "type": {
- "type": "UnionType",
- "elements": [
- {
- "type": "StringLiteralType",
- "value": "a"
- },
- {
- "type": "StringLiteralType",
- "value": "b"
- },
- {
- "type": "StringLiteralType",
- "value": ""
- },
- {
- "type": "NumericLiteralType",
- "value": 0
- },
- {
- "type": "NumericLiteralType",
- "value": -42
- },
- {
- "type": "NumericLiteralType",
- "value": 3.14
- }
- ]
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "g",
- "kind": "function"
- }
- ],
- "namespace": "g"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/literal_types.output.md b/test/fixture/literal_types.output.md
deleted file mode 100644
index 74753d495..000000000
--- a/test/fixture/literal_types.output.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-# f
-
-**Parameters**
-
-- `x` **(`"a"` \| `"b"` \| `""` \| `0` \| `-42` \| `3.14`)**
-
-# g
-
-**Parameters**
-
-- `x` **(`"a"` \| `"b"` \| `""` \| `0` \| `-42` \| `3.14`)**
diff --git a/test/fixture/literal_types.output.md.json b/test/fixture/literal_types.output.md.json
deleted file mode 100644
index 73c1d7f7d..000000000
--- a/test/fixture/literal_types.output.md.json
+++ /dev/null
@@ -1,217 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "f"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "("
- },
- {
- "type": "inlineCode",
- "value": "\"a\""
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "type": "inlineCode",
- "value": "\"b\""
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "type": "inlineCode",
- "value": "\"\""
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "type": "inlineCode",
- "value": "0"
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "type": "inlineCode",
- "value": "-42"
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "type": "inlineCode",
- "value": "3.14"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "g"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "("
- },
- {
- "type": "inlineCode",
- "value": "\"a\""
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "type": "inlineCode",
- "value": "\"b\""
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "type": "inlineCode",
- "value": "\"\""
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "type": "inlineCode",
- "value": "0"
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "type": "inlineCode",
- "value": "-42"
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "type": "inlineCode",
- "value": "3.14"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/memberedclass.output.json b/test/fixture/memberedclass.output.json
deleted file mode 100644
index 2a10d55f5..000000000
--- a/test/fixture/memberedclass.output.json
+++ /dev/null
@@ -1,521 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is my class, a demo thing.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- }
- }
- },
- "tags": [
- {
- "title": "class",
- "description": null,
- "lineNumber": 3,
- "type": null,
- "name": "MyClass"
- },
- {
- "title": "memberof",
- "description": "com.Test",
- "lineNumber": 4
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 29,
- "column": 2
- }
- }
- },
- "errors": [
- {
- "message": "@memberof reference to com.Test not found",
- "commentLineNumber": 4
- }
- ],
- "kind": "class",
- "name": "MyClass",
- "memberof": "com.Test",
- "members": {
- "instance": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Get the number 42",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "whether to get the number",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "boolean"
- },
- "name": "getIt"
- },
- {
- "title": "returns",
- "description": "forty-two",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 13,
- "column": 4
- },
- "end": {
- "line": 18,
- "column": 7
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 19,
- "column": 4
- },
- "end": {
- "line": 21,
- "column": 5
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "getIt",
- "lineNumber": 3,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "whether to get the number",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "boolean"
- }
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "forty-two",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "getFoo",
- "kind": "function",
- "memberof": "com.Test.MyClass",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "MyClass",
- "kind": "class"
- },
- {
- "name": "getFoo",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "MyClass#getFoo"
- }
- ],
- "static": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Get undefined",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "does not return anything.",
- "lineNumber": 3,
- "type": {
- "type": "UndefinedLiteral"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 23,
- "column": 4
- },
- "end": {
- "line": 27,
- "column": 7
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 28,
- "column": 4
- },
- "end": {
- "line": 28,
- "column": 28
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "does not return anything.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- }
- }
- },
- "type": {
- "type": "UndefinedLiteral"
- }
- }
- ],
- "name": "getUndefined",
- "kind": "function",
- "memberof": "com.Test.MyClass",
- "scope": "static",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "MyClass",
- "kind": "class"
- },
- {
- "name": "getUndefined",
- "kind": "function",
- "scope": "static"
- }
- ],
- "namespace": "MyClass.getUndefined"
- }
- ],
- "events": []
- },
- "path": [
- {
- "name": "MyClass",
- "kind": "class"
- }
- ],
- "namespace": "MyClass"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/memberedclass.output.md b/test/fixture/memberedclass.output.md
deleted file mode 100644
index 9eb73392d..000000000
--- a/test/fixture/memberedclass.output.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-# MyClass
-
-This is my class, a demo thing.
-
-## getFoo
-
-Get the number 42
-
-**Parameters**
-
-- `getIt` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to get the number
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two
-
-## getUndefined
-
-Get undefined
-
-Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything.
diff --git a/test/fixture/memberedclass.output.md.json b/test/fixture/memberedclass.output.md.json
deleted file mode 100644
index 418fc5ab1..000000000
--- a/test/fixture/memberedclass.output.md.json
+++ /dev/null
@@ -1,360 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "MyClass"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is my class, a demo thing.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "getFoo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Get the number 42",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 18,
- "offset": 17
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "getIt"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "boolean"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "whether to get the number",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "forty-two",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "getUndefined"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Get undefined",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 14,
- "offset": 13
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "undefined"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "does not return anything.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/merge-infered-type.output.json b/test/fixture/merge-infered-type.output.json
deleted file mode 100644
index 74112ac39..000000000
--- a/test/fixture/merge-infered-type.output.json
+++ /dev/null
@@ -1,263 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Add five to ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "x",
- "position": {
- "start": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "end": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ".",
- "position": {
- "start": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "The number to add five to.",
- "lineNumber": 3,
- "type": null,
- "name": "x"
- },
- {
- "title": "returns",
- "description": "x plus five.",
- "lineNumber": 4,
- "type": null
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "x",
- "lineNumber": 3,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The number to add five to.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "x plus five.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "addFive",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "addFive",
- "kind": "function"
- }
- ],
- "namespace": "addFive"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/merge-infered-type.output.md b/test/fixture/merge-infered-type.output.md
deleted file mode 100644
index c64aef0e9..000000000
--- a/test/fixture/merge-infered-type.output.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-# addFive
-
-Add five to `x`.
-
-**Parameters**
-
-- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The number to add five to.
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** x plus five.
diff --git a/test/fixture/merge-infered-type.output.md.json b/test/fixture/merge-infered-type.output.md.json
deleted file mode 100644
index 45d45042d..000000000
--- a/test/fixture/merge-infered-type.output.md.json
+++ /dev/null
@@ -1,240 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "addFive"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Add five to ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "x",
- "position": {
- "start": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "end": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ".",
- "position": {
- "start": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The number to add five to.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "x plus five.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/multisignature.output.json b/test/fixture/multisignature.output.json
deleted file mode 100644
index 677c1b968..000000000
--- a/test/fixture/multisignature.output.json
+++ /dev/null
@@ -1,401 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Get the time",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "the current date",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "Date"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 13,
- "column": 0
- },
- "end": {
- "line": 19,
- "column": 1
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the current date",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Date"
- }
- }
- ],
- "name": "getTheTime",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "time",
- "lineNumber": 13
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "getTheTime",
- "kind": "function"
- }
- ],
- "namespace": "getTheTime"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Set the time",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "the current time",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "Date"
- },
- "name": "time"
- },
- {
- "title": "returns",
- "description": "nothing",
- "lineNumber": 3,
- "type": {
- "type": "UndefinedLiteral"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 8,
- "column": 0
- },
- "end": {
- "line": 12,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 13,
- "column": 0
- },
- "end": {
- "line": 19,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "time",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the current time",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Date"
- }
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "nothing",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 8,
- "offset": 7
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 8,
- "offset": 7
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 8,
- "offset": 7
- }
- }
- },
- "type": {
- "type": "UndefinedLiteral"
- }
- }
- ],
- "name": "getTheTime",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "getTheTime",
- "kind": "function"
- }
- ],
- "namespace": "getTheTime"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/multisignature.output.md b/test/fixture/multisignature.output.md
deleted file mode 100644
index 35fdd1d86..000000000
--- a/test/fixture/multisignature.output.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-# getTheTime
-
-Get the time
-
-**Parameters**
-
-- `time`
-
-Returns **[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** the current date
-
-# getTheTime
-
-Set the time
-
-**Parameters**
-
-- `time` **[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** the current time
-
-Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** nothing
diff --git a/test/fixture/multisignature.output.md.json b/test/fixture/multisignature.output.md.json
deleted file mode 100644
index d3b1f7b4d..000000000
--- a/test/fixture/multisignature.output.md.json
+++ /dev/null
@@ -1,352 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "getTheTime"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Get the time",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "time"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Date"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the current date",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "getTheTime"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Set the time",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "time"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Date"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the current time",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "undefined"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "nothing",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 8,
- "offset": 7
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 8,
- "offset": 7
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/nearby_params.output.json b/test/fixture/nearby_params.output.json
deleted file mode 100644
index ccb5eb9f6..000000000
--- a/test/fixture/nearby_params.output.json
+++ /dev/null
@@ -1,515 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Attempt to establish a cookie-based session in exchange for credentials.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 73,
- "offset": 72
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 73,
- "offset": 72
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 73,
- "offset": 72
- }
- }
- },
- "tags": [
- {
- "title": "function",
- "description": null,
- "lineNumber": 1,
- "name": null
- },
- {
- "title": "name",
- "description": null,
- "lineNumber": 2,
- "name": "sessions.create"
- },
- {
- "title": "param",
- "description": null,
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "object"
- },
- "name": "credentials"
- },
- {
- "title": "param",
- "description": "Login username. Also accepted as `username` or `email`.",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "string"
- },
- "name": "credentials.name"
- },
- {
- "title": "param",
- "description": "Login password",
- "lineNumber": 5,
- "type": {
- "type": "NameExpression",
- "name": "string"
- },
- "name": "credentials.password"
- },
- {
- "title": "param",
- "description": "Gets passed `(err, { success:Boolean })`.",
- "lineNumber": 6,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "function"
- }
- },
- "name": "callback"
- },
- {
- "title": "returns",
- "description": "promise, to be resolved on success or rejected on failure",
- "lineNumber": 7,
- "type": {
- "type": "NameExpression",
- "name": "Promise"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 14,
- "column": 3
- }
- }
- },
- "errors": [],
- "kind": "function",
- "name": "sessions.create",
- "params": [
- {
- "name": "credentials",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "object"
- },
- "properties": [
- {
- "name": "credentials.name",
- "lineNumber": 4,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Login username. Also accepted as ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "username",
- "position": {
- "start": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "end": {
- "line": 1,
- "column": 44,
- "offset": 43
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": " or ",
- "position": {
- "start": {
- "line": 1,
- "column": 44,
- "offset": 43
- },
- "end": {
- "line": 1,
- "column": 48,
- "offset": 47
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "email",
- "position": {
- "start": {
- "line": 1,
- "column": 48,
- "offset": 47
- },
- "end": {
- "line": 1,
- "column": 55,
- "offset": 54
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ".",
- "position": {
- "start": {
- "line": 1,
- "column": 55,
- "offset": 54
- },
- "end": {
- "line": 1,
- "column": 56,
- "offset": 55
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 56,
- "offset": 55
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 56,
- "offset": 55
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- },
- {
- "name": "credentials.password",
- "lineNumber": 5,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Login password",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ]
- },
- {
- "name": "callback",
- "lineNumber": 6,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Gets passed ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "(err, { success:Boolean })",
- "position": {
- "start": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "end": {
- "line": 1,
- "column": 41,
- "offset": 40
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ".",
- "position": {
- "start": {
- "line": 1,
- "column": 41,
- "offset": 40
- },
- "end": {
- "line": 1,
- "column": 42,
- "offset": 41
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 42,
- "offset": 41
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 42,
- "offset": 41
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "function"
- }
- }
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "promise, to be resolved on success or rejected on failure",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 58,
- "offset": 57
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 58,
- "offset": 57
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 58,
- "offset": 57
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Promise"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "sessions.create",
- "kind": "function"
- }
- ],
- "namespace": "sessions.create"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/nearby_params.output.md b/test/fixture/nearby_params.output.md
deleted file mode 100644
index 46a8965a8..000000000
--- a/test/fixture/nearby_params.output.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-# sessions.create
-
-Attempt to establish a cookie-based session in exchange for credentials.
-
-**Parameters**
-
-- `credentials` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- - `credentials.name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Login username. Also accepted as `username` or `email`.
- - `credentials.password` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Login password
-- `callback` **[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)?** Gets passed `(err, { success:Boolean })`.
-
-Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** promise, to be resolved on success or rejected on failure
diff --git a/test/fixture/nearby_params.output.md.json b/test/fixture/nearby_params.output.md.json
deleted file mode 100644
index 42df8b139..000000000
--- a/test/fixture/nearby_params.output.md.json
+++ /dev/null
@@ -1,502 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "sessions.create"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Attempt to establish a cookie-based session in exchange for credentials.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 73,
- "offset": 72
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 73,
- "offset": 72
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "credentials"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "object"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "credentials.name"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Login username. Also accepted as ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "username",
- "position": {
- "start": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "end": {
- "line": 1,
- "column": 44,
- "offset": 43
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": " or ",
- "position": {
- "start": {
- "line": 1,
- "column": 44,
- "offset": 43
- },
- "end": {
- "line": 1,
- "column": 48,
- "offset": 47
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "email",
- "position": {
- "start": {
- "line": 1,
- "column": 48,
- "offset": 47
- },
- "end": {
- "line": 1,
- "column": 55,
- "offset": 54
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ".",
- "position": {
- "start": {
- "line": 1,
- "column": 55,
- "offset": 54
- },
- "end": {
- "line": 1,
- "column": 56,
- "offset": 55
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 56,
- "offset": 55
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "credentials.password"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Login password",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "callback"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "function"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Gets passed ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "(err, { success:Boolean })",
- "position": {
- "start": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "end": {
- "line": 1,
- "column": 41,
- "offset": 40
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": ".",
- "position": {
- "start": {
- "line": 1,
- "column": 41,
- "offset": 40
- },
- "end": {
- "line": 1,
- "column": 42,
- "offset": 41
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 42,
- "offset": 41
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Promise"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "promise, to be resolved on success or rejected on failure",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 58,
- "offset": 57
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 58,
- "offset": 57
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/nest_params.output.json b/test/fixture/nest_params.output.json
deleted file mode 100644
index 0fd39a47e..000000000
--- a/test/fixture/nest_params.output.json
+++ /dev/null
@@ -1,809 +0,0 @@
-[
- {
- "description": "",
- "tags": [
- {
- "title": "param",
- "description": "The employees who are responsible for the project.",
- "lineNumber": 1,
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "Object"
- }
- ]
- },
- "name": "employees"
- },
- {
- "title": "param",
- "description": "The name of an employee.",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "string"
- },
- "name": "employees[].name"
- },
- {
- "title": "param",
- "description": "The employee's department.",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "string"
- },
- "name": "employees[].department"
- },
- {
- "title": "param",
- "description": "The employee's type.",
- "lineNumber": 4,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "string"
- }
- },
- "name": "type",
- "default": "minion"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "employees",
- "lineNumber": 1,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The employees who are responsible for the project.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 51,
- "offset": 50
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 51,
- "offset": 50
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 51,
- "offset": 50
- }
- }
- },
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "Object"
- }
- ]
- },
- "properties": [
- {
- "name": "employees[].name",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The name of an employee.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- },
- {
- "name": "employees[].department",
- "lineNumber": 3,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The employee's department.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ]
- },
- {
- "name": "type",
- "lineNumber": 4,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The employee's type.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "string"
- }
- },
- "default": "minion"
- }
- ],
- "name": "foo",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "foo",
- "kind": "function"
- }
- ],
- "namespace": "foo"
- },
- {
- "description": "",
- "tags": [
- {
- "title": "name",
- "description": null,
- "lineNumber": 1,
- "name": "foo"
- },
- {
- "title": "param",
- "description": "some options",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "name": "options"
- },
- {
- "title": "param",
- "description": "how much",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "options.much"
- },
- {
- "title": "param",
- "description": "something else",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "bar"
- },
- {
- "title": "property",
- "description": "the current time",
- "lineNumber": 5,
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "name": "theTime"
- },
- {
- "title": "property",
- "description": null,
- "lineNumber": 6,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "theTime.hours"
- },
- {
- "title": "property",
- "description": null,
- "lineNumber": 7,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "theTime.minutes"
- },
- {
- "title": "property",
- "description": null,
- "lineNumber": 8,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "theTime.seconds"
- },
- {
- "title": "returns",
- "description": "foo something else",
- "lineNumber": 9,
- "type": {
- "type": "NameExpression",
- "name": "Object"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 20,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "foo",
- "params": [
- {
- "name": "options",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "some options",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "properties": [
- {
- "name": "options.much",
- "lineNumber": 3,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "how much",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ]
- },
- {
- "name": "bar",
- "lineNumber": 4,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "something else",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "properties": [
- {
- "name": "theTime",
- "lineNumber": 5,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the current time",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "properties": [
- {
- "name": "theTime.hours",
- "lineNumber": 6,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "name": "theTime.minutes",
- "lineNumber": 7,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "name": "theTime.seconds",
- "lineNumber": 8,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ]
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "foo something else",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Object"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "foo"
- }
- ],
- "namespace": "foo"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/nest_params.output.md b/test/fixture/nest_params.output.md
deleted file mode 100644
index e0e27edc6..000000000
--- a/test/fixture/nest_params.output.md
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-# foo
-
-**Parameters**
-
-- `employees` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** The employees who are responsible for the project.
- - `employees[].name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of an employee.
- - `employees[].department` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The employee's department.
-- `type` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The employee's type. (optional, default `minion`)
-
-# foo
-
-**Parameters**
-
-- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** some options
- - `options.much` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how much
-- `bar` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** something else
-
-**Properties**
-
-- `theTime` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the current time
- - `theTime.hours` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
- - `theTime.minutes` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
- - `theTime.seconds` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-
-Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** foo something else
diff --git a/test/fixture/nest_params.output.md.json b/test/fixture/nest_params.output.md.json
deleted file mode 100644
index 43901c6ce..000000000
--- a/test/fixture/nest_params.output.md.json
+++ /dev/null
@@ -1,894 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "employees"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "<"
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- },
- {
- "type": "text",
- "value": ">"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The employees who are responsible for the project.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 51,
- "offset": 50
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 51,
- "offset": 50
- },
- "indent": []
- }
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "employees[].name"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The name of an employee.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "employees[].department"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The employee's department.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "type"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The employee's type.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "minion"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "some options",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.much"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "how much",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 9,
- "offset": 8
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "bar"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "something else",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Properties"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "theTime"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the current time",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "theTime.hours"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "theTime.minutes"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "theTime.seconds"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "foo something else",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/newline-in-description.output.json b/test/fixture/newline-in-description.output.json
deleted file mode 100644
index 72872085c..000000000
--- a/test/fixture/newline-in-description.output.json
+++ /dev/null
@@ -1,171 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A function.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "The input to the function.\nI should be able to continue the description on a new line, and have it\nstill work in the markdown table.",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- },
- "name": "a"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 0
- }
- }
- },
- "errors": [
- {
- "message": "could not determine @name for hierarchy"
- }
- ],
- "params": [
- {
- "name": "a",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The input to the function.\nI should be able to continue the description on a new line, and have it\nstill work in the markdown table.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 3,
- "column": 34,
- "offset": 132
- },
- "indent": [
- 1,
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 3,
- "column": 34,
- "offset": 132
- },
- "indent": [
- 1,
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 3,
- "column": 34,
- "offset": 132
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {}
- ],
- "namespace": "undefined"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/newline-in-description.output.md b/test/fixture/newline-in-description.output.md
deleted file mode 100644
index 21fab0d89..000000000
--- a/test/fixture/newline-in-description.output.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-#
-
-A function.
-
-**Parameters**
-
-- `a` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The input to the function.
- I should be able to continue the description on a new line, and have it
- still work in the markdown table.
diff --git a/test/fixture/newline-in-description.output.md.json b/test/fixture/newline-in-description.output.md.json
deleted file mode 100644
index 4489a6504..000000000
--- a/test/fixture/newline-in-description.output.md.json
+++ /dev/null
@@ -1,148 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": ""
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A function.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The input to the function.\nI should be able to continue the description on a new line, and have it\nstill work in the markdown table.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 3,
- "column": 34,
- "offset": 132
- },
- "indent": [
- 1,
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 3,
- "column": 34,
- "offset": 132
- },
- "indent": [
- 1,
- 1
- ]
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/no-name.output.json b/test/fixture/no-name.output.json
deleted file mode 100644
index 88452f663..000000000
--- a/test/fixture/no-name.output.json
+++ /dev/null
@@ -1,113 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Set the time",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": null,
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "bar"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 0
- }
- }
- },
- "errors": [
- {
- "message": "could not determine @name for hierarchy"
- }
- ],
- "params": [
- {
- "name": "bar",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {}
- ],
- "namespace": "undefined"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/no-name.output.md b/test/fixture/no-name.output.md
deleted file mode 100644
index b210b1461..000000000
--- a/test/fixture/no-name.output.md
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-#
-
-Set the time
-
-**Parameters**
-
-- `bar` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
diff --git a/test/fixture/no-name.output.md.json b/test/fixture/no-name.output.md.json
deleted file mode 100644
index 7bd427cde..000000000
--- a/test/fixture/no-name.output.md.json
+++ /dev/null
@@ -1,107 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": ""
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Set the time",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "bar"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/optional-record-field-type.output.json b/test/fixture/optional-record-field-type.output.json
deleted file mode 100644
index 7f75271c2..000000000
--- a/test/fixture/optional-record-field-type.output.json
+++ /dev/null
@@ -1,89 +0,0 @@
-[
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 1,
- "column": 6
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 2,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 2
- }
- }
- },
- "errors": [],
- "name": "Record",
- "kind": "typedef",
- "properties": [
- {
- "title": "property",
- "name": "opt",
- "lineNumber": 3,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- },
- {
- "title": "property",
- "name": "req",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ],
- "type": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "opt",
- "value": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- },
- {
- "type": "FieldType",
- "key": "req",
- "value": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ]
- },
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Record",
- "kind": "typedef"
- }
- ],
- "namespace": "Record"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/optional-record-field-type.output.md b/test/fixture/optional-record-field-type.output.md
deleted file mode 100644
index 8cfccccb5..000000000
--- a/test/fixture/optional-record-field-type.output.md
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-# Record
-
-**Properties**
-
-- `opt` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?**
-- `req` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
diff --git a/test/fixture/optional-record-field-type.output.md.json b/test/fixture/optional-record-field-type.output.md.json
deleted file mode 100644
index 20a89a866..000000000
--- a/test/fixture/optional-record-field-type.output.md.json
+++ /dev/null
@@ -1,114 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Record"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Properties"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "opt"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "req"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/params.output.json b/test/fixture/params.output.json
deleted file mode 100644
index 8bf7d42f1..000000000
--- a/test/fixture/params.output.json
+++ /dev/null
@@ -1,2148 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "the second param",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "b"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "b",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the second param",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "title": "param",
- "name": "a",
- "lineNumber": 5
- },
- {
- "title": "param",
- "name": "c",
- "lineNumber": 5
- },
- {
- "title": "param",
- "name": "$3",
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "properties": [
- {
- "title": "param",
- "name": "$3.d",
- "lineNumber": 5
- },
- {
- "title": "param",
- "name": "$3.e",
- "lineNumber": 5
- },
- {
- "title": "param",
- "name": "$3.f",
- "lineNumber": 5
- }
- ]
- }
- ],
- "name": "addThem",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "addThem",
- "kind": "function"
- }
- ],
- "namespace": "addThem"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method has partially inferred params",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 42,
- "offset": 41
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 42,
- "offset": 41
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 42,
- "offset": 41
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "number of kinds of fish",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "String"
- },
- "name": "$0.fishes"
- }
- ],
- "loc": {
- "start": {
- "line": 9,
- "column": 0
- },
- "end": {
- "line": 12,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 13,
- "column": 0
- },
- "end": {
- "line": 15,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "title": "param",
- "name": "$0",
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "properties": [
- {
- "name": "$0.fishes",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "number of kinds of fish",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "String"
- }
- },
- {
- "title": "param",
- "name": "$0.foxes",
- "lineNumber": 13
- }
- ]
- }
- ],
- "name": "fishesAndFoxes",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "fishesAndFoxes",
- "kind": "function"
- }
- ],
- "namespace": "fishesAndFoxes"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method has a type in the description and a default in the code",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 68,
- "offset": 67
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 68,
- "offset": 67
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 68,
- "offset": 67
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": null,
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "x"
- }
- ],
- "loc": {
- "start": {
- "line": 17,
- "column": 0
- },
- "end": {
- "line": 20,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 21,
- "column": 0
- },
- "end": {
- "line": 23,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "x",
- "lineNumber": 2,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- },
- "default": "2"
- }
- }
- ],
- "name": "withDefault",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "withDefault",
- "kind": "function"
- }
- ],
- "namespace": "withDefault"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is foo's documentation",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 25,
- "column": 0
- },
- "end": {
- "line": 27,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 28,
- "column": 0
- },
- "end": {
- "line": 35,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "Foo",
- "kind": "class",
- "members": {
- "instance": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The method",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "Param to method",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "x"
- }
- ],
- "loc": {
- "start": {
- "line": 29,
- "column": 2
- },
- "end": {
- "line": 32,
- "column": 5
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 33,
- "column": 2
- },
- "end": {
- "line": 34,
- "column": 3
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "x",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Param to method",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 16,
- "offset": 15
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "method",
- "kind": "function",
- "memberof": "Foo",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Foo",
- "kind": "class"
- },
- {
- "name": "method",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "Foo#method"
- }
- ],
- "static": [],
- "events": []
- },
- "path": [
- {
- "name": "Foo",
- "kind": "class"
- }
- ],
- "namespace": "Foo"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Represents an IPv6 address",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This tests our support of optional parameters",
- "position": {
- "start": {
- "line": 3,
- "column": 1,
- "offset": 28
- },
- "end": {
- "line": 3,
- "column": 47,
- "offset": 74
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 3,
- "column": 1,
- "offset": 28
- },
- "end": {
- "line": 3,
- "column": 47,
- "offset": 74
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 3,
- "column": 47,
- "offset": 74
- }
- }
- },
- "tags": [
- {
- "title": "class",
- "description": null,
- "lineNumber": 4,
- "type": null,
- "name": "Address6"
- },
- {
- "title": "param",
- "description": "An IPv6 address string",
- "lineNumber": 5,
- "type": {
- "type": "NameExpression",
- "name": "string"
- },
- "name": "address"
- },
- {
- "title": "param",
- "description": "How many octets to parse",
- "lineNumber": 6,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- "name": "groups",
- "default": "8"
- },
- {
- "title": "param",
- "description": "A third argument",
- "lineNumber": 7,
- "type": {
- "type": "NullableType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- },
- "prefix": true
- },
- "name": "third"
- },
- {
- "title": "param",
- "description": "to properly be parsed",
- "lineNumber": 8,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- }
- },
- "name": "foo",
- "default": "[1]"
- },
- {
- "title": "example",
- "description": "var address = new Address6('2001::/32');",
- "lineNumber": 9
- }
- ],
- "loc": {
- "start": {
- "line": 37,
- "column": 0
- },
- "end": {
- "line": 48,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 49,
- "column": 0
- },
- "end": {
- "line": 49,
- "column": 22
- }
- }
- },
- "errors": [],
- "kind": "class",
- "name": "Address6",
- "params": [
- {
- "name": "address",
- "lineNumber": 5,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "An IPv6 address string",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- },
- {
- "name": "groups",
- "lineNumber": 6,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "How many octets to parse",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- "default": "8"
- },
- {
- "name": "third",
- "lineNumber": 7,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A third argument",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- }
- }
- },
- "type": {
- "type": "NullableType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- },
- "prefix": true
- }
- },
- {
- "name": "foo",
- "lineNumber": 8,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "to properly be parsed",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 22,
- "offset": 21
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 22,
- "offset": 21
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 22,
- "offset": 21
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- }
- },
- "default": "[1]"
- }
- ],
- "examples": [
- {
- "description": "var address = new Address6('2001::/32');"
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Address6",
- "kind": "class"
- }
- ],
- "namespace": "Address6"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Create a GeoJSON data source instance given an options object",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 62,
- "offset": 61
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 62,
- "offset": 61
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This tests our support of nested parameters",
- "position": {
- "start": {
- "line": 3,
- "column": 1,
- "offset": 63
- },
- "end": {
- "line": 3,
- "column": 44,
- "offset": 106
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 3,
- "column": 1,
- "offset": 63
- },
- "end": {
- "line": 3,
- "column": 44,
- "offset": 106
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 3,
- "column": 44,
- "offset": 106
- }
- }
- },
- "tags": [
- {
- "title": "class",
- "description": null,
- "lineNumber": 4,
- "type": null,
- "name": "GeoJSONSource"
- },
- {
- "title": "param",
- "description": "optional options",
- "lineNumber": 5,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Object"
- }
- },
- "name": "options"
- },
- {
- "title": "param",
- "description": "A GeoJSON data object or URL to it.\nThe latter is preferable in case of large GeoJSON files.",
- "lineNumber": 6,
- "type": {
- "type": "UnionType",
- "elements": [
- {
- "type": "NameExpression",
- "name": "Object"
- },
- {
- "type": "NameExpression",
- "name": "string"
- }
- ]
- },
- "name": "options.data"
- },
- {
- "title": "param",
- "description": "Maximum zoom to preserve detail at.",
- "lineNumber": 8,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- "name": "options.maxzoom",
- "default": "14"
- },
- {
- "title": "param",
- "description": "Tile buffer on each side.",
- "lineNumber": 9,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- "name": "options.buffer"
- },
- {
- "title": "param",
- "description": "Simplification tolerance (higher means simpler).",
- "lineNumber": 10,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- "name": "options.tolerance"
- }
- ],
- "loc": {
- "start": {
- "line": 51,
- "column": 0
- },
- "end": {
- "line": 62,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 63,
- "column": 0
- },
- "end": {
- "line": 65,
- "column": 1
- }
- }
- },
- "errors": [],
- "kind": "class",
- "name": "GeoJSONSource",
- "params": [
- {
- "name": "options",
- "lineNumber": 5,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "optional options",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Object"
- }
- },
- "properties": [
- {
- "name": "options.data",
- "lineNumber": 6,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A GeoJSON data object or URL to it.\nThe latter is preferable in case of large GeoJSON files.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 57,
- "offset": 92
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 57,
- "offset": 92
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 57,
- "offset": 92
- }
- }
- },
- "type": {
- "type": "UnionType",
- "elements": [
- {
- "type": "NameExpression",
- "name": "Object"
- },
- {
- "type": "NameExpression",
- "name": "string"
- }
- ]
- }
- },
- {
- "name": "options.maxzoom",
- "lineNumber": 8,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Maximum zoom to preserve detail at.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 36,
- "offset": 35
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 36,
- "offset": 35
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 36,
- "offset": 35
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- "default": "14"
- },
- {
- "name": "options.buffer",
- "lineNumber": 9,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Tile buffer on each side.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- },
- {
- "name": "options.tolerance",
- "lineNumber": 10,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Simplification tolerance (higher means simpler).",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 49,
- "offset": 48
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 49,
- "offset": 48
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 49,
- "offset": 48
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- }
- ]
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "GeoJSONSource",
- "kind": "class"
- }
- ],
- "namespace": "GeoJSONSource"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This tests our support for parameters with explicit types but with default\nvalues specified in code.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 26,
- "offset": 100
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 26,
- "offset": 100
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 26,
- "offset": 100
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "an argument",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "x"
- },
- {
- "title": "returns",
- "description": "some",
- "lineNumber": 6,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 67,
- "column": 0
- },
- "end": {
- "line": 74,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 75,
- "column": 0
- },
- "end": {
- "line": 75,
- "column": 37
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "x",
- "lineNumber": 4,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "an argument",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- },
- "default": "123"
- }
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "some",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 5,
- "offset": 4
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 5,
- "offset": 4
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 5,
- "offset": 4
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "myfunc",
- "kind": "constant",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "myfunc",
- "kind": "constant"
- }
- ],
- "namespace": "myfunc"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This tests our support of JSDoc param tags without type information,\nor any type information we could infer from annotations.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 57,
- "offset": 125
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 57,
- "offset": 125
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 57,
- "offset": 125
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "An IPv6 address string",
- "lineNumber": 4,
- "type": null,
- "name": "address"
- }
- ],
- "loc": {
- "start": {
- "line": 77,
- "column": 0
- },
- "end": {
- "line": 82,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 83,
- "column": 0
- },
- "end": {
- "line": 85,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "address",
- "lineNumber": 4,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "An IPv6 address string",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- }
- }
- }
- }
- ],
- "name": "foo",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "foo",
- "kind": "function"
- }
- ],
- "namespace": "foo"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/params.output.md b/test/fixture/params.output.md
deleted file mode 100644
index 384ca453c..000000000
--- a/test/fixture/params.output.md
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-# addThem
-
-This function returns the number one.
-
-**Parameters**
-
-- `b` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the second param
-- `a`
-- `c`
-- `$3` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- - `$3.d`
- - `$3.e`
- - `$3.f`
-
-# fishesAndFoxes
-
-This method has partially inferred params
-
-**Parameters**
-
-- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- - `$0.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish
- - `$0.foxes`
-
-# withDefault
-
-This method has a type in the description and a default in the code
-
-**Parameters**
-
-- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?= 2**
-
-# Foo
-
-This is foo's documentation
-
-## method
-
-The method
-
-**Parameters**
-
-- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Param to method
-
-# Address6
-
-Represents an IPv6 address
-
-This tests our support of optional parameters
-
-**Parameters**
-
-- `address` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** An IPv6 address string
-- `groups` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** How many octets to parse (optional, default `8`)
-- `third` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** A third argument
-- `foo` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** to properly be parsed (optional, default `[1]`)
-
-**Examples**
-
-```javascript
-var address = new Address6('2001::/32');
-```
-
-# GeoJSONSource
-
-Create a GeoJSON data source instance given an options object
-
-This tests our support of nested parameters
-
-**Parameters**
-
-- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** optional options
- - `options.data` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** A GeoJSON data object or URL to it.
- The latter is preferable in case of large GeoJSON files.
- - `options.maxzoom` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Maximum zoom to preserve detail at. (optional, default `14`)
- - `options.buffer` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Tile buffer on each side.
- - `options.tolerance` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Simplification tolerance (higher means simpler).
-
-# myfunc
-
-This tests our support for parameters with explicit types but with default
-values specified in code.
-
-**Parameters**
-
-- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?= 123** an argument
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** some
-
-# foo
-
-This tests our support of JSDoc param tags without type information,
-or any type information we could infer from annotations.
-
-**Parameters**
-
-- `address` An IPv6 address string
diff --git a/test/fixture/params.output.md.json b/test/fixture/params.output.md.json
deleted file mode 100644
index be4bc42a4..000000000
--- a/test/fixture/params.output.md.json
+++ /dev/null
@@ -1,2082 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "addThem"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "b"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the second param",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "c"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$3"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$3.d"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$3.e"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$3.f"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "fishesAndFoxes"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method has partially inferred params",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 42,
- "offset": 41
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 42,
- "offset": 41
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0.fishes"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "String"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "number of kinds of fish",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 24,
- "offset": 23
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "$0.foxes"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "withDefault"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This method has a type in the description and a default in the code",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 68,
- "offset": 67
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 68,
- "offset": 67
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- },
- {
- "type": "text",
- "value": "= 2"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Foo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is foo's documentation",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "method"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The method",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Param to method",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Address6"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Represents an IPv6 address",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This tests our support of optional parameters",
- "position": {
- "start": {
- "line": 3,
- "column": 1,
- "offset": 28
- },
- "end": {
- "line": 3,
- "column": 47,
- "offset": 74
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 3,
- "column": 1,
- "offset": 28
- },
- "end": {
- "line": 3,
- "column": 47,
- "offset": 74
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "address"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "An IPv6 address string",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "groups"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "How many octets to parse",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "8"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "third"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A third argument",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "foo"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "to properly be parsed",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 22,
- "offset": 21
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 22,
- "offset": 21
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "[1]"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Examples"
- }
- ]
- },
- {
- "lang": "javascript",
- "type": "code",
- "value": "var address = new Address6('2001::/32');"
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "GeoJSONSource"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Create a GeoJSON data source instance given an options object",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 62,
- "offset": 61
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 62,
- "offset": 61
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This tests our support of nested parameters",
- "position": {
- "start": {
- "line": 3,
- "column": 1,
- "offset": 63
- },
- "end": {
- "line": 3,
- "column": 44,
- "offset": 106
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 3,
- "column": 1,
- "offset": 63
- },
- "end": {
- "line": 3,
- "column": 44,
- "offset": 106
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "optional options",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.data"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "("
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- },
- {
- "type": "text",
- "value": " | "
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A GeoJSON data object or URL to it.\nThe latter is preferable in case of large GeoJSON files.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 57,
- "offset": 92
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 57,
- "offset": 92
- },
- "indent": [
- 1
- ]
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.maxzoom"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Maximum zoom to preserve detail at.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 36,
- "offset": 35
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 36,
- "offset": 35
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "14"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.buffer"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Tile buffer on each side.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 26,
- "offset": 25
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.tolerance"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Simplification tolerance (higher means simpler).",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 49,
- "offset": 48
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 49,
- "offset": 48
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "myfunc"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This tests our support for parameters with explicit types but with default\nvalues specified in code.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 26,
- "offset": 100
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 26,
- "offset": 100
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- },
- {
- "type": "text",
- "value": "= 123"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "an argument",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "some",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 5,
- "offset": 4
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 5,
- "offset": 4
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This tests our support of JSDoc param tags without type information,\nor any type information we could infer from annotations.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 57,
- "offset": 125
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 57,
- "offset": 125
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "address"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "An IPv6 address string",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/polyglot/blend.cpp b/test/fixture/polyglot/blend.cpp
deleted file mode 100644
index a285feb9c..000000000
--- a/test/fixture/polyglot/blend.cpp
+++ /dev/null
@@ -1,675 +0,0 @@
-#include
-#include
-#include
-
-#include "zlib.h"
-
-#if defined(HAVE_PNG)
-#include
-#endif
-
-#if defined(HAVE_JPEG)
-#define XMD_H
-#include
-#undef XMD_H
-#endif
-
-#if defined(HAVE_WEBP)
-#include
-#endif
-
-#include "mapnik_palette.hpp"
-#include "blend.hpp"
-#include "tint.hpp"
-
-#include
-#include
-#include
-#include
-
-using namespace v8;
-using namespace node;
-
-namespace node_mapnik {
-
-/**
- * This method moves a hex to a color
- * @name hexToUInt32Color
- * @param {string} hex
- * @returns {number} color
- */
-static bool hexToUInt32Color(char *hex, unsigned int & value) {
- if (!hex) return false;
- int len_original = strlen(hex);
- // Return is the length of the string is less then six
- // otherwise the line after this could go to some other
- // pointer in memory, resulting in strange behaviours.
- if (len_original < 6) return false;
- if (hex[0] == '#') hex++;
- int len = strlen(hex);
- if (len != 6 && len != 8) return false;
-
- unsigned int color = 0;
- std::stringstream ss;
- ss << std::hex << hex;
- ss >> color;
-
- if (len == 8) {
- // Circular shift to get from RGBA to ARGB.
- value = (color << 24) | ((color & 0xFF00) << 8) | ((color & 0xFF0000) >> 8) | ((color & 0xFF000000) >> 24);
- return true;
- } else {
- value = 0xFF000000 | ((color & 0xFF) << 16) | (color & 0xFF00) | ((color & 0xFF0000) >> 16);
- return true;
- }
-}
-
-NAN_METHOD(rgb2hsl) {
- NanScope();
- if (args.Length() != 3) {
- NanThrowTypeError("Please pass r,g,b integer values as three arguments");
- NanReturnUndefined();
- }
- if (!args[0]->IsNumber() || !args[1]->IsNumber() || !args[2]->IsNumber()) {
- NanThrowTypeError("Please pass r,g,b integer values as three arguments");
- NanReturnUndefined();
- }
- unsigned r,g,b;
- r = args[0]->IntegerValue();
- g = args[1]->IntegerValue();
- b = args[2]->IntegerValue();
- Local hsl = NanNew(3);
- double h,s,l;
- rgb_to_hsl(r,g,b,h,s,l);
- hsl->Set(0,NanNew(h));
- hsl->Set(1,NanNew(s));
- hsl->Set(2,NanNew(l));
- NanReturnValue(hsl);
-}
-
-NAN_METHOD(hsl2rgb) {
- NanScope();
- if (args.Length() != 3) {
- NanThrowTypeError("Please pass hsl fractional values as three arguments");
- NanReturnUndefined();
- }
- if (!args[0]->IsNumber() || !args[1]->IsNumber() || !args[2]->IsNumber()) {
- NanThrowTypeError("Please pass hsl fractional values as three arguments");
- NanReturnUndefined();
- }
- double h,s,l;
- h = args[0]->NumberValue();
- s = args[1]->NumberValue();
- l = args[2]->NumberValue();
- Local rgb = NanNew(3);
- unsigned r,g,b;
- hsl_to_rgb(h,s,l,r,g,b);
- rgb->Set(0,NanNew(r));
- rgb->Set(1,NanNew(g));
- rgb->Set(2,NanNew(b));
- NanReturnValue(rgb);
-}
-
-static void parseTintOps(Local const& tint, Tinter & tinter, std::string & msg) {
- NanScope();
- Local hue = tint->Get(NanNew("h"));
- if (!hue.IsEmpty() && hue->IsArray()) {
- Local val_array = Local::Cast(hue);
- if (val_array->Length() != 2) {
- msg = "h array must be a pair of values";
- }
- tinter.h0 = val_array->Get(0)->NumberValue();
- tinter.h1 = val_array->Get(1)->NumberValue();
- }
- Local sat = tint->Get(NanNew("s"));
- if (!sat.IsEmpty() && sat->IsArray()) {
- Local val_array = Local::Cast(sat);
- if (val_array->Length() != 2) {
- msg = "s array must be a pair of values";
- }
- tinter.s0 = val_array->Get(0)->NumberValue();
- tinter.s1 = val_array->Get(1)->NumberValue();
- }
- Local light = tint->Get(NanNew("l"));
- if (!light.IsEmpty() && light->IsArray()) {
- Local val_array = Local::Cast(light);
- if (val_array->Length() != 2) {
- msg = "l array must be a pair of values";
- }
- tinter.l0 = val_array->Get(0)->NumberValue();
- tinter.l1 = val_array->Get(1)->NumberValue();
- }
- Local alpha = tint->Get(NanNew("a"));
- if (!alpha.IsEmpty() && alpha->IsArray()) {
- Local val_array = Local::Cast(alpha);
- if (val_array->Length() != 2) {
- msg = "a array must be a pair of values";
- }
- tinter.a0 = val_array->Get(0)->NumberValue();
- tinter.a1 = val_array->Get(1)->NumberValue();
- }
-}
-
-static inline void Blend_CompositePixel(unsigned int& target, unsigned int const& source) {
- if (source <= 0x00FFFFFF) {
- // Top pixel is fully transparent.
- //
- } else if (source >= 0xFF000000 || target <= 0x00FFFFFF) {
- // Top pixel is fully opaque or bottom pixel is fully transparent.
- target = source;
- } else {
- // Both pixels have transparency.
- // From http://trac.mapnik.org/browser/trunk/include/mapnik/graphics.hpp#L337
- long a1 = (source >> 24) & 0xff;
- long r1 = source & 0xff;
- long g1 = (source >> 8) & 0xff;
- long b1 = (source >> 16) & 0xff;
-
- long a0 = (target >> 24) & 0xff;
- long r0 = (target & 0xff) * a0;
- long g0 = ((target >> 8) & 0xff) * a0;
- long b0 = ((target >> 16) & 0xff) * a0;
-
- a0 = ((a1 + a0) << 8) - a0 * a1;
- r0 = ((((r1 << 8) - r0) * a1 + (r0 << 8)) / a0);
- g0 = ((((g1 << 8) - g0) * a1 + (g0 << 8)) / a0);
- b0 = ((((b1 << 8) - b0) * a1 + (b0 << 8)) / a0);
- a0 = a0 >> 8;
- target = (a0 << 24) | (b0 << 16) | (g0 << 8) | (r0);
- }
-}
-
-static inline void TintPixel(unsigned & r,
- unsigned & g,
- unsigned & b,
- Tinter const& tint) {
- double h;
- double s;
- double l;
- rgb_to_hsl(r,g,b,h,s,l);
- double h2 = tint.h0 + (h * (tint.h1 - tint.h0));
- double s2 = tint.s0 + (s * (tint.s1 - tint.s0));
- double l2 = tint.l0 + (l * (tint.l1 - tint.l0));
- if (h2 > 1) h2 = 1;
- if (h2 < 0) h2 = 0;
- if (s2 > 1) s2 = 1;
- if (s2 < 0) s2 = 0;
- if (l2 > 1) l2 = 1;
- if (l2 < 0) l2 = 0;
- hsl_to_rgb(h2,s2,l2,r,g,b);
-}
-
-
-static void Blend_Composite(unsigned int *target, BlendBaton *baton, BImage *image) {
- const unsigned int *source = image->im_ptr->data();
-
- int sourceX = std::max(0, -image->x);
- int sourceY = std::max(0, -image->y);
- int sourcePos = sourceY * image->width + sourceX;
-
- int width = image->width - sourceX - std::max(0, image->x + image->width - baton->width);
- int height = image->height - sourceY - std::max(0, image->y + image->height - baton->height);
-
- int targetX = std::max(0, image->x);
- int targetY = std::max(0, image->y);
- int targetPos = targetY * baton->width + targetX;
- bool tinting = !image->tint.is_identity();
- bool set_alpha = !image->tint.is_alpha_identity();
- if (tinting || set_alpha) {
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++) {
- unsigned int const& source_pixel = source[sourcePos + x];
- unsigned a = (source_pixel >> 24) & 0xff;
- if (set_alpha) {
- double a2 = image->tint.a0 + (a/255.0 * (image->tint.a1 - image->tint.a0));
- if (a2 < 0) a2 = 0;
- a = static_cast(std::floor((a2 * 255.0)+.5));
- if (a > 255) a = 255;
- }
- unsigned r = source_pixel & 0xff;
- unsigned g = (source_pixel >> 8 ) & 0xff;
- unsigned b = (source_pixel >> 16) & 0xff;
- if (a > 1 && tinting) {
- TintPixel(r,g,b,image->tint);
- }
- unsigned int new_pixel = (a << 24) | (b << 16) | (g << 8) | (r);
- Blend_CompositePixel(target[targetPos + x], new_pixel);
- }
- sourcePos += image->width;
- targetPos += baton->width;
- }
- } else {
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++) {
- Blend_CompositePixel(target[targetPos + x], source[sourcePos + x]);
- }
- sourcePos += image->width;
- targetPos += baton->width;
- }
- }
-}
-
-static void Blend_Encode(mapnik::image_rgba8 const& image, BlendBaton* baton, bool alpha) {
- try {
- if (baton->format == BLEND_FORMAT_JPEG) {
-#if defined(HAVE_JPEG)
- if (baton->quality == 0) baton->quality = 85;
- mapnik::save_as_jpeg(baton->stream, baton->quality, image);
-#else
- baton->message = "Mapnik not built with jpeg support";
-#endif
- } else if (baton->format == BLEND_FORMAT_WEBP) {
-#if defined(HAVE_WEBP)
- if (baton->quality == 0) baton->quality = 80;
- WebPConfig config;
- // Default values set here will be lossless=0 and quality=75 (as least as of webp v0.3.1)
- if (!WebPConfigInit(&config)) {
- /* LCOV_EXCL_START */
- baton->message = "WebPConfigInit failed: version mismatch";
- /* LCOV_EXCL_END */
- } else {
- // see for more details: https://github.com/mapnik/mapnik/wiki/Image-IO#webp-output-options
- config.quality = baton->quality;
- if (baton->compression > 0) {
- config.method = baton->compression;
- }
- mapnik::save_as_webp(baton->stream,image,config,alpha);
- }
-#else
- baton->message = "Mapnik not built with webp support";
-#endif
- } else {
- // Save as PNG.
-#if defined(HAVE_PNG)
- mapnik::png_options opts;
- opts.compression = baton->compression;
- if (baton->encoder == BLEND_ENCODER_MINIZ) opts.use_miniz = true;
- if (baton->palette && baton->palette->valid()) {
- mapnik::save_as_png8_pal(baton->stream, image, *baton->palette, opts);
- } else if (baton->quality > 0) {
- opts.colors = baton->quality;
- // Paletted PNG.
- if (alpha && baton->mode == BLEND_MODE_HEXTREE) {
- mapnik::save_as_png8_hex(baton->stream, image, opts);
- } else {
- mapnik::save_as_png8_oct(baton->stream, image, opts);
- }
- } else {
- mapnik::save_as_png(baton->stream, image, opts);
- }
-#else
- baton->message = "Mapnik not built with png support";
-#endif
- }
- } catch (const std::exception& ex) {
- baton->message = ex.what();
- }
-}
-
-void Work_Blend(uv_work_t* req) {
- BlendBaton* baton = static_cast(req->data);
-
- int total = baton->images.size();
- bool alpha = true;
- int size = 0;
-
- // Iterate from the last to first image because we potentially don't have
- // to decode all images if there's an opaque one.
- Images::reverse_iterator rit = baton->images.rbegin();
- Images::reverse_iterator rend = baton->images.rend();
- for (int index = total - 1; rit != rend; rit++, index--) {
- // If an image that is higher than the current is opaque, stop alltogether.
- if (!alpha) break;
-
- BImage *image = &**rit;
- std::unique_ptr image_reader;
- try {
- image_reader = std::unique_ptr(mapnik::get_image_reader(image->data, image->dataLength));
- } catch (std::exception const& ex) {
- baton->message = ex.what();
- return;
- }
-
- if (!image_reader || !image_reader.get()) {
- // Not quite sure anymore how the pointer would not be returned
- // from the reader and can't find a way to make this fail.
- // So removing from coverage
- /* LCOV_EXCL_START */
- baton->message = "Unknown image format";
- return;
- /* LCOV_EXCL_END */
- }
-
- unsigned layer_width = image_reader->width();
- unsigned layer_height = image_reader->height();
- // Error out on invalid images.
- if (layer_width == 0 || layer_height == 0) {
- // No idea how to create a zero height or width image
- // so removing from coverage, because I am fairly certain
- // it is not possible in almost every image format.
- /* LCOV_EXCL_START */
- baton->message = "zero width/height image encountered";
- return;
- /* LCOV_EXCL_END */
- }
-
- int visibleWidth = (int)layer_width + image->x;
- int visibleHeight = (int)layer_height + image->y;
- // The first image that is in the viewport sets the width/height, if not user supplied.
- if (baton->width <= 0) baton->width = std::max(0, visibleWidth);
- if (baton->height <= 0) baton->height = std::max(0, visibleHeight);
-
- // Skip images that are outside of the viewport.
- if (visibleWidth <= 0 || visibleHeight <= 0 || image->x >= baton->width || image->y >= baton->height) {
- // Remove this layer from the list of layers we consider blending.
- continue;
- }
-
- bool layer_has_alpha = image_reader->has_alpha();
-
- // Short-circuit when we're not reencoding.
- if (size == 0 && !layer_has_alpha && !baton->reencode &&
- image->x == 0 && image->y == 0 &&
- (int)layer_width == baton->width && (int)layer_height == baton->height)
- {
- baton->stream.write((char *)image->data, image->dataLength);
- return;
- }
-
- // allocate image for decoded pixels
- std::unique_ptr im_ptr(new mapnik::image_rgba8(layer_width,layer_height));
- // actually decode pixels now
- try {
- image_reader->read(0,0,*im_ptr);
- } catch (std::exception const&) {
- baton->message = "Could not decode image";
- return;
- }
-
- bool coversWidth = image->x <= 0 && visibleWidth >= baton->width;
- bool coversHeight = image->y <= 0 && visibleHeight >= baton->height;
- if (!layer_has_alpha && coversWidth && coversHeight && image->tint.is_alpha_identity()) {
- // Skip decoding more layers.
- alpha = false;
- }
-
- // Convenience aliases.
- image->width = layer_width;
- image->height = layer_height;
- image->im_ptr = std::move(im_ptr);
- size++;
-
- }
-
- // Now blend images.
- int pixels = baton->width * baton->height;
- if (pixels <= 0) {
- std::ostringstream msg;
- msg << "Image dimensions " << baton->width << "x" << baton->height << " are invalid";
- baton->message = msg.str();
- return;
- }
-
- mapnik::image_rgba8 target(baton->width, baton->height);
- // When we don't actually have transparent pixels, we don't need to set the matte.
- if (alpha) {
- target.set(baton->matte);
- }
- for (auto image_ptr : baton->images)
- {
- if (image_ptr && image_ptr->im_ptr.get())
- {
- Blend_Composite(target.data(), baton, &*image_ptr);
- }
- }
- Blend_Encode(target, baton, alpha);
-}
-
-void Work_AfterBlend(uv_work_t* req) {
- NanScope();
- BlendBaton* baton = static_cast(req->data);
-
- if (!baton->message.length()) {
- std::string result = baton->stream.str();
- Local argv[] = {
- NanNull(),
- NanNewBufferHandle((char *)result.data(), result.length()),
- };
- NanMakeCallback(NanGetCurrentContext()->Global(), NanNew(baton->callback), 2, argv);
- } else {
- Local argv[] = {
- NanError(baton->message.c_str())
- };
- NanMakeCallback(NanGetCurrentContext()->Global(), NanNew(baton->callback), 1, argv);
- }
- delete baton;
-}
-
-NAN_METHOD(Blend) {
- NanScope();
- std::unique_ptr baton(new BlendBaton());
-
- Local options;
- if (args.Length() == 0 || !args[0]->IsArray()) {
- NanThrowTypeError("First argument must be an array of Buffers.");
- NanReturnUndefined();
- } else if (args.Length() == 1) {
- NanThrowTypeError("Second argument must be a function");
- NanReturnUndefined();
- } else if (args.Length() == 2) {
- // No options provided.
- if (!args[1]->IsFunction()) {
- NanThrowTypeError("Second argument must be a function.");
- NanReturnUndefined();
- }
- NanAssignPersistent(baton->callback,args[1].As());
- } else if (args.Length() >= 3) {
- if (!args[1]->IsObject()) {
- NanThrowTypeError("Second argument must be a an options object.");
- NanReturnUndefined();
- }
- options = Local::Cast(args[1]);
-
- if (!args[2]->IsFunction()) {
- NanThrowTypeError("Third argument must be a function.");
- NanReturnUndefined();
- }
- NanAssignPersistent(baton->callback,args[2].As());
- }
-
- // Validate options
- if (!options.IsEmpty()) {
- baton->quality = options->Get(NanNew("quality"))->Int32Value();
-
- Local format_val = options->Get(NanNew("format"));
- if (!format_val.IsEmpty() && format_val->IsString()) {
- if (strcmp(*String::Utf8Value(format_val), "jpeg") == 0 ||
- strcmp(*String::Utf8Value(format_val), "jpg") == 0) {
- baton->format = BLEND_FORMAT_JPEG;
- if (baton->quality == 0) baton->quality = 85; // 85 is same default as mapnik core jpeg
- else if (baton->quality < 0 || baton->quality > 100) {
- NanThrowTypeError("JPEG quality is range 0-100.");
- NanReturnUndefined();
- }
- } else if (strcmp(*String::Utf8Value(format_val), "png") == 0) {
- if (baton->quality == 1 || baton->quality > 256) {
- NanThrowTypeError("PNG images must be quantized between 2 and 256 colors.");
- NanReturnUndefined();
- }
- } else if (strcmp(*String::Utf8Value(format_val), "webp") == 0) {
- baton->format = BLEND_FORMAT_WEBP;
- if (baton->quality == 0) baton->quality = 80;
- else if (baton->quality < 0 || baton->quality > 100) {
- NanThrowTypeError("WebP quality is range 0-100.");
- NanReturnUndefined();
- }
- } else {
- NanThrowTypeError("Invalid output format.");
- NanReturnUndefined();
- }
- }
-
- baton->reencode = options->Get(NanNew("reencode"))->BooleanValue();
- baton->width = options->Get(NanNew("width"))->Int32Value();
- baton->height = options->Get(NanNew("height"))->Int32Value();
-
- Local matte_val = options->Get(NanNew("matte"));
- if (!matte_val.IsEmpty() && matte_val->IsString()) {
- if (!hexToUInt32Color(*String::Utf8Value(matte_val->ToString()), baton->matte))
- {
- NanThrowTypeError("Invalid batte provided.");
- NanReturnUndefined();
- }
-
- // Make sure we're reencoding in the case of single alpha PNGs
- if (baton->matte && !baton->reencode) {
- baton->reencode = true;
- }
- }
-
- Local palette_val = options->Get(NanNew("palette"));
- if (!palette_val.IsEmpty() && palette_val->IsObject()) {
- baton->palette = node::ObjectWrap::Unwrap(palette_val->ToObject())->palette();
- }
-
- Local mode_val = options->Get(NanNew("mode"));
- if (!mode_val.IsEmpty() && mode_val->IsString()) {
- if (strcmp(*String::Utf8Value(mode_val), "octree") == 0 ||
- strcmp(*String::Utf8Value(mode_val), "o") == 0) {
- baton->mode = BLEND_MODE_OCTREE;
- }
- else if (strcmp(*String::Utf8Value(mode_val), "hextree") == 0 ||
- strcmp(*String::Utf8Value(mode_val), "h") == 0) {
- baton->mode = BLEND_MODE_HEXTREE;
- }
- }
-
- Local encoder_val = options->Get(NanNew("encoder"));
- if (!encoder_val.IsEmpty() && encoder_val->IsString()) {
- if (strcmp(*String::Utf8Value(encoder_val), "miniz") == 0) {
- baton->encoder = BLEND_ENCODER_MINIZ;
- }
- // default is libpng
- }
-
- if (options->Has(NanNew("compression"))) {
- Local compression_val = options->Get(NanNew("compression"));
- if (!compression_val.IsEmpty() && compression_val->IsNumber())
- {
- baton->compression = compression_val->Int32Value();
- }
- else
- {
- NanThrowTypeError("Compression option must be a number");
- NanReturnUndefined();
- }
- }
-
- int min_compression = Z_NO_COMPRESSION;
- int max_compression = Z_BEST_COMPRESSION;
- if (baton->format == BLEND_FORMAT_PNG) {
- if (baton->compression < 0) baton->compression = Z_DEFAULT_COMPRESSION;
- if (baton->encoder == BLEND_ENCODER_MINIZ) max_compression = 10; // MZ_UBER_COMPRESSION
- } else if (baton->format == BLEND_FORMAT_WEBP) {
- min_compression = 0, max_compression = 6;
- if (baton->compression < 0) baton->compression = -1;
- }
-
- if (baton->compression > max_compression) {
- std::ostringstream msg;
- msg << "Compression level must be between "
- << min_compression << " and " << max_compression;
- NanThrowTypeError(msg.str().c_str());
- NanReturnUndefined();
- }
- }
-
- Local js_images = Local::Cast(args[0]);
- uint32_t length = js_images->Length();
- if (length < 1 && !baton->reencode) {
- NanThrowTypeError("First argument must contain at least one Buffer.");
- NanReturnUndefined();
- } else if (length == 1 && !baton->reencode) {
- Local buffer = js_images->Get(0);
- if (Buffer::HasInstance(buffer)) {
- // Directly pass through buffer if it's the only one.
- Local argv[] = {
- NanNull(),
- buffer
- };
- NanMakeCallback(NanGetCurrentContext()->Global(), NanNew(baton->callback), 2, argv);
- NanReturnUndefined();
- } else {
- // Check whether the argument is a complex image with offsets etc.
- // In that case, we don't throw but continue going through the blend
- // process below.
- bool valid = false;
- if (buffer->IsObject()) {
- Local props = buffer->ToObject();
- valid = props->Has(NanNew("buffer")) &&
- Buffer::HasInstance(props->Get(NanNew("buffer")));
- }
- if (!valid) {
- NanThrowTypeError("All elements must be Buffers or objects with a 'buffer' property.");
- NanReturnUndefined();
- }
- }
- }
-
- if (!(length >= 1 || (baton->width > 0 && baton->height > 0))) {
- NanThrowTypeError("Without buffers, you have to specify width and height.");
- NanReturnUndefined();
- }
-
- if (baton->width < 0 || baton->height < 0) {
- NanThrowTypeError("Image dimensions must be greater than 0.");
- NanReturnUndefined();
- }
-
- for (uint32_t i = 0; i < length; i++) {
- ImagePtr image = std::make_shared();
- Local buffer = js_images->Get(i);
- if (Buffer::HasInstance(buffer)) {
- NanAssignPersistent(image->buffer,buffer.As());
- } else if (buffer->IsObject()) {
- Local props = buffer->ToObject();
- if (props->Has(NanNew("buffer"))) {
- buffer = props->Get(NanNew("buffer"));
- if (Buffer::HasInstance(buffer)) {
- NanAssignPersistent(image->buffer,buffer.As());
- }
- }
- image->x = props->Get(NanNew("x"))->Int32Value();
- image->y = props->Get(NanNew("y"))->Int32Value();
-
- Local tint_val = props->Get(NanNew("tint"));
- if (!tint_val.IsEmpty() && tint_val->IsObject()) {
- Local tint = tint_val->ToObject();
- if (!tint.IsEmpty()) {
- baton->reencode = true;
- std::string msg;
- parseTintOps(tint,image->tint,msg);
- if (!msg.empty()) {
- NanThrowTypeError(msg.c_str());
- NanReturnUndefined();
- }
- }
- }
- }
-
- if (image->buffer.IsEmpty()) {
- NanThrowTypeError("All elements must be Buffers or objects with a 'buffer' property.");
- NanReturnUndefined();
- }
-
- image->data = node::Buffer::Data(buffer);
- image->dataLength = node::Buffer::Length(buffer);
- baton->images.push_back(image);
- }
-
- uv_queue_work(uv_default_loop(), &(baton.release())->request, Work_Blend, (uv_after_work_cb)Work_AfterBlend);
-
- NanReturnUndefined();
-}
-
-}
diff --git a/test/fixture/react-jsx.output.json b/test/fixture/react-jsx.output.json
deleted file mode 100644
index 5a830b1a5..000000000
--- a/test/fixture/react-jsx.output.json
+++ /dev/null
@@ -1,93 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "apples",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 7,
- "offset": 6
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 7,
- "offset": 6
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 7,
- "offset": 6
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 20
- }
- }
- },
- "errors": [],
- "name": "apples",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "apples",
- "kind": "function"
- }
- ],
- "namespace": "apples"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/react-jsx.output.md b/test/fixture/react-jsx.output.md
deleted file mode 100644
index f93d2550d..000000000
--- a/test/fixture/react-jsx.output.md
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-# apples
-
-apples
diff --git a/test/fixture/react-jsx.output.md.json b/test/fixture/react-jsx.output.md.json
deleted file mode 100644
index 826fc6201..000000000
--- a/test/fixture/react-jsx.output.md.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "apples"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "apples",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 7,
- "offset": 6
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 7,
- "offset": 6
- },
- "indent": []
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/require-json-no-extension.output.json b/test/fixture/require-json-no-extension.output.json
deleted file mode 100644
index 0637a088a..000000000
--- a/test/fixture/require-json-no-extension.output.json
+++ /dev/null
@@ -1 +0,0 @@
-[]
\ No newline at end of file
diff --git a/test/fixture/require-json-no-extension.output.md b/test/fixture/require-json-no-extension.output.md
deleted file mode 100644
index 1fcb902bc..000000000
--- a/test/fixture/require-json-no-extension.output.md
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/test/fixture/require-json-no-extension.output.md.json b/test/fixture/require-json-no-extension.output.md.json
deleted file mode 100644
index c4109240d..000000000
--- a/test/fixture/require-json-no-extension.output.md.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/require-json.json b/test/fixture/require-json.json
deleted file mode 100644
index 0967ef424..000000000
--- a/test/fixture/require-json.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/test/fixture/require-json.output.json b/test/fixture/require-json.output.json
deleted file mode 100644
index 0637a088a..000000000
--- a/test/fixture/require-json.output.json
+++ /dev/null
@@ -1 +0,0 @@
-[]
\ No newline at end of file
diff --git a/test/fixture/require-json.output.md b/test/fixture/require-json.output.md
deleted file mode 100644
index 1fcb902bc..000000000
--- a/test/fixture/require-json.output.md
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/test/fixture/require-json.output.md.json b/test/fixture/require-json.output.md.json
deleted file mode 100644
index c4109240d..000000000
--- a/test/fixture/require-json.output.md.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/simple-hashbang.output.json b/test/fixture/simple-hashbang.output.json
deleted file mode 100644
index 59c584956..000000000
--- a/test/fixture/simple-hashbang.output.json
+++ /dev/null
@@ -1,163 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 2
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "name": "simple-hashbang.input",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "simple-hashbang.input",
- "kind": "function"
- }
- ],
- "namespace": "simple-hashbang.input"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/simple-hashbang.output.md b/test/fixture/simple-hashbang.output.md
deleted file mode 100644
index a13e7f4a3..000000000
--- a/test/fixture/simple-hashbang.output.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-# simple-hashbang.input
-
-This function returns the number one.
-
-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
diff --git a/test/fixture/simple-hashbang.output.md.json b/test/fixture/simple-hashbang.output.md.json
deleted file mode 100644
index ff6b6f17f..000000000
--- a/test/fixture/simple-hashbang.output.md.json
+++ /dev/null
@@ -1,118 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "simple-hashbang.input"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/simple-private.output.json b/test/fixture/simple-private.output.json
deleted file mode 100644
index 0637a088a..000000000
--- a/test/fixture/simple-private.output.json
+++ /dev/null
@@ -1 +0,0 @@
-[]
\ No newline at end of file
diff --git a/test/fixture/simple-private.output.md b/test/fixture/simple-private.output.md
deleted file mode 100644
index 1fcb902bc..000000000
--- a/test/fixture/simple-private.output.md
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/test/fixture/simple-private.output.md.json b/test/fixture/simple-private.output.md.json
deleted file mode 100644
index c4109240d..000000000
--- a/test/fixture/simple-private.output.md.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/simple-singlestar.output.json b/test/fixture/simple-singlestar.output.json
deleted file mode 100644
index 0637a088a..000000000
--- a/test/fixture/simple-singlestar.output.json
+++ /dev/null
@@ -1 +0,0 @@
-[]
\ No newline at end of file
diff --git a/test/fixture/simple-singlestar.output.md b/test/fixture/simple-singlestar.output.md
deleted file mode 100644
index 1fcb902bc..000000000
--- a/test/fixture/simple-singlestar.output.md
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/test/fixture/simple-singlestar.output.md.json b/test/fixture/simple-singlestar.output.md.json
deleted file mode 100644
index c4109240d..000000000
--- a/test/fixture/simple-singlestar.output.md.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/simple-triplestar.output.json b/test/fixture/simple-triplestar.output.json
deleted file mode 100644
index 0637a088a..000000000
--- a/test/fixture/simple-triplestar.output.json
+++ /dev/null
@@ -1 +0,0 @@
-[]
\ No newline at end of file
diff --git a/test/fixture/simple-triplestar.output.md b/test/fixture/simple-triplestar.output.md
deleted file mode 100644
index 1fcb902bc..000000000
--- a/test/fixture/simple-triplestar.output.md
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/test/fixture/simple-triplestar.output.md.json b/test/fixture/simple-triplestar.output.md.json
deleted file mode 100644
index c4109240d..000000000
--- a/test/fixture/simple-triplestar.output.md.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/simple-two.output.json b/test/fixture/simple-two.output.json
deleted file mode 100644
index abf774182..000000000
--- a/test/fixture/simple-two.output.json
+++ /dev/null
@@ -1,245 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number plus two.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "the number",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- },
- "name": "a"
- },
- {
- "title": "returns",
- "description": "numbertwo",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- {
- "title": "example",
- "description": "var result = returnTwo(4);\n// result is 6",
- "lineNumber": 5
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 13,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "a",
- "lineNumber": 3,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the number",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numbertwo",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "examples": [
- {
- "description": "var result = returnTwo(4);\n// result is 6"
- }
- ],
- "name": "returnTwo",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "returnTwo",
- "kind": "function"
- }
- ],
- "namespace": "returnTwo"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/simple-two.output.md b/test/fixture/simple-two.output.md
deleted file mode 100644
index c19dd2ab7..000000000
--- a/test/fixture/simple-two.output.md
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-# returnTwo
-
-This function returns the number plus two.
-
-**Parameters**
-
-- `a` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number
-
-**Examples**
-
-```javascript
-var result = returnTwo(4);
-// result is 6
-```
-
-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numbertwo
diff --git a/test/fixture/simple-two.output.md.json b/test/fixture/simple-two.output.md.json
deleted file mode 100644
index 63e64f430..000000000
--- a/test/fixture/simple-two.output.md.json
+++ /dev/null
@@ -1,220 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "returnTwo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number plus two.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the number",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Examples"
- }
- ]
- },
- {
- "lang": "javascript",
- "type": "code",
- "value": "var result = returnTwo(4);\n// result is 6"
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numbertwo",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/simple.output.github.json b/test/fixture/simple.output.github.json
deleted file mode 100644
index 20b5cc7d9..000000000
--- a/test/fixture/simple.output.github.json
+++ /dev/null
@@ -1,165 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 2
- }
- },
- "github": "[github]",
- "path": "test/fixture/simple.input.js"
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "simple.input",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "simple.input",
- "kind": "function"
- }
- ],
- "namespace": "simple.input"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/simple.output.github.md b/test/fixture/simple.output.github.md
deleted file mode 100644
index 69a6336a1..000000000
--- a/test/fixture/simple.output.github.md
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-# simple.input
-
-[test/fixture/simple.input.js:5-8]([github] "Source code on GitHub")
-
-This function returns the number one.
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
diff --git a/test/fixture/simple.output.json b/test/fixture/simple.output.json
deleted file mode 100644
index ee6fd4cc9..000000000
--- a/test/fixture/simple.output.json
+++ /dev/null
@@ -1,163 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 2
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "simple.input",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "simple.input",
- "kind": "function"
- }
- ],
- "namespace": "simple.input"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/simple.output.md b/test/fixture/simple.output.md
deleted file mode 100644
index 55ce13e20..000000000
--- a/test/fixture/simple.output.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-# simple.input
-
-This function returns the number one.
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
diff --git a/test/fixture/simple.output.md.json b/test/fixture/simple.output.md.json
deleted file mode 100644
index 6f30c7d2d..000000000
--- a/test/fixture/simple.output.md.json
+++ /dev/null
@@ -1,118 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "simple.input"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sort-order-alpha.output.json b/test/fixture/sort-order-alpha.output.json
deleted file mode 100644
index 9d9257b5c..000000000
--- a/test/fixture/sort-order-alpha.output.json
+++ /dev/null
@@ -1,542 +0,0 @@
-[
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 6,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 6
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 7,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 15
- }
- }
- },
- "errors": [],
- "name": "a",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "a",
- "kind": "function"
- }
- ],
- "namespace": "a"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 3,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 6
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 15
- }
- }
- },
- "errors": [],
- "name": "b",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "b",
- "kind": "function"
- }
- ],
- "namespace": "b"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 9,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 6
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 19,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "C",
- "kind": "class",
- "members": {
- "instance": [
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 17,
- "column": 2
- },
- "end": {
- "line": 17,
- "column": 8
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 18,
- "column": 2
- },
- "end": {
- "line": 18,
- "column": 8
- }
- }
- },
- "errors": [],
- "name": "A",
- "kind": "function",
- "memberof": "C",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "C",
- "kind": "class"
- },
- {
- "name": "A",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "C#A"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 15,
- "column": 2
- },
- "end": {
- "line": 15,
- "column": 8
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 16,
- "column": 2
- },
- "end": {
- "line": 16,
- "column": 8
- }
- }
- },
- "errors": [],
- "name": "a",
- "kind": "function",
- "memberof": "C",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "C",
- "kind": "class"
- },
- {
- "name": "a",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "C#a"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 13,
- "column": 2
- },
- "end": {
- "line": 13,
- "column": 8
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 14,
- "column": 2
- },
- "end": {
- "line": 14,
- "column": 8
- }
- }
- },
- "errors": [],
- "name": "B",
- "kind": "function",
- "memberof": "C",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "C",
- "kind": "class"
- },
- {
- "name": "B",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "C#B"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 11,
- "column": 2
- },
- "end": {
- "line": 11,
- "column": 8
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 12,
- "column": 2
- },
- "end": {
- "line": 12,
- "column": 8
- }
- }
- },
- "errors": [],
- "name": "b",
- "kind": "function",
- "memberof": "C",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "C",
- "kind": "class"
- },
- {
- "name": "b",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "C#b"
- }
- ],
- "static": [],
- "events": []
- },
- "path": [
- {
- "name": "C",
- "kind": "class"
- }
- ],
- "namespace": "C"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 21,
- "column": 0
- },
- "end": {
- "line": 21,
- "column": 6
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 22,
- "column": 0
- },
- "end": {
- "line": 31,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "D",
- "kind": "class",
- "members": {
- "instance": [
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 29,
- "column": 2
- },
- "end": {
- "line": 29,
- "column": 8
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 30,
- "column": 2
- },
- "end": {
- "line": 30,
- "column": 8
- }
- }
- },
- "errors": [],
- "name": "A",
- "kind": "function",
- "memberof": "D",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "D",
- "kind": "class"
- },
- {
- "name": "A",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "D#A"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 27,
- "column": 2
- },
- "end": {
- "line": 27,
- "column": 8
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 28,
- "column": 2
- },
- "end": {
- "line": 28,
- "column": 8
- }
- }
- },
- "errors": [],
- "name": "a",
- "kind": "function",
- "memberof": "D",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "D",
- "kind": "class"
- },
- {
- "name": "a",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "D#a"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 25,
- "column": 2
- },
- "end": {
- "line": 25,
- "column": 8
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 26,
- "column": 2
- },
- "end": {
- "line": 26,
- "column": 8
- }
- }
- },
- "errors": [],
- "name": "B",
- "kind": "function",
- "memberof": "D",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "D",
- "kind": "class"
- },
- {
- "name": "B",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "D#B"
- },
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 23,
- "column": 2
- },
- "end": {
- "line": 23,
- "column": 8
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 24,
- "column": 2
- },
- "end": {
- "line": 24,
- "column": 8
- }
- }
- },
- "errors": [],
- "name": "b",
- "kind": "function",
- "memberof": "D",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "D",
- "kind": "class"
- },
- {
- "name": "b",
- "kind": "function",
- "scope": "instance"
- }
- ],
- "namespace": "D#b"
- }
- ],
- "static": [],
- "events": []
- },
- "path": [
- {
- "name": "D",
- "kind": "class"
- }
- ],
- "namespace": "D"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sort-order-alpha.output.md b/test/fixture/sort-order-alpha.output.md
deleted file mode 100644
index 52350ab59..000000000
--- a/test/fixture/sort-order-alpha.output.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-# a
-
-# b
-
-# C
-
-## A
-
-## a
-
-## B
-
-## b
-
-# D
-
-## A
-
-## a
-
-## B
-
-## b
diff --git a/test/fixture/sort-order-alpha.output.md.json b/test/fixture/sort-order-alpha.output.md.json
deleted file mode 100644
index fe0781da4..000000000
--- a/test/fixture/sort-order-alpha.output.md.json
+++ /dev/null
@@ -1,129 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "a"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "b"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "C"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "A"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "a"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "B"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "b"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "D"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "A"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "a"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "B"
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "b"
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/string-literal-key.output.json b/test/fixture/string-literal-key.output.json
deleted file mode 100644
index 6396ac2c9..000000000
--- a/test/fixture/string-literal-key.output.json
+++ /dev/null
@@ -1,139 +0,0 @@
-[
- {
- "description": "",
- "tags": [
- {
- "title": "alias",
- "description": null,
- "lineNumber": 1,
- "name": "MyContainerObject"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 11,
- "column": 1
- }
- }
- },
- "errors": [],
- "alias": "MyContainerObject",
- "name": "MyContainerObject",
- "kind": "constant",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "MyContainerObject",
- "kind": "constant"
- }
- ],
- "namespace": "MyContainerObject"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The foo property",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 5,
- "column": 2
- },
- "end": {
- "line": 7,
- "column": 5
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 8,
- "column": 2
- },
- "end": {
- "line": 10,
- "column": 3
- }
- }
- },
- "errors": [],
- "name": "foo",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "foo"
- }
- ],
- "namespace": "foo"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/string-literal-key.output.md b/test/fixture/string-literal-key.output.md
deleted file mode 100644
index cbd81f9fb..000000000
--- a/test/fixture/string-literal-key.output.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-# MyContainerObject
-
-# foo
-
-The foo property
diff --git a/test/fixture/string-literal-key.output.md.json b/test/fixture/string-literal-key.output.md.json
deleted file mode 100644
index 17d559b4b..000000000
--- a/test/fixture/string-literal-key.output.md.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "MyContainerObject"
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The foo property",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/alias.input.js b/test/fixture/sync/alias.input.js
deleted file mode 100644
index 61bd4d81f..000000000
--- a/test/fixture/sync/alias.input.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * This is a method that has an alias tag: so it should
- * be referred to as nixon, but should still have inference.
- * @alias nixon
- */
-function dewey(a: number): number {
- return a;
-}
diff --git a/test/fixture/sync/alias.output.json b/test/fixture/sync/alias.output.json
deleted file mode 100644
index 51d67f58e..000000000
--- a/test/fixture/sync/alias.output.json
+++ /dev/null
@@ -1,124 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is a method that has an alias tag: so it should\nbe referred to as nixon, but should still have inference.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 58,
- "offset": 110
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 58,
- "offset": 110
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 58,
- "offset": 110
- }
- }
- },
- "tags": [
- {
- "title": "alias",
- "description": null,
- "lineNumber": 3,
- "name": "nixon"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 6,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 1
- }
- }
- },
- "errors": [],
- "alias": "nixon",
- "name": "nixon",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "a",
- "lineNumber": 6,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "returns": [
- {
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "nixon",
- "kind": "function"
- }
- ],
- "namespace": "nixon"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/alias.output.md b/test/fixture/sync/alias.output.md
deleted file mode 100644
index 1aabd86f5..000000000
--- a/test/fixture/sync/alias.output.md
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-# nixon
-
-This is a method that has an alias tag: so it should
-be referred to as nixon, but should still have inference.
-
-**Parameters**
-
-- `a` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
diff --git a/test/fixture/sync/alias.output.md.json b/test/fixture/sync/alias.output.md.json
deleted file mode 100644
index 1e92a953d..000000000
--- a/test/fixture/sync/alias.output.md.json
+++ /dev/null
@@ -1,140 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "nixon"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This is a method that has an alias tag: so it should\nbe referred to as nixon, but should still have inference.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 58,
- "offset": 110
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 58,
- "offset": 110
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/empty-example.input.js b/test/fixture/sync/empty-example.input.js
deleted file mode 100644
index e0922f4ea..000000000
--- a/test/fixture/sync/empty-example.input.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * This function returns the number plus two.
- *
- * @example
- */
-function returnTwo() {
- return a + 2;
-}
diff --git a/test/fixture/sync/empty-example.output.json b/test/fixture/sync/empty-example.output.json
deleted file mode 100644
index a6dc7618a..000000000
--- a/test/fixture/sync/empty-example.output.json
+++ /dev/null
@@ -1,104 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number plus two.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- }
- }
- },
- "tags": [
- {
- "title": "example",
- "description": "",
- "lineNumber": 3
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 6,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 1
- }
- }
- },
- "errors": [
- {
- "message": "@example without code",
- "commentLineNumber": 3
- }
- ],
- "name": "returnTwo",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "returnTwo",
- "kind": "function"
- }
- ],
- "namespace": "returnTwo"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/empty-example.output.md b/test/fixture/sync/empty-example.output.md
deleted file mode 100644
index de994437e..000000000
--- a/test/fixture/sync/empty-example.output.md
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-# returnTwo
-
-This function returns the number plus two.
diff --git a/test/fixture/sync/empty-example.output.md.json b/test/fixture/sync/empty-example.output.md.json
deleted file mode 100644
index 6cb4a8eb6..000000000
--- a/test/fixture/sync/empty-example.output.md.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "returnTwo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number plus two.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/flow-types.input.js b/test/fixture/sync/flow-types.input.js
deleted file mode 100644
index cfcc9cb4a..000000000
--- a/test/fixture/sync/flow-types.input.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * This function returns the number one.
- */
-function addThem(a: Point, b: string, c: ?boolean, d: Array, e: Object, f: Named): number {
- return a + b + c + d + e;
-}
-
-/**
- * A 2D point.
- *
- * @property {number} x this is a prop
- */
-type Point = {
- x: number,
- y: number,
- rgb: {
- hex: string
- },
- props: {
- radius: {
- x: number
- }
- }
-};
-
-/**
- * A type with entirely derived properties
- */
-type Two = {
- x: number,
- y: number,
- z: ?number
-};
-
-/**
- * Just an alias for an array of strings
- */
-type T = Array;
-
-/**
- * Very Important Transform
- */
-function veryImportantTransform(
- input: Array,
- options: Object = {}
-): string {
- return "42";
-}
-
-
-/**
- * Function with optional parameter.
- */
-function optionalFunc(x: number = 42) {}
-
-/**
- * Function with object parameter.
- */
-function objectParamFn(x: { a: number }) {}
-
-/** hi */
-function objectParamFn(x: (y:Foo) => Bar) {}
diff --git a/test/fixture/sync/flow-types.output.json b/test/fixture/sync/flow-types.output.json
deleted file mode 100644
index 35304499f..000000000
--- a/test/fixture/sync/flow-types.output.json
+++ /dev/null
@@ -1,1214 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "addThem",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "a",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "Point"
- }
- },
- {
- "title": "param",
- "name": "b",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- },
- {
- "title": "param",
- "name": "c",
- "lineNumber": 4,
- "type": {
- "type": "NullableType",
- "expression": {
- "type": "NameExpression",
- "name": "boolean"
- }
- }
- },
- {
- "title": "param",
- "name": "d",
- "lineNumber": 4,
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "number"
- }
- ]
- }
- },
- {
- "title": "param",
- "name": "e",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "Object"
- }
- },
- {
- "title": "param",
- "name": "f",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "Named"
- }
- }
- ],
- "returns": [
- {
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "addThem",
- "kind": "function"
- }
- ],
- "namespace": "addThem"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A 2D point.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- }
- }
- },
- "tags": [
- {
- "title": "property",
- "description": "this is a prop",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "x"
- }
- ],
- "loc": {
- "start": {
- "line": 8,
- "column": 0
- },
- "end": {
- "line": 12,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 13,
- "column": 0
- },
- "end": {
- "line": 24,
- "column": 2
- }
- }
- },
- "errors": [],
- "properties": [
- {
- "name": "x",
- "lineNumber": 3,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "this is a prop",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "title": "property",
- "name": "y",
- "lineNumber": 15,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "title": "property",
- "name": "rgb",
- "lineNumber": 16,
- "type": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "hex",
- "value": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ]
- },
- "properties": [
- {
- "title": "property",
- "name": "rgb.hex",
- "lineNumber": 17,
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ]
- },
- {
- "title": "property",
- "name": "props",
- "lineNumber": 19,
- "type": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "radius",
- "value": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "x",
- "value": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ]
- }
- }
- ]
- },
- "properties": [
- {
- "title": "property",
- "name": "props.radius",
- "lineNumber": 20,
- "type": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "x",
- "value": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ]
- },
- "properties": [
- {
- "title": "property",
- "name": "props.radius.x",
- "lineNumber": 21,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ]
- }
- ]
- }
- ],
- "name": "Point",
- "kind": "typedef",
- "type": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "x",
- "value": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "type": "FieldType",
- "key": "y",
- "value": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "type": "FieldType",
- "key": "rgb",
- "value": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "hex",
- "value": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ]
- }
- },
- {
- "type": "FieldType",
- "key": "props",
- "value": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "radius",
- "value": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "x",
- "value": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ]
- }
- }
- ]
- }
- }
- ]
- },
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Point",
- "kind": "typedef"
- }
- ],
- "namespace": "Point"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A type with entirely derived properties",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 40,
- "offset": 39
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 40,
- "offset": 39
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 40,
- "offset": 39
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 26,
- "column": 0
- },
- "end": {
- "line": 28,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 29,
- "column": 0
- },
- "end": {
- "line": 33,
- "column": 2
- }
- }
- },
- "errors": [],
- "name": "Two",
- "kind": "typedef",
- "properties": [
- {
- "title": "property",
- "name": "x",
- "lineNumber": 30,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "title": "property",
- "name": "y",
- "lineNumber": 31,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "title": "property",
- "name": "z",
- "lineNumber": 32,
- "type": {
- "type": "NullableType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- }
- ],
- "type": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "x",
- "value": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "type": "FieldType",
- "key": "y",
- "value": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "type": "FieldType",
- "key": "z",
- "value": {
- "type": "NullableType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- }
- ]
- },
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Two",
- "kind": "typedef"
- }
- ],
- "namespace": "Two"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Just an alias for an array of strings",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 35,
- "column": 0
- },
- "end": {
- "line": 37,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 38,
- "column": 0
- },
- "end": {
- "line": 38,
- "column": 23
- }
- }
- },
- "errors": [],
- "name": "T",
- "kind": "typedef",
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "string"
- }
- ]
- },
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "T",
- "kind": "typedef"
- }
- ],
- "namespace": "T"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Very Important Transform",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 40,
- "column": 0
- },
- "end": {
- "line": 42,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 43,
- "column": 0
- },
- "end": {
- "line": 48,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "veryImportantTransform",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "input",
- "lineNumber": 44,
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "string"
- }
- ]
- }
- },
- {
- "title": "param",
- "name": "options",
- "default": "{}",
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Object"
- }
- }
- }
- ],
- "returns": [
- {
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "veryImportantTransform",
- "kind": "function"
- }
- ],
- "namespace": "veryImportantTransform"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Function with optional parameter.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 51,
- "column": 0
- },
- "end": {
- "line": 53,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 54,
- "column": 0
- },
- "end": {
- "line": 54,
- "column": 40
- }
- }
- },
- "errors": [],
- "name": "optionalFunc",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "x",
- "default": "42",
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "optionalFunc",
- "kind": "function"
- }
- ],
- "namespace": "optionalFunc"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Function with object parameter.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 56,
- "column": 0
- },
- "end": {
- "line": 58,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 59,
- "column": 0
- },
- "end": {
- "line": 59,
- "column": 43
- }
- }
- },
- "errors": [],
- "name": "objectParamFn",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "x",
- "lineNumber": 59,
- "type": {
- "type": "RecordType",
- "fields": [
- {
- "type": "FieldType",
- "key": "a",
- "value": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ]
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "objectParamFn",
- "kind": "function"
- }
- ],
- "namespace": "objectParamFn"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "hi",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 3,
- "offset": 2
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 3,
- "offset": 2
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 3,
- "offset": 2
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 61,
- "column": 0
- },
- "end": {
- "line": 61,
- "column": 9
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 62,
- "column": 0
- },
- "end": {
- "line": 62,
- "column": 44
- }
- }
- },
- "errors": [],
- "name": "objectParamFn",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "x",
- "lineNumber": 62,
- "type": {
- "type": "FunctionType",
- "params": [
- {
- "type": "ParameterType",
- "name": "y",
- "expression": {
- "type": "NameExpression",
- "name": "Foo"
- }
- }
- ],
- "result": {
- "type": "NameExpression",
- "name": "Bar"
- }
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "objectParamFn",
- "kind": "function"
- }
- ],
- "namespace": "objectParamFn"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/flow-types.output.md b/test/fixture/sync/flow-types.output.md
deleted file mode 100644
index ae907df12..000000000
--- a/test/fixture/sync/flow-types.output.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-# addThem
-
-This function returns the number one.
-
-**Parameters**
-
-- `a` **[Point](#point)**
-- `b` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
-- `c` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**
-- `d` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>**
-- `e` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
-- `f` **Named**
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-
-# Point
-
-A 2D point.
-
-**Properties**
-
-- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** this is a prop
-- `y` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-- `rgb` **{hex: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)}**
- - `rgb.hex` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
-- `props` **{radius: {x: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}}**
- - `props.radius` **{x: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}**
- - `props.radius.x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-
-# Two
-
-A type with entirely derived properties
-
-**Properties**
-
-- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-- `y` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-- `z` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?**
-
-# T
-
-Just an alias for an array of strings
-
-# veryImportantTransform
-
-Very Important Transform
-
-**Parameters**
-
-- `input` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>**
-- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** (optional, default `{}`)
-
-Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
-
-# optionalFunc
-
-Function with optional parameter.
-
-**Parameters**
-
-- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** (optional, default `42`)
-
-# objectParamFn
-
-Function with object parameter.
-
-**Parameters**
-
-- `x` **{a: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}**
-
-# objectParamFn
-
-hi
-
-**Parameters**
-
-- `x` **function (y: Foo): Bar**
diff --git a/test/fixture/sync/flow-types.output.md.json b/test/fixture/sync/flow-types.output.md.json
deleted file mode 100644
index 0a303ae91..000000000
--- a/test/fixture/sync/flow-types.output.md.json
+++ /dev/null
@@ -1,1537 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "addThem"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "#point",
- "url": "#point",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Point"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "b"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "c"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "boolean"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "d"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "<"
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": ">"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "e"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "f"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Named"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Point"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A 2D point.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 12,
- "offset": 11
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Properties"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "this is a prop",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "y"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "rgb"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "{"
- },
- {
- "type": "text",
- "value": "hex: "
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- },
- {
- "type": "text",
- "value": "}"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "rgb.hex"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "props"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "{"
- },
- {
- "type": "text",
- "value": "radius: "
- },
- {
- "type": "text",
- "value": "{"
- },
- {
- "type": "text",
- "value": "x: "
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "}"
- },
- {
- "type": "text",
- "value": "}"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "props.radius"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "{"
- },
- {
- "type": "text",
- "value": "x: "
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "}"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "props.radius.x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Two"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A type with entirely derived properties",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 40,
- "offset": 39
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 40,
- "offset": 39
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Properties"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "y"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "z"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "T"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Just an alias for an array of strings",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "veryImportantTransform"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Very Important Transform",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "input"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "<"
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- },
- {
- "type": "text",
- "value": ">"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "{}"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "optionalFunc"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Function with optional parameter.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "42"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "objectParamFn"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Function with object parameter.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 32,
- "offset": 31
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "{"
- },
- {
- "type": "text",
- "value": "a: "
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- },
- {
- "type": "text",
- "value": "}"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "objectParamFn"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "hi",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 3,
- "offset": 2
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 3,
- "offset": 2
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "function ("
- },
- {
- "type": "text",
- "value": "y: "
- },
- {
- "type": "text",
- "value": "Foo"
- },
- {
- "type": "text",
- "value": ")"
- },
- {
- "type": "text",
- "value": ": "
- },
- {
- "type": "text",
- "value": "Bar"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/lots-of-options.input.js b/test/fixture/sync/lots-of-options.input.js
deleted file mode 100644
index c9f32290e..000000000
--- a/test/fixture/sync/lots-of-options.input.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Global spectra deconvolution
- * @param {Array} x - Independent variable
- * @param {Array} yIn - Dependent variable
- * @param {Object} [options] - Options object
- * @param {Object} [options.sgOptions] - Options object for Savitzky-Golay filter. See https://github.com/mljs/savitzky-golay-generalized#options
- * @param {Number} [options.minMaxRatio = 0.00025] - Threshold to determine if a given peak should be considered as a noise
- * @param {Number} [options.broadRatio = 0.00] - If `broadRatio` is higher than 0, then all the peaks which second derivative
- * smaller than `broadRatio * maxAbsSecondDerivative` will be marked with the soft mask equal to true.
- * @param {Number} [options.noiseLevel = 3] - Noise threshold in spectrum units
- * @param {Boolean} [options.maxCriteria = true] - Peaks are local maximum(true) or minimum(false)
- * @param {Boolean} [options.smoothY = true] - Select the peak intensities from a smoothed version of the independent variables
- * @param {Boolean} [options.realTopDetection = false] - Use a quadratic optimizations with the peak and its 3 closest neighbors
- * to determine the true x,y values of the peak?
- * @param {Number} [options.heightFactor = 0] - Factor to multiply the calculated height (usually 2)
- * @param {Boolean} [options.boundaries = false] - Return also the inflection points of the peaks
- * @param {Number} [options.derivativeThreshold = 0] - Filters based on the amplitude of the first derivative
- * @return {Array}
- */
-function gsd(x, yIn, options) {
-}
-
-module.exports = gsd;
diff --git a/test/fixture/sync/lots-of-options.output.json b/test/fixture/sync/lots-of-options.output.json
deleted file mode 100644
index e140f0dca..000000000
--- a/test/fixture/sync/lots-of-options.output.json
+++ /dev/null
@@ -1,1292 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Global spectra deconvolution",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "Independent variable",
- "lineNumber": 2,
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "Number"
- }
- ]
- },
- "name": "x"
- },
- {
- "title": "param",
- "description": "Dependent variable",
- "lineNumber": 3,
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "Number"
- }
- ]
- },
- "name": "yIn"
- },
- {
- "title": "param",
- "description": "Options object",
- "lineNumber": 4,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Object"
- }
- },
- "name": "options"
- },
- {
- "title": "param",
- "description": "Options object for Savitzky-Golay filter. See https://github.com/mljs/savitzky-golay-generalized#options",
- "lineNumber": 5,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Object"
- }
- },
- "name": "options.sgOptions"
- },
- {
- "title": "param",
- "description": "Threshold to determine if a given peak should be considered as a noise",
- "lineNumber": 6,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- "name": "options.minMaxRatio",
- "default": "0.00025"
- },
- {
- "title": "param",
- "description": "If `broadRatio` is higher than 0, then all the peaks which second derivative\nsmaller than `broadRatio * maxAbsSecondDerivative` will be marked with the soft mask equal to true.",
- "lineNumber": 7,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- "name": "options.broadRatio",
- "default": "0.00"
- },
- {
- "title": "param",
- "description": "Noise threshold in spectrum units",
- "lineNumber": 9,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- "name": "options.noiseLevel",
- "default": "3"
- },
- {
- "title": "param",
- "description": "Peaks are local maximum(true) or minimum(false)",
- "lineNumber": 10,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Boolean"
- }
- },
- "name": "options.maxCriteria",
- "default": "true"
- },
- {
- "title": "param",
- "description": "Select the peak intensities from a smoothed version of the independent variables",
- "lineNumber": 11,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Boolean"
- }
- },
- "name": "options.smoothY",
- "default": "true"
- },
- {
- "title": "param",
- "description": "Use a quadratic optimizations with the peak and its 3 closest neighbors\nto determine the true x,y values of the peak?",
- "lineNumber": 12,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Boolean"
- }
- },
- "name": "options.realTopDetection",
- "default": "false"
- },
- {
- "title": "param",
- "description": "Factor to multiply the calculated height (usually 2)",
- "lineNumber": 14,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- "name": "options.heightFactor",
- "default": "0"
- },
- {
- "title": "param",
- "description": "Return also the inflection points of the peaks",
- "lineNumber": 15,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Boolean"
- }
- },
- "name": "options.boundaries",
- "default": "false"
- },
- {
- "title": "param",
- "description": "Filters based on the amplitude of the first derivative",
- "lineNumber": 16,
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- "name": "options.derivativeThreshold",
- "default": "0"
- },
- {
- "title": "return",
- "description": null,
- "lineNumber": 17,
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "Object"
- }
- ]
- }
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 19,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 20,
- "column": 0
- },
- "end": {
- "line": 21,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "x",
- "lineNumber": 2,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Independent variable",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- }
- }
- },
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "Number"
- }
- ]
- }
- },
- {
- "name": "yIn",
- "lineNumber": 3,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Dependent variable",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- }
- }
- },
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "Number"
- }
- ]
- }
- },
- {
- "name": "options",
- "lineNumber": 4,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Options object",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Object"
- }
- },
- "properties": [
- {
- "name": "options.sgOptions",
- "lineNumber": 5,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Options object for Savitzky-Golay filter. See ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 47,
- "offset": 46
- },
- "indent": []
- }
- },
- {
- "type": "link",
- "title": null,
- "url": "https://github.com/mljs/savitzky-golay-generalized#options",
- "children": [
- {
- "type": "text",
- "value": "https://github.com/mljs/savitzky-golay-generalized#options",
- "position": {
- "start": {
- "line": 1,
- "column": 47,
- "offset": 46
- },
- "end": {
- "line": 1,
- "column": 105,
- "offset": 104
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 47,
- "offset": 46
- },
- "end": {
- "line": 1,
- "column": 105,
- "offset": 104
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 105,
- "offset": 104
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 105,
- "offset": 104
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Object"
- }
- }
- },
- {
- "name": "options.minMaxRatio",
- "lineNumber": 6,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Threshold to determine if a given peak should be considered as a noise",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 71,
- "offset": 70
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 71,
- "offset": 70
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 71,
- "offset": 70
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- "default": "0.00025"
- },
- {
- "name": "options.broadRatio",
- "lineNumber": 7,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "If ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "broadRatio",
- "position": {
- "start": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "end": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": " is higher than 0, then all the peaks which second derivative\nsmaller than ",
- "position": {
- "start": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "end": {
- "line": 2,
- "column": 14,
- "offset": 90
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "inlineCode",
- "value": "broadRatio * maxAbsSecondDerivative",
- "position": {
- "start": {
- "line": 2,
- "column": 14,
- "offset": 90
- },
- "end": {
- "line": 2,
- "column": 51,
- "offset": 127
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": " will be marked with the soft mask equal to true.",
- "position": {
- "start": {
- "line": 2,
- "column": 51,
- "offset": 127
- },
- "end": {
- "line": 2,
- "column": 100,
- "offset": 176
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 100,
- "offset": 176
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 100,
- "offset": 176
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- "default": "0.00"
- },
- {
- "name": "options.noiseLevel",
- "lineNumber": 9,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Noise threshold in spectrum units",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- "default": "3"
- },
- {
- "name": "options.maxCriteria",
- "lineNumber": 10,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Peaks are local maximum(true) or minimum(false)",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 48,
- "offset": 47
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 48,
- "offset": 47
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 48,
- "offset": 47
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Boolean"
- }
- },
- "default": "true"
- },
- {
- "name": "options.smoothY",
- "lineNumber": 11,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Select the peak intensities from a smoothed version of the independent variables",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 81,
- "offset": 80
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 81,
- "offset": 80
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 81,
- "offset": 80
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Boolean"
- }
- },
- "default": "true"
- },
- {
- "name": "options.realTopDetection",
- "lineNumber": 12,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Use a quadratic optimizations with the peak and its 3 closest neighbors\nto determine the true x,y values of the peak?",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 46,
- "offset": 117
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 46,
- "offset": 117
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 46,
- "offset": 117
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Boolean"
- }
- },
- "default": "false"
- },
- {
- "name": "options.heightFactor",
- "lineNumber": 14,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Factor to multiply the calculated height (usually 2)",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 53,
- "offset": 52
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 53,
- "offset": 52
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 53,
- "offset": 52
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- "default": "0"
- },
- {
- "name": "options.boundaries",
- "lineNumber": 15,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Return also the inflection points of the peaks",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 47,
- "offset": 46
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 47,
- "offset": 46
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 47,
- "offset": 46
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Boolean"
- }
- },
- "default": "false"
- },
- {
- "name": "options.derivativeThreshold",
- "lineNumber": 16,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Filters based on the amplitude of the first derivative",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 55,
- "offset": 54
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 55,
- "offset": 54
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 55,
- "offset": 54
- }
- }
- },
- "type": {
- "type": "OptionalType",
- "expression": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- "default": "0"
- }
- ]
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 1,
- "offset": 0
- }
- }
- },
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "Object"
- }
- ]
- }
- }
- ],
- "name": "gsd",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "gsd",
- "kind": "function"
- }
- ],
- "namespace": "gsd"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/lots-of-options.output.md b/test/fixture/sync/lots-of-options.output.md
deleted file mode 100644
index 55321bdcb..000000000
--- a/test/fixture/sync/lots-of-options.output.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-# gsd
-
-Global spectra deconvolution
-
-**Parameters**
-
-- `x` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** Independent variable
-- `yIn` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** Dependent variable
-- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Options object
- - `options.sgOptions` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Options object for Savitzky-Golay filter. See
- - `options.minMaxRatio` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Threshold to determine if a given peak should be considered as a noise (optional, default `0.00025`)
- - `options.broadRatio` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** If `broadRatio` is higher than 0, then all the peaks which second derivative
- smaller than `broadRatio * maxAbsSecondDerivative` will be marked with the soft mask equal to true. (optional, default `0.00`)
- - `options.noiseLevel` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Noise threshold in spectrum units (optional, default `3`)
- - `options.maxCriteria` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Peaks are local maximum(true) or minimum(false) (optional, default `true`)
- - `options.smoothY` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Select the peak intensities from a smoothed version of the independent variables (optional, default `true`)
- - `options.realTopDetection` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Use a quadratic optimizations with the peak and its 3 closest neighbors
- to determine the true x,y values of the peak? (optional, default `false`)
- - `options.heightFactor` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Factor to multiply the calculated height (usually 2) (optional, default `0`)
- - `options.boundaries` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Return also the inflection points of the peaks (optional, default `false`)
- - `options.derivativeThreshold` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Filters based on the amplitude of the first derivative (optional, default `0`)
-
-Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>**
diff --git a/test/fixture/sync/lots-of-options.output.md.json b/test/fixture/sync/lots-of-options.output.md.json
deleted file mode 100644
index 0be407f12..000000000
--- a/test/fixture/sync/lots-of-options.output.md.json
+++ /dev/null
@@ -1,1420 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "gsd"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Global spectra deconvolution",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 29,
- "offset": 28
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "<"
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- },
- {
- "type": "text",
- "value": ">"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Independent variable",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 21,
- "offset": 20
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "yIn"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "<"
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- },
- {
- "type": "text",
- "value": ">"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Dependent variable",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Options object",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.sgOptions"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Options object for Savitzky-Golay filter. See ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 47,
- "offset": 46
- },
- "indent": []
- }
- },
- {
- "type": "link",
- "title": null,
- "url": "https://github.com/mljs/savitzky-golay-generalized#options",
- "children": [
- {
- "type": "text",
- "value": "https://github.com/mljs/savitzky-golay-generalized#options",
- "position": {
- "start": {
- "line": 1,
- "column": 47,
- "offset": 46
- },
- "end": {
- "line": 1,
- "column": 105,
- "offset": 104
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 47,
- "offset": 46
- },
- "end": {
- "line": 1,
- "column": 105,
- "offset": 104
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 105,
- "offset": 104
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.minMaxRatio"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Threshold to determine if a given peak should be considered as a noise",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 71,
- "offset": 70
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 71,
- "offset": 70
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "0.00025"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.broadRatio"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "If ",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "indent": []
- }
- },
- {
- "type": "inlineCode",
- "value": "broadRatio",
- "position": {
- "start": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "end": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": " is higher than 0, then all the peaks which second derivative\nsmaller than ",
- "position": {
- "start": {
- "line": 1,
- "column": 16,
- "offset": 15
- },
- "end": {
- "line": 2,
- "column": 14,
- "offset": 90
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "inlineCode",
- "value": "broadRatio * maxAbsSecondDerivative",
- "position": {
- "start": {
- "line": 2,
- "column": 14,
- "offset": 90
- },
- "end": {
- "line": 2,
- "column": 51,
- "offset": 127
- },
- "indent": []
- }
- },
- {
- "type": "text",
- "value": " will be marked with the soft mask equal to true.",
- "position": {
- "start": {
- "line": 2,
- "column": 51,
- "offset": 127
- },
- "end": {
- "line": 2,
- "column": 100,
- "offset": 176
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 100,
- "offset": 176
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "0.00"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.noiseLevel"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Noise threshold in spectrum units",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 34,
- "offset": 33
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "3"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.maxCriteria"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Boolean"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Peaks are local maximum(true) or minimum(false)",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 48,
- "offset": 47
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 48,
- "offset": 47
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "true"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.smoothY"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Boolean"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Select the peak intensities from a smoothed version of the independent variables",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 81,
- "offset": 80
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 81,
- "offset": 80
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "true"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.realTopDetection"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Boolean"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Use a quadratic optimizations with the peak and its 3 closest neighbors\nto determine the true x,y values of the peak?",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 46,
- "offset": 117
- },
- "indent": [
- 1
- ]
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 2,
- "column": 46,
- "offset": 117
- },
- "indent": [
- 1
- ]
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "false"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.heightFactor"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Factor to multiply the calculated height (usually 2)",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 53,
- "offset": 52
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 53,
- "offset": 52
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "0"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.boundaries"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Boolean"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Return also the inflection points of the peaks",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 47,
- "offset": 46
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 47,
- "offset": 46
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "false"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "options.derivativeThreshold"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- },
- {
- "type": "text",
- "value": "?"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Filters based on the amplitude of the first derivative",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 55,
- "offset": 54
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 55,
- "offset": 54
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": " (optional, default "
- },
- {
- "type": "inlineCode",
- "value": "0"
- },
- {
- "type": "text",
- "value": ")"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "<"
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Object"
- }
- ]
- },
- {
- "type": "text",
- "value": ">"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/meta.input.js b/test/fixture/sync/meta.input.js
deleted file mode 100644
index 9718fbee9..000000000
--- a/test/fixture/sync/meta.input.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * This function has a lot of metadata
- * @version 1.2.0
- * @author Jim Jones
- * @copyright John Jones
- * @since 1962
- * @license Public Domain
- */
-function dewey(a) {
- return a;
-}
diff --git a/test/fixture/sync/meta.output.json b/test/fixture/sync/meta.output.json
deleted file mode 100644
index 4cc0998e2..000000000
--- a/test/fixture/sync/meta.output.json
+++ /dev/null
@@ -1,182 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function has a lot of metadata",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 36,
- "offset": 35
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 36,
- "offset": 35
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 36,
- "offset": 35
- }
- }
- },
- "tags": [
- {
- "title": "version",
- "description": "1.2.0",
- "lineNumber": 2
- },
- {
- "title": "author",
- "description": "Jim Jones",
- "lineNumber": 3
- },
- {
- "title": "copyright",
- "description": "John Jones",
- "lineNumber": 4
- },
- {
- "title": "since",
- "description": "1962",
- "lineNumber": 5
- },
- {
- "title": "license",
- "description": "Public Domain",
- "lineNumber": 6
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 9,
- "column": 0
- },
- "end": {
- "line": 11,
- "column": 1
- }
- }
- },
- "errors": [],
- "version": "1.2.0",
- "author": "Jim Jones",
- "copyright": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "John Jones",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- }
- }
- },
- "since": "1962",
- "license": "Public Domain",
- "name": "dewey",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "a",
- "lineNumber": 9
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "dewey",
- "kind": "function"
- }
- ],
- "namespace": "dewey"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/meta.output.md b/test/fixture/sync/meta.output.md
deleted file mode 100644
index 97c676fbf..000000000
--- a/test/fixture/sync/meta.output.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-# dewey
-
-This function has a lot of metadata
-
-**Parameters**
-
-- `a`
-
-**Meta**
-
-- **version**: 1.2.0
-- **since**: 1962
-- **copyright**: \[object Object]
-- **author**: Jim Jones
-- **license**: Public Domain
diff --git a/test/fixture/sync/meta.output.md.json b/test/fixture/sync/meta.output.md.json
deleted file mode 100644
index d2fb3424a..000000000
--- a/test/fixture/sync/meta.output.md.json
+++ /dev/null
@@ -1,221 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "dewey"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function has a lot of metadata",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 36,
- "offset": 35
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 36,
- "offset": 35
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Meta"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "version"
- }
- ]
- },
- {
- "type": "text",
- "value": ": 1.2.0"
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "since"
- }
- ]
- },
- {
- "type": "text",
- "value": ": 1962"
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "copyright"
- }
- ]
- },
- {
- "type": "text",
- "value": ": [object Object]"
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "author"
- }
- ]
- },
- {
- "type": "text",
- "value": ": Jim Jones"
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "license"
- }
- ]
- },
- {
- "type": "text",
- "value": ": Public Domain"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/multiexample.input.js b/test/fixture/sync/multiexample.input.js
deleted file mode 100644
index 88227f4df..000000000
--- a/test/fixture/sync/multiexample.input.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * This function returns the number one.
- * @returns {Number} numberone
- * @example
- * foo(1);
- * @example
- * foo(2);
- * @throws {Error} if you give it something
- * @throws {TypeError} if you give it something else
- * @augments Foo
- * @augments Bar
- */
-module.exports = function () {
- // this returns 1
- return 1;
-};
diff --git a/test/fixture/sync/multiexample.output.json b/test/fixture/sync/multiexample.output.json
deleted file mode 100644
index 48fd4a2a7..000000000
--- a/test/fixture/sync/multiexample.output.json
+++ /dev/null
@@ -1,347 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- {
- "title": "example",
- "description": "foo(1);",
- "lineNumber": 3
- },
- {
- "title": "example",
- "description": "foo(2);",
- "lineNumber": 5
- },
- {
- "title": "throws",
- "description": "if you give it something",
- "lineNumber": 7,
- "type": {
- "type": "NameExpression",
- "name": "Error"
- }
- },
- {
- "title": "throws",
- "description": "if you give it something else",
- "lineNumber": 8,
- "type": {
- "type": "NameExpression",
- "name": "TypeError"
- }
- },
- {
- "title": "augments",
- "description": null,
- "lineNumber": 9,
- "type": null,
- "name": "Foo"
- },
- {
- "title": "augments",
- "description": null,
- "lineNumber": 10,
- "type": null,
- "name": "Bar"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 12,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 13,
- "column": 0
- },
- "end": {
- "line": 16,
- "column": 2
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "examples": [
- {
- "description": "foo(1);"
- },
- {
- "description": "foo(2);"
- }
- ],
- "throws": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "if you give it something",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Error"
- }
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "if you give it something else",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 30,
- "offset": 29
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 30,
- "offset": 29
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 30,
- "offset": 29
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "TypeError"
- }
- }
- ],
- "augments": [
- {
- "title": "augments",
- "description": null,
- "lineNumber": 9,
- "type": null,
- "name": "Foo"
- },
- {
- "title": "augments",
- "description": null,
- "lineNumber": 10,
- "type": null,
- "name": "Bar"
- }
- ],
- "name": "multiexample.input",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "multiexample.input",
- "kind": "function"
- }
- ],
- "namespace": "multiexample.input"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/multiexample.output.md b/test/fixture/sync/multiexample.output.md
deleted file mode 100644
index 9090b94d4..000000000
--- a/test/fixture/sync/multiexample.output.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-# multiexample.input
-
-**Extends Foo, Bar**
-
-This function returns the number one.
-
-**Examples**
-
-```javascript
-foo(1);
-```
-
-```javascript
-foo(2);
-```
-
-- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if you give it something
-- Throws **[TypeError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** if you give it something else
-
-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
diff --git a/test/fixture/sync/multiexample.output.md.json b/test/fixture/sync/multiexample.output.md.json
deleted file mode 100644
index b08c2dc91..000000000
--- a/test/fixture/sync/multiexample.output.md.json
+++ /dev/null
@@ -1,299 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "multiexample.input"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Extends "
- },
- {
- "type": "text",
- "value": "Foo, Bar"
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Examples"
- }
- ]
- },
- {
- "lang": "javascript",
- "type": "code",
- "value": "foo(1);"
- },
- {
- "lang": "javascript",
- "type": "code",
- "value": "foo(2);"
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Throws "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Error"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "if you give it something",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 25,
- "offset": 24
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Throws "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "TypeError"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "if you give it something else",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 30,
- "offset": 29
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 30,
- "offset": 29
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/rename.input.js b/test/fixture/sync/rename.input.js
deleted file mode 100644
index 16599b811..000000000
--- a/test/fixture/sync/rename.input.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Cheesoid!
- * @name cheese
- */
-function petrol(): string {
-}
diff --git a/test/fixture/sync/rename.output.json b/test/fixture/sync/rename.output.json
deleted file mode 100644
index 79811ad3c..000000000
--- a/test/fixture/sync/rename.output.json
+++ /dev/null
@@ -1,98 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Cheesoid!",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "tags": [
- {
- "title": "name",
- "description": null,
- "lineNumber": 2,
- "name": "cheese"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 1
- }
- }
- },
- "errors": [],
- "name": "cheese",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "cheese"
- }
- ],
- "namespace": "cheese"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/rename.output.md b/test/fixture/sync/rename.output.md
deleted file mode 100644
index 87c9ed441..000000000
--- a/test/fixture/sync/rename.output.md
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-# cheese
-
-Cheesoid!
diff --git a/test/fixture/sync/rename.output.md.json b/test/fixture/sync/rename.output.md.json
deleted file mode 100644
index bec4f3a8d..000000000
--- a/test/fixture/sync/rename.output.md.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "cheese"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Cheesoid!",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/throws.input.js b/test/fixture/sync/throws.input.js
deleted file mode 100644
index 690c20783..000000000
--- a/test/fixture/sync/throws.input.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * This function returns the number plus two.
- *
- * @param {Number} a the number
- * @returns {Number} numbertwo
- * @throws {Error} if number is 3
- * @example
- * var result = returnTwo(4);
- * // result is 6
- */
-function returnTwo(a) {
- if (a === 3) throw new Error('cannot be 3');
- // this returns a + 2
- return a + 2;
-}
diff --git a/test/fixture/sync/throws.output.json b/test/fixture/sync/throws.output.json
deleted file mode 100644
index 307fcb29b..000000000
--- a/test/fixture/sync/throws.output.json
+++ /dev/null
@@ -1,314 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number plus two.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- }
- }
- },
- "tags": [
- {
- "title": "param",
- "description": "the number",
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- },
- "name": "a"
- },
- {
- "title": "returns",
- "description": "numbertwo",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- },
- {
- "title": "throws",
- "description": "if number is 3",
- "lineNumber": 5,
- "type": {
- "type": "NameExpression",
- "name": "Error"
- }
- },
- {
- "title": "example",
- "description": "var result = returnTwo(4);\n// result is 6",
- "lineNumber": 6
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 11,
- "column": 0
- },
- "end": {
- "line": 15,
- "column": 1
- }
- }
- },
- "errors": [],
- "params": [
- {
- "name": "a",
- "lineNumber": 3,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the number",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numbertwo",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Number"
- }
- }
- ],
- "throws": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "if number is 3",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "Error"
- }
- }
- ],
- "examples": [
- {
- "description": "var result = returnTwo(4);\n// result is 6"
- }
- ],
- "name": "returnTwo",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "returnTwo",
- "kind": "function"
- }
- ],
- "namespace": "returnTwo"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/throws.output.md b/test/fixture/sync/throws.output.md
deleted file mode 100644
index fda184f61..000000000
--- a/test/fixture/sync/throws.output.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-# returnTwo
-
-This function returns the number plus two.
-
-**Parameters**
-
-- `a` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number
-
-**Examples**
-
-```javascript
-var result = returnTwo(4);
-// result is 6
-```
-
-- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if number is 3
-
-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numbertwo
diff --git a/test/fixture/sync/throws.output.md.json b/test/fixture/sync/throws.output.md.json
deleted file mode 100644
index a89bee28b..000000000
--- a/test/fixture/sync/throws.output.md.json
+++ /dev/null
@@ -1,295 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "returnTwo"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number plus two.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 43,
- "offset": 42
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "a"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "the number",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 11,
- "offset": 10
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Examples"
- }
- ]
- },
- {
- "lang": "javascript",
- "type": "code",
- "value": "var result = returnTwo(4);\n// result is 6"
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Throws "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Error"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "if number is 3",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numbertwo",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/trailing-only.input.js b/test/fixture/sync/trailing-only.input.js
deleted file mode 100644
index b2571bd84..000000000
--- a/test/fixture/sync/trailing-only.input.js
+++ /dev/null
@@ -1,7 +0,0 @@
-function fooBaz() {
- return 2;
-}
-/**
- * this is a type
- * @returns {number} nothing
- */
diff --git a/test/fixture/sync/trailing-only.output.json b/test/fixture/sync/trailing-only.output.json
deleted file mode 100644
index eaebb188b..000000000
--- a/test/fixture/sync/trailing-only.output.json
+++ /dev/null
@@ -1,162 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "this is a type",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "nothing",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 1
- }
- }
- },
- "errors": [
- {
- "message": "could not determine @name for hierarchy"
- }
- ],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "nothing",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 8,
- "offset": 7
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 8,
- "offset": 7
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 8,
- "offset": 7
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {}
- ],
- "namespace": "undefined"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/trailing-only.output.md b/test/fixture/sync/trailing-only.output.md
deleted file mode 100644
index 1997477f4..000000000
--- a/test/fixture/sync/trailing-only.output.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-#
-
-this is a type
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** nothing
diff --git a/test/fixture/sync/trailing-only.output.md.json b/test/fixture/sync/trailing-only.output.md.json
deleted file mode 100644
index ba50618be..000000000
--- a/test/fixture/sync/trailing-only.output.md.json
+++ /dev/null
@@ -1,118 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": ""
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "this is a type",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "nothing",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 8,
- "offset": 7
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 8,
- "offset": 7
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/trailing.input.js b/test/fixture/sync/trailing.input.js
deleted file mode 100644
index 5e11b97c0..000000000
--- a/test/fixture/sync/trailing.input.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * ONE
- * @returns {number} something
- */
-function fooBar() {
- return 1;
-}
-/**
- * TWO
- * @returns {number} something
- */
-function fooBaz() {
- return 2;
-}
-/**
- * this is a type
- * @class Something
- */
diff --git a/test/fixture/sync/trailing.output.json b/test/fixture/sync/trailing.output.json
deleted file mode 100644
index c2bd778d3..000000000
--- a/test/fixture/sync/trailing.output.json
+++ /dev/null
@@ -1,423 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "ONE",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "something",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 1
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "something",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "fooBar",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "fooBar",
- "kind": "function"
- }
- ],
- "namespace": "fooBar"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "TWO",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "something",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 8,
- "column": 0
- },
- "end": {
- "line": 11,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 12,
- "column": 0
- },
- "end": {
- "line": 14,
- "column": 1
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "something",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "fooBaz",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "fooBaz",
- "kind": "function"
- }
- ],
- "namespace": "fooBaz"
- },
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "this is a type",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- }
- }
- },
- "tags": [
- {
- "title": "class",
- "description": null,
- "lineNumber": 2,
- "type": null,
- "name": "Something"
- }
- ],
- "loc": {
- "start": {
- "line": 15,
- "column": 0
- },
- "end": {
- "line": 18,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 12,
- "column": 0
- },
- "end": {
- "line": 14,
- "column": 1
- }
- }
- },
- "errors": [],
- "kind": "class",
- "name": "Something",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Something",
- "kind": "class"
- }
- ],
- "namespace": "Something"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/trailing.output.md b/test/fixture/sync/trailing.output.md
deleted file mode 100644
index fbd87c100..000000000
--- a/test/fixture/sync/trailing.output.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-# fooBar
-
-ONE
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** something
-
-# fooBaz
-
-TWO
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** something
-
-# Something
-
-this is a type
diff --git a/test/fixture/sync/trailing.output.md.json b/test/fixture/sync/trailing.output.md.json
deleted file mode 100644
index 4858cb671..000000000
--- a/test/fixture/sync/trailing.output.md.json
+++ /dev/null
@@ -1,272 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "fooBar"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "ONE",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "something",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "fooBaz"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "TWO",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 4,
- "offset": 3
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "something",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Something"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "this is a type",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 15,
- "offset": 14
- },
- "indent": []
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/sync/typedef.input.js b/test/fixture/sync/typedef.input.js
deleted file mode 100644
index 2747c8de7..000000000
--- a/test/fixture/sync/typedef.input.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * A type definition.
- * @name MyType
- * @typedef {Object} MyType
- * @property {number} prop1 - one property
- * @property {string} prop2 - another property
- */
-
diff --git a/test/fixture/sync/typedef.output.json b/test/fixture/sync/typedef.output.json
deleted file mode 100644
index d1199fe40..000000000
--- a/test/fixture/sync/typedef.output.json
+++ /dev/null
@@ -1,256 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A type definition.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- }
- }
- },
- "tags": [
- {
- "title": "name",
- "description": null,
- "lineNumber": 2,
- "name": "MyType"
- },
- {
- "title": "typedef",
- "description": null,
- "lineNumber": 3,
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "name": "MyType"
- },
- {
- "title": "property",
- "description": "one property",
- "lineNumber": 4,
- "type": {
- "type": "NameExpression",
- "name": "number"
- },
- "name": "prop1"
- },
- {
- "title": "property",
- "description": "another property",
- "lineNumber": 5,
- "type": {
- "type": "NameExpression",
- "name": "string"
- },
- "name": "prop2"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 0
- }
- }
- },
- "errors": [],
- "name": "MyType",
- "kind": "typedef",
- "type": {
- "type": "NameExpression",
- "name": "Object"
- },
- "properties": [
- {
- "name": "prop1",
- "lineNumber": 4,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "one property",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- },
- {
- "name": "prop2",
- "lineNumber": 5,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "another property",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "string"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "MyType",
- "kind": "typedef"
- }
- ],
- "namespace": "MyType"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/sync/typedef.output.md b/test/fixture/sync/typedef.output.md
deleted file mode 100644
index e2ed3269d..000000000
--- a/test/fixture/sync/typedef.output.md
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-# MyType
-
-A type definition.
-
-**Properties**
-
-- `prop1` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** one property
-- `prop2` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** another property
diff --git a/test/fixture/sync/typedef.output.md.json b/test/fixture/sync/typedef.output.md.json
deleted file mode 100644
index cefb610d6..000000000
--- a/test/fixture/sync/typedef.output.md.json
+++ /dev/null
@@ -1,215 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "MyType"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "A type definition.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 19,
- "offset": 18
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Properties"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "prop1"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "one property",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 13,
- "offset": 12
- },
- "indent": []
- }
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "prop2"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "another property",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 17,
- "offset": 16
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/system-import.input.js b/test/fixture/system-import.input.js
deleted file mode 100644
index 95fd643be..000000000
--- a/test/fixture/system-import.input.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * System.import is a webpack convention
- * https://github.com/documentationjs/documentation/issues/578
- */
-System.import("./simple.input.js").then(() => {});
diff --git a/test/fixture/system-import.output.json b/test/fixture/system-import.output.json
deleted file mode 100644
index ee6fd4cc9..000000000
--- a/test/fixture/system-import.output.json
+++ /dev/null
@@ -1,163 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- }
- }
- },
- "tags": [
- {
- "title": "returns",
- "description": "numberone",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 4,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 5,
- "column": 0
- },
- "end": {
- "line": 8,
- "column": 2
- }
- }
- },
- "errors": [],
- "returns": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- }
- }
- },
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "name": "simple.input",
- "kind": "function",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "simple.input",
- "kind": "function"
- }
- ],
- "namespace": "simple.input"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/system-import.output.md b/test/fixture/system-import.output.md
deleted file mode 100644
index 55ce13e20..000000000
--- a/test/fixture/system-import.output.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-# simple.input
-
-This function returns the number one.
-
-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
diff --git a/test/fixture/system-import.output.md.json b/test/fixture/system-import.output.md.json
deleted file mode 100644
index 6f30c7d2d..000000000
--- a/test/fixture/system-import.output.md.json
+++ /dev/null
@@ -1,118 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "simple.input"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "This function returns the number one.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 38,
- "offset": 37
- },
- "indent": []
- }
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "numberone",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 10,
- "offset": 9
- },
- "indent": []
- }
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/this-class.input.js b/test/fixture/this-class.input.js
deleted file mode 100644
index b55ddb699..000000000
--- a/test/fixture/this-class.input.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/** @module bookshelf */
-
-/** @class */
-var Book = function(title) {
- /** The title of the book. */
- this.title = title;
-}
-
-/** @class */
-this.BookShelf = function(title) {
- /** The title of the bookshelf. */
- this.title = title;
-}
diff --git a/test/fixture/this-class.output.json b/test/fixture/this-class.output.json
deleted file mode 100644
index e6c5bf031..000000000
--- a/test/fixture/this-class.output.json
+++ /dev/null
@@ -1,361 +0,0 @@
-[
- {
- "description": "",
- "tags": [
- {
- "title": "module",
- "description": null,
- "lineNumber": 0,
- "type": null,
- "name": "bookshelf"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 1,
- "column": 24
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 1
- }
- }
- },
- "errors": [],
- "kind": "module",
- "name": "bookshelf",
- "params": [
- {
- "title": "param",
- "name": "title",
- "lineNumber": 4
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "bookshelf",
- "kind": "module"
- }
- ],
- "namespace": "bookshelf"
- },
- {
- "description": "",
- "tags": [
- {
- "title": "class",
- "description": null,
- "lineNumber": 0,
- "name": null
- }
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 0
- },
- "end": {
- "line": 3,
- "column": 13
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 4,
- "column": 0
- },
- "end": {
- "line": 7,
- "column": 1
- }
- }
- },
- "errors": [],
- "kind": "class",
- "name": "Book",
- "params": [
- {
- "title": "param",
- "name": "title",
- "lineNumber": 4
- }
- ],
- "members": {
- "instance": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The title of the book.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 5,
- "column": 4
- },
- "end": {
- "line": 5,
- "column": 33
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 6,
- "column": 3
- },
- "end": {
- "line": 6,
- "column": 22
- }
- }
- },
- "errors": [],
- "name": "title",
- "memberof": "Book",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Book",
- "kind": "class"
- },
- {
- "name": "title",
- "scope": "instance"
- }
- ],
- "namespace": "Book#title"
- }
- ],
- "static": [],
- "events": []
- },
- "path": [
- {
- "name": "Book",
- "kind": "class"
- }
- ],
- "namespace": "Book"
- },
- {
- "description": "",
- "tags": [
- {
- "title": "class",
- "description": null,
- "lineNumber": 0,
- "name": null
- }
- ],
- "loc": {
- "start": {
- "line": 9,
- "column": 0
- },
- "end": {
- "line": 9,
- "column": 13
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 13,
- "column": 1
- }
- }
- },
- "errors": [],
- "kind": "class",
- "name": "BookShelf",
- "params": [
- {
- "title": "param",
- "name": "title",
- "lineNumber": 10
- }
- ],
- "members": {
- "instance": [
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The title of the bookshelf.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- }
- }
- },
- "tags": [],
- "loc": {
- "start": {
- "line": 11,
- "column": 4
- },
- "end": {
- "line": 11,
- "column": 38
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 12,
- "column": 3
- },
- "end": {
- "line": 12,
- "column": 22
- }
- }
- },
- "errors": [],
- "name": "title",
- "memberof": "BookShelf",
- "scope": "instance",
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "BookShelf",
- "kind": "class"
- },
- {
- "name": "title",
- "scope": "instance"
- }
- ],
- "namespace": "BookShelf#title"
- }
- ],
- "static": [],
- "events": []
- },
- "path": [
- {
- "name": "BookShelf",
- "kind": "class"
- }
- ],
- "namespace": "BookShelf"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/this-class.output.md b/test/fixture/this-class.output.md
deleted file mode 100644
index 58972fd9b..000000000
--- a/test/fixture/this-class.output.md
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-# bookshelf
-
-**Parameters**
-
-- `title`
-
-# Book
-
-**Parameters**
-
-- `title`
-
-## title
-
-The title of the book.
-
-# BookShelf
-
-**Parameters**
-
-- `title`
-
-## title
-
-The title of the bookshelf.
diff --git a/test/fixture/this-class.output.md.json b/test/fixture/this-class.output.md.json
deleted file mode 100644
index 0af859a69..000000000
--- a/test/fixture/this-class.output.md.json
+++ /dev/null
@@ -1,240 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "bookshelf"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "title"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Book"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "title"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "title"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The title of the book.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "BookShelf"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "title"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "depth": 2,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "title"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "The title of the bookshelf.",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 28,
- "offset": 27
- },
- "indent": []
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/type_application.output.json b/test/fixture/type_application.output.json
deleted file mode 100644
index 04ec75331..000000000
--- a/test/fixture/type_application.output.json
+++ /dev/null
@@ -1,191 +0,0 @@
-[
- {
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Represents an IPv6 address",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- }
- }
- },
- "tags": [
- {
- "title": "class",
- "description": null,
- "lineNumber": 2,
- "type": null,
- "name": "Address6"
- },
- {
- "title": "param",
- "description": "An IPv6 address string",
- "lineNumber": 3,
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "string"
- }
- ]
- },
- "name": "address"
- }
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 3
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 6,
- "column": 0
- }
- }
- },
- "errors": [],
- "kind": "class",
- "name": "Address6",
- "params": [
- {
- "name": "address",
- "lineNumber": 3,
- "description": {
- "type": "root",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "An IPv6 address string",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- }
- }
- },
- "type": {
- "type": "TypeApplication",
- "expression": {
- "type": "NameExpression",
- "name": "Array"
- },
- "applications": [
- {
- "type": "NameExpression",
- "name": "string"
- }
- ]
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "Address6",
- "kind": "class"
- }
- ],
- "namespace": "Address6"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/type_application.output.md b/test/fixture/type_application.output.md
deleted file mode 100644
index d0a37c275..000000000
--- a/test/fixture/type_application.output.md
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-# Address6
-
-Represents an IPv6 address
-
-**Parameters**
-
-- `address` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** An IPv6 address string
diff --git a/test/fixture/type_application.output.md.json b/test/fixture/type_application.output.md.json
deleted file mode 100644
index 278ea5479..000000000
--- a/test/fixture/type_application.output.md.json
+++ /dev/null
@@ -1,161 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Address6"
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Represents an IPv6 address",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 27,
- "offset": 26
- },
- "indent": []
- }
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "address"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "Array"
- }
- ]
- },
- {
- "type": "text",
- "value": "<"
- },
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "string"
- }
- ]
- },
- {
- "type": "text",
- "value": ">"
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "An IPv6 address string",
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ],
- "position": {
- "start": {
- "line": 1,
- "column": 1,
- "offset": 0
- },
- "end": {
- "line": 1,
- "column": 23,
- "offset": 22
- },
- "indent": []
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/fixture/var-function-param-return.input.js b/test/fixture/var-function-param-return.input.js
deleted file mode 100644
index bc3fcce7d..000000000
--- a/test/fixture/var-function-param-return.input.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/** */
-var f = function(x: number): boolean {}
diff --git a/test/fixture/var-function-param-return.output.json b/test/fixture/var-function-param-return.output.json
deleted file mode 100644
index 3594637a0..000000000
--- a/test/fixture/var-function-param-return.output.json
+++ /dev/null
@@ -1,61 +0,0 @@
-[
- {
- "description": "",
- "tags": [],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 1,
- "column": 6
- }
- },
- "context": {
- "loc": {
- "start": {
- "line": 2,
- "column": 0
- },
- "end": {
- "line": 2,
- "column": 39
- }
- }
- },
- "errors": [],
- "name": "f",
- "kind": "function",
- "params": [
- {
- "title": "param",
- "name": "x",
- "lineNumber": 2,
- "type": {
- "type": "NameExpression",
- "name": "number"
- }
- }
- ],
- "returns": [
- {
- "type": {
- "type": "NameExpression",
- "name": "boolean"
- }
- }
- ],
- "members": {
- "instance": [],
- "static": []
- },
- "path": [
- {
- "name": "f",
- "kind": "function"
- }
- ],
- "namespace": "f"
- }
-]
\ No newline at end of file
diff --git a/test/fixture/var-function-param-return.output.md b/test/fixture/var-function-param-return.output.md
deleted file mode 100644
index dc2fd69e0..000000000
--- a/test/fixture/var-function-param-return.output.md
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-# f
-
-**Parameters**
-
-- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-
-Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
diff --git a/test/fixture/var-function-param-return.output.md.json b/test/fixture/var-function-param-return.output.md.json
deleted file mode 100644
index ac9fb9874..000000000
--- a/test/fixture/var-function-param-return.output.md.json
+++ /dev/null
@@ -1,101 +0,0 @@
-{
- "type": "root",
- "children": [
- {
- "type": "html",
- "value": ""
- },
- {
- "depth": 1,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "f"
- }
- ]
- },
- {
- "type": "strong",
- "children": [
- {
- "type": "text",
- "value": "Parameters"
- }
- ]
- },
- {
- "ordered": false,
- "type": "list",
- "children": [
- {
- "type": "listItem",
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "inlineCode",
- "value": "x"
- },
- {
- "type": "text",
- "value": " "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "number"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "paragraph",
- "children": [
- {
- "type": "text",
- "value": "Returns "
- },
- {
- "type": "strong",
- "children": [
- {
- "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
- "type": "link",
- "children": [
- {
- "type": "text",
- "value": "boolean"
- }
- ]
- }
- ]
- },
- {
- "type": "text",
- "value": " "
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/test/format_type.js b/test/format_type.js
deleted file mode 100644
index 570a627d5..000000000
--- a/test/format_type.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*eslint max-len: 0 */
-'use strict';
-
-var _formatType = require('../lib/output/util/format_type'),
- createLinkerStack = require('../lib/output/util/linker_stack'),
- remark = require('remark'),
- parse = require('doctrine').parse,
- test = require('tap').test;
-
-function stringify(children) {
- return remark().stringify({
- type: 'paragraph',
- children: children
- });
-}
-
-test('formatType', function (t) {
- var linkerStack = createLinkerStack({});
- var formatType = _formatType.bind(undefined, linkerStack.link);
- [
- ['Foo', 'Foo'],
- ['null', 'null'],
- ['null', 'null'],
- ['*', 'any'],
- ['Array|undefined', '([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \\| [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined))'],
- ['Array', '[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>'],
- ['number!', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)!'],
- ['function(string, boolean)', 'function ([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))'],
- ['function(string, boolean): number', 'function ([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)): [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)'],
- ['function()', 'function ()'],
- ['function(this:something, string)', 'function (this: something, [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))'],
- ['function(new:something)', 'function (new: something)'],
- ['{myNum: number, myObject}', '{myNum: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), myObject}'],
- ['[string,]', '\\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]'],
- ['number?', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?'],
- ['number', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)'],
- ['?', '?'],
- ['void', 'void'],
- ['function(a:b)', 'function (a: b)'],
- ['function(a):void', 'function (a): void'],
- ['number=', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?'],
- ['...number', '...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)'],
- ['undefined', '[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)']
- ].forEach(function (example) {
- t.deepEqual(stringify(formatType(
- parse('@param {' + example[0] + '} a', { sloppy: true }).tags[0].type)
- ), example[1], example[0]);
- });
-
- t.deepEqual(stringify(formatType(
- parse('@param {number} [a=1]', { sloppy: true }).tags[0].type)
- ), '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?', 'default');
-
- t.deepEqual(stringify(_formatType(function (str) {
- return str.toUpperCase();
- }, parse('@param {Foo} a', {
- sloppy: true
- }).tags[0].type)), '[Foo](FOO)', 'with custom linker');
-
- t.deepEqual(stringify(formatType()), 'any', 'empty case');
-
- t.throws(function () {
- formatType({});
- });
-
- t.end();
-});
diff --git a/test/lib/filter_access.js b/test/lib/filter_access.js
deleted file mode 100644
index 55a8f500d..000000000
--- a/test/lib/filter_access.js
+++ /dev/null
@@ -1,82 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- filterAccess = require('../../lib/filter_access');
-
-test('filterAccess ignore', function (t) {
- t.deepEqual(filterAccess(['public', 'protected', 'undefined'], [{
- access: 'public',
- ignore: true
- }]), []);
- t.end();
-});
-
-test('filterAccess public, protected, undefined, no private', function (t) {
- t.deepEqual(filterAccess(['public', 'protected', 'undefined'], [{
- access: 'public'
- }, {
- access: 'protected'
- }, {
- foo: 2
- }, {
- access: 'private'
- }]), [{
- access: 'public'
- }, {
- access: 'protected'
- }, {
- foo: 2
- }]);
- t.end();
-});
-
-test('filterAccess explicit public', function (t) {
- t.deepEqual(filterAccess(['public'], [
- { access: 'public' },
- { access: 'protected' },
- { foo: 2 },
- { access: 'private' }]),
- [{
- access: 'public'
- }]);
- t.end();
-});
-
-test('filterAccess override', function (t) {
- t.deepEqual(filterAccess(['private'], [{
- access: 'private'
- }]), [{
- access: 'private'
- }]);
- t.end();
-});
-
-test('filterAccess nesting', function (t) {
- t.deepEqual(filterAccess(['public', 'protected', 'undefined'], [{
- access: 'public',
- members: {
- static: [{
- access: 'public'
- }, {
- access: 'private'
- }]
- }
- }, {
- access: 'private',
- members: {
- static: [{
- access: 'public'
- }, {
- access: 'private'
- }]
- }
- }]), [{
- access: 'public',
- members: {
- static: [{
- access: 'public'
- }]
- }
- }]);
- t.end();
-});
diff --git a/test/lib/flow_doctrine.js b/test/lib/flow_doctrine.js
deleted file mode 100644
index 67ce55eaa..000000000
--- a/test/lib/flow_doctrine.js
+++ /dev/null
@@ -1,234 +0,0 @@
-'use strict';
-
-var flowDoctrine = require('../../lib/flow_doctrine.js'),
- parse = require('../../lib/parsers/javascript'),
- FLOW_TYPES = require('babel-types').FLOW_TYPES,
- test = require('tap').test;
-
-function toComment(fn, filename) {
- return parse({
- file: filename,
- source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
- })[0];
-}
-
-
-
-test('flowDoctrine', function (t) {
-
- var types = FLOW_TYPES.filter(function (type) {
- return type.match(/\wTypeAnnotation$/);
- });
-
- function toDoctrineType(flowType) {
- var annotation = toComment(
- '/** add */function add(a: ' + flowType + ' ) { }'
- ).context.ast.node.params[0].typeAnnotation.typeAnnotation;
- if (types.indexOf(annotation.type) !== -1) {
- types.splice(types.indexOf(annotation.type), 1);
- }
- return flowDoctrine(annotation);
- }
-
- t.deepEqual(toDoctrineType('number'),
- {
- type: 'NameExpression',
- name: 'number'
- }, 'number');
-
- t.deepEqual(toDoctrineType('string'),
- {
- type: 'NameExpression',
- name: 'string'
- }, 'string');
-
- t.deepEqual(toDoctrineType('any'),
- {
- type: 'AllLiteral'
- }, 'all');
-
- t.deepEqual(toDoctrineType('(y:Foo) => Bar'),
- {
- type: 'FunctionType',
- params: [{
- type: 'ParameterType',
- name: 'y',
- expression: {
- type: 'NameExpression',
- name: 'Foo'
- }
- }],
- result: {
- type: 'NameExpression',
- name: 'Bar'
- }
- }, 'function type');
-
- t.deepEqual(toDoctrineType('?number'),
- {
- type: 'NullableType',
- expression: {
- type: 'NameExpression',
- name: 'number'
- }
- }, 'nullable');
-
- t.deepEqual(toDoctrineType('number | string'),
- {
- type: 'UnionType',
- elements: [
- {
- type: 'NameExpression',
- name: 'number'
- },
- {
- type: 'NameExpression',
- name: 'string'
- }
- ]
- }, 'union');
-
- t.deepEqual(toDoctrineType('Object'),
- {
- type: 'NameExpression',
- name: 'Object'
- }, 'object');
-
- t.deepEqual(toDoctrineType('{ a: 1 }'),
- {
- type: 'RecordType',
- fields: [{
- type: 'FieldType',
- key: 'a',
- value: {
- type: 'NumericLiteralType',
- value: 1
- }
- }]
- }, 'object with properties');
-
- t.deepEqual(toDoctrineType('mixed'),
- {
- type: 'AllLiteral'
- }, 'alias mixed to any for now');
-
- t.deepEqual(toDoctrineType('Array'),
- {
- type: 'NameExpression',
- name: 'Array'
- }, 'array');
-
- t.deepEqual(toDoctrineType('Array'),
- {
- type: 'TypeApplication',
- expression: {
- type: 'NameExpression',
- name: 'Array'
- },
- applications: [{
- type: 'NameExpression',
- name: 'number'
- }]
- }, 'Array');
-
- t.deepEqual(toDoctrineType('number[]'),
- {
- type: 'TypeApplication',
- expression: {
- type: 'NameExpression',
- name: 'Array'
- },
- applications: [{
- type: 'NameExpression',
- name: 'number'
- }]
- }, 'number[]');
-
- t.deepEqual(toDoctrineType('[]'),
- {
- type: 'ArrayType',
- elements: []
- }, '[]');
-
- t.deepEqual(toDoctrineType('[number]'),
- {
- type: 'ArrayType',
- elements: [
- {
- type: 'NameExpression',
- name: 'number'
- }
- ]
- }, '[number]');
-
- t.deepEqual(toDoctrineType('[string, boolean]'),
- {
- type: 'ArrayType',
- elements: [
- {
- type: 'NameExpression',
- name: 'string'
- },
- {
- type: 'NameExpression',
- name: 'boolean'
- }
- ]
- }, '[string, boolean]');
-
- t.deepEqual(toDoctrineType('boolean'),
- {
- type: 'NameExpression',
- name: 'boolean'
- }, 'boolean');
-
- t.deepEqual(toDoctrineType('undefined'),
- {
- type: 'NameExpression',
- name: 'undefined'
- }, 'undefined');
-
- t.deepEqual(toDoctrineType('"value"'),
- {
- type: 'StringLiteralType',
- value: 'value'
- }, 'StringLiteralType');
-
- t.deepEqual(toDoctrineType('1'),
- {
- type: 'NumericLiteralType',
- value: '1'
- }, 'NumericLiteralType');
-
- t.deepEqual(toDoctrineType('true'),
- {
- type: 'BooleanLiteralType',
- value: true
- }, 'BooleanLiteralType');
-
- t.deepEqual(toDoctrineType('false'),
- {
- type: 'BooleanLiteralType',
- value: false
- }, 'BooleanLiteralType');
-
- t.deepEqual(toDoctrineType('null'),
- {
- type: 'NullLiteral',
- }, 'NullLiteral');
-
- t.deepEqual(toDoctrineType('void'),
- {
- type: 'VoidLiteral',
- }, 'VoidLiteral');
-
- // TODO: remove all these types
- t.deepEqual(types, [
- 'IntersectionTypeAnnotation',
- 'EmptyTypeAnnotation',
- 'ThisTypeAnnotation',
- 'TypeofTypeAnnotation'
- ], 'Type coverage');
-
- t.end();
-});
diff --git a/test/lib/git/find_git.js b/test/lib/git/find_git.js
deleted file mode 100644
index 79f6d8cf5..000000000
--- a/test/lib/git/find_git.js
+++ /dev/null
@@ -1,21 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- mock = require('mock-fs'),
- mockRepo = require('./mock_repo'),
- findGit = require('../../../lib/git/find_git');
-
-test('findGit', function (t) {
-
- mock(mockRepo.master);
-
- t.equal(
- findGit(
- '/my/repository/path/index.js'),
- '/my/repository/path/.git', 'finds git path');
-
- mock.restore();
-
- t.end();
-});
-
diff --git a/test/lib/git/mock_repo.js b/test/lib/git/mock_repo.js
deleted file mode 100644
index a4b3d3fe4..000000000
--- a/test/lib/git/mock_repo.js
+++ /dev/null
@@ -1,67 +0,0 @@
-module.exports = {
- master: {
- '/my': {
- repository: {
- path: {
- '.git': {
- 'HEAD': 'ref: refs/heads/master',
- 'config': '[remote "origin"]\n' +
- 'url = git@github.com:foo/bar.git\n' +
- 'fetch = +refs/heads/*:refs/remotes/origin/*',
- refs: {
- heads: {
- master: 'this_is_the_sha'
- }
- }
- },
- 'index.js': 'module.exports = 42;'
- }
- }
- }
- },
- detached: {
- '/my': {
- repository: {
- path: {
- '.git': {
- 'HEAD': 'e4cb2ffe677571d0503e659e4e64e01f45639c62',
- 'config': '[remote "origin"]\n' +
- 'url = git@github.com:foo/bar.git\n' +
- 'fetch = +refs/heads/*:refs/remotes/origin/*'
- },
- 'index.js': 'module.exports = 42;'
- }
- }
- }
- },
- malformed: {
- '/my': {
- repository: {
- path: {
- '.git': {},
- 'index.js': 'module.exports = 42;'
- }
- }
- }
- },
- enterprise: {
- '/my': {
- repository: {
- path: {
- '.git': {
- 'HEAD': 'ref: refs/heads/master',
- 'config': '[remote "origin"]\n' +
- 'url = git@github.enterprise.com:foo/bar.git\n' +
- 'fetch = +refs/heads/*:refs/remotes/origin/*',
- refs: {
- heads: {
- master: 'this_is_the_sha'
- }
- }
- },
- 'index.js': 'module.exports = 42;'
- }
- }
- }
- }
-};
diff --git a/test/lib/git/url_prefix.js b/test/lib/git/url_prefix.js
deleted file mode 100644
index 921efc198..000000000
--- a/test/lib/git/url_prefix.js
+++ /dev/null
@@ -1,41 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- mock = require('mock-fs'),
- mockRepo = require('./mock_repo'),
- getGithubURLPrefix = require('../../../lib/git/url_prefix'),
- parsePackedRefs = getGithubURLPrefix.parsePackedRefs;
-
-test('getGithubURLPrefix', function (t) {
-
- mock(mockRepo.master);
-
- t.equal(
- getGithubURLPrefix(
- '/my/repository/path/'),
- 'https://github.com/foo/bar/blob/this_is_the_sha/',
- 'finds git path on master branch');
-
- mock.restore();
-
- mock(mockRepo.detached);
-
- t.equal(
- getGithubURLPrefix(
- '/my/repository/path/'),
- 'https://github.com/foo/bar/blob/e4cb2ffe677571d0503e659e4e64e01f45639c62/',
- 'finds git path with a detached head');
-
- mock.restore();
-
- t.end();
-});
-
-test('parsePackedRefs', function (t) {
- var input = '# pack-refs with: peeled fully-peeled\n' +
- '4acd658617928bd17ae7364ef2512630d97c007a refs/heads/babel-6\n' +
- '11826ad98c6c08d00f4af77f64d3e2687e0f7dba refs/remotes/origin/flow-types';
- t.equal(parsePackedRefs(input, 'refs/heads/babel-6'),
- '4acd658617928bd17ae7364ef2512630d97c007a', 'Finds babel 6 ref');
- t.end();
-});
diff --git a/test/lib/github.js b/test/lib/github.js
deleted file mode 100644
index 2d623f695..000000000
--- a/test/lib/github.js
+++ /dev/null
@@ -1,81 +0,0 @@
-'use strict';
-
-/* eslint no-unused-vars: 0 */
-
-var test = require('tap').test,
- mock = require('mock-fs'),
- mockRepo = require('./git/mock_repo'),
- parse = require('../../lib/parsers/javascript'),
- github = require('../../lib/github');
-
-function toComment(fn, filename) {
- return parse({
- file: filename,
- source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
- }).map(github);
-}
-
-function evaluate(fn) {
- return toComment(fn, '/my/repository/path/index.js');
-}
-
-test('github', function (t) {
-
- mock(mockRepo.master);
-
- t.equal(evaluate(function () {
- /**
- * get one
- * @returns {number} one
- */
- function getOne() {
- return 1;
- }
- })[0].context.github,
- 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8',
- 'gets github url');
-
- mock.restore();
-
- t.end();
-});
-
-test('malformed repository', function (t) {
-
- mock(mockRepo.malformed);
-
- t.equal(evaluate(function () {
- /**
- * get one
- * @returns {number} one
- */
- function getOne() {
- return 1;
- }
- })[0].context.github, undefined, 'does not crash');
-
- mock.restore();
-
- t.end();
-});
-
-test('enterprise repository', function (t) {
-
- mock(mockRepo.enterprise);
-
- t.equal(evaluate(function () {
- /**
- * get one
- * @returns {number} one
- */
- function getOne() {
- return 1;
- }
- })[0].context.github,
- 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8',
- 'gets github enterprise url');
-
- mock.restore();
-
- t.end();
-});
diff --git a/test/lib/hierarchy.js b/test/lib/hierarchy.js
deleted file mode 100644
index 779d08c1a..000000000
--- a/test/lib/hierarchy.js
+++ /dev/null
@@ -1,187 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- parse = require('../../lib/parsers/javascript'),
- hierarchy = require('../../lib/hierarchy');
-
-function toComments(fn, filename) {
- return parse({
- file: filename || 'test.js',
- source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
- });
-}
-
-function evaluate(fn, callback) {
- return hierarchy(toComments(fn, callback));
-}
-
-function map(arr, prop) {
- return arr.map(function (item) {
- return item[prop];
- });
-}
-
-test('hierarchy', function (t) {
- var comments = evaluate(function () {
- /**
- * @name Class
- * @class
- */
-
- /**
- * @name getFoo
- * @memberof Class
- * @instance
- */
-
- /**
- * @name isClass
- * @memberof Class
- * @static
- */
-
- /**
- * @name MAGIC_NUMBER
- * @memberof Class
- */
-
- /**
- * @name event
- * @memberof Class
- * @kind event
- * @instance
- */
- });
-
- t.deepEqual(map(comments, 'name'), ['Class']);
-
- var classMembers = comments[0].members;
-
- t.deepEqual(map(classMembers.static, 'name'), ['isClass', 'MAGIC_NUMBER']);
- t.deepEqual(map(classMembers.instance, 'name'), ['getFoo']);
-
- t.deepEqual(map(classMembers.static[0].path, 'name'), ['Class', 'isClass']);
- t.deepEqual(map(classMembers.instance[0].path, 'name'), ['Class', 'getFoo']);
- t.deepEqual(map(classMembers.events[0].path, 'name'), ['Class', 'event']);
-
- t.end();
-});
-
-test('hierarchy - nesting', function (t) {
- var comments = evaluate(function () {
- /**
- * @name Parent
- * @class
- */
-
- /**
- * @name enum
- * @memberof Parent
- */
-
- /**
- * @name Parent
- * @memberof Parent.enum
- */
-
- /**
- * @name Child
- * @memberof Parent.enum
- */
- });
-
- t.deepEqual(map(comments, 'name'), ['Parent']);
-
- var classMembers = comments[0].members;
- t.deepEqual(map(classMembers.static, 'name'), ['enum']);
-
- var enumMembers = classMembers.static[0].members;
- t.deepEqual(map(enumMembers.static, 'name'), ['Parent', 'Child']);
- t.deepEqual(map(enumMembers.static[0].path, 'name'), ['Parent', 'enum', 'Parent']);
- t.deepEqual(map(enumMembers.static[1].path, 'name'), ['Parent', 'enum', 'Child']);
-
- t.end();
-});
-
-test('hierarchy - multisignature', function (t) {
- var comments = evaluate(function () {
- /**
- * @name Parent
- * @class
- */
-
- /**
- * @name foo
- * @memberof Parent
- * @instance
- */
-
- /**
- * @name foo
- * @memberof Parent
- * @instance
- */
- });
-
- t.deepEqual(map(comments[0].members.instance, 'name'), ['foo', 'foo']);
- t.end();
-});
-
-test('hierarchy - missing memberof', function (t) {
- var test = evaluate(function () {
- /**
- * @name test
- * @memberof DoesNotExist
- */
- })[0];
-
- t.deepEqual(test.errors, [{
- message: '@memberof reference to DoesNotExist not found',
- commentLineNumber: 2
- }], 'correct error message');
- t.end();
-});
-
-test('hierarchy - anonymous', function (t) {
- var result = evaluate(function () {
- /** Test */
- })[0];
-
- t.deepEqual(result.errors, [{
- message: 'could not determine @name for hierarchy'
- }]);
- t.end();
-});
-
-test('hierarchy - object prototype member names', function (t) {
- var comments = evaluate(function () {
- /**
- * @name should
- * @function
- */
-
- /**
- * @name Assertion
- * @class
- * @memberof should
- */
-
- /**
- * @name hasOwnProperty
- * @memberof should.Assertion
- * @instance
- * @function
- **/
-
- /**
- * @name otherMethod
- * @memberof should.Assertion
- * @instance
- * @function
- **/
- });
-
- t.deepEqual(map(comments[0].members.static[0].members.instance, 'name'), [ 'hasOwnProperty', 'otherMethod' ]);
-
- t.end();
-});
diff --git a/test/lib/infer/access.js b/test/lib/infer/access.js
deleted file mode 100644
index 76454a1c3..000000000
--- a/test/lib/infer/access.js
+++ /dev/null
@@ -1,40 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- parse = require('../../../lib/parsers/javascript'),
- inferName = require('../../../lib/infer/name')(),
- inferAccess = require('../../../lib/infer/access');
-
-function toComment(fn) {
- return parse({
- source: '(' + fn.toString() + ')'
- })[0];
-}
-
-function evaluate(fn, re) {
- return inferAccess(re)(inferName(toComment(fn)));
-}
-
-test('inferAccess', function (t) {
- t.equal(evaluate(function () {
- /** Test */
- function _name() {}
- }, '^_').access, 'private');
-
- t.equal(evaluate(function () {
- /** @private */
- function name() {}
- }, '^_').access, 'private');
-
- t.equal(evaluate(function () {
- /** @public */
- function _name() {}
- }, '^_').access, 'public');
-
- t.equal(evaluate(function () {
- /** Test */
- function name_() {}
- }, '_$').access, 'private');
-
- t.end();
-});
diff --git a/test/lib/infer/kind.js b/test/lib/infer/kind.js
deleted file mode 100644
index 0231f6cc1..000000000
--- a/test/lib/infer/kind.js
+++ /dev/null
@@ -1,96 +0,0 @@
-'use strict';
-/*eslint-disable no-unused-vars*/
-var test = require('tap').test,
- inferKind = require('../../../lib/infer/kind')(),
- parse = require('../../../lib/parsers/javascript');
-
-function toComment(fn, filename) {
- return parse({
- file: filename,
- source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
- })[0];
-}
-
-test('inferKind', function (t) {
- t.equal(inferKind({
- kind: 'class',
- tags: []
- }).kind, 'class', 'explicit');
-
- t.equal(inferKind(toComment(
- '/**' +
- ' * Class' +
- ' */' +
- 'class C {}')).kind, 'class', 'es6 syntax');
-
- t.equal(inferKind(toComment(
- '/**' +
- ' * Exported class' +
- ' */' +
- 'export class C {}')).kind, 'class', 'es6 syntax with export');
-
- t.equal(inferKind(toComment(
- '/**' +
- ' * Export default class' +
- ' */' +
- 'export default class C {}')).kind, 'class', 'es6 syntax with default export');
-
- t.equal(inferKind(toComment(function () {
- /** function */
- function foo() { }
- foo();
- })).kind, 'function', 'inferred function');
-
- t.equal(inferKind(toComment(function () {
- /** function */
- var foo = function () { };
- foo();
- })).kind, 'function', 'inferred var function');
-
- t.equal(inferKind(toComment(
- '/** Exported function */' +
- 'export function foo() {}')).kind, 'function', 'inferred exported function');
-
- t.equal(inferKind(toComment(
- '/** Export default function */' +
- 'export default function foo() {}')).kind, 'function', 'inferred exported function');
-
- t.equal(inferKind(toComment(
- 'class Foo { /** set b */ set b(v) { } }'
- )).kind, 'member', 'member via set');
-
- t.equal(inferKind(toComment(
- 'var foo = { /** thing */ b: function(v) { } }'
- )).kind, 'function', 'function via set');
-
- t.equal(inferKind(toComment(
- 'class Foo { /** get b */ get b() { } }'
- )).kind, 'member', 'member via get');
-
- t.equal(inferKind(toComment(
- 'class Foo { /** b */ b(v) { } }'
- )).kind, 'function', 'normal function as part of class');
-
- t.equal(inferKind(toComment(function () {
- /** class */
- function Foo() { }
- })).kind, 'class', 'class via uppercase');
-
- t.equal(inferKind(toComment(function () {
- /** undefined */
- })).kind, undefined, 'undetectable');
-
- t.equal(inferKind(toComment(
- '/**' +
- ' * This is a constant called foo' +
- ' */' +
- 'const foo = "bar";')).kind, 'constant', 'constant via const');
-
- t.equal(inferKind(toComment(
- '/**' +
- ' * Exported constant' +
- ' */' +
- 'export const foo = "bar";')).kind, 'constant', 'constant via export const');
-
- t.end();
-});
diff --git a/test/lib/infer/membership.js b/test/lib/infer/membership.js
deleted file mode 100644
index 746b54553..000000000
--- a/test/lib/infer/membership.js
+++ /dev/null
@@ -1,479 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- parse = require('../../../lib/parsers/javascript'),
- inferMembership = require('../../../lib/infer/membership')();
-
-function toComment(fn, file) {
- return parse({
- file: file,
- source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
- });
-}
-
-function pick(obj, props) {
- return props.reduce(function (memo, prop) {
- if (obj[prop] !== undefined) {
- memo[prop] = obj[prop];
- }
- return memo;
- }, {});
-}
-
-function evaluate(fn, file) {
- return toComment(fn, file).map(inferMembership);
-}
-
-function Foo() {}
-function lend() {}
-
-test('inferMembership - explicit', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /**
- * Test
- * @memberof Bar
- * @static
- */
- Foo.bar = 0;
- })[0], ['memberof', 'scope']), {
- memberof: 'Bar',
- scope: 'static'
- }, 'explicit, static');
-
- t.deepEqual(pick(evaluate(function () {
- /**
- * Test
- * @memberof Bar#
- */
- Foo.bar = 0;
- })[0], ['memberof', 'scope']), {
- memberof: 'Bar',
- scope: 'instance'
- }, 'explicit, instance');
-
- t.deepEqual(pick(evaluate(function () {
- /**
- * Test
- * @memberof Bar.prototype
- */
- Foo.bar = 0;
- })[0], ['memberof', 'scope']), {
- memberof: 'Bar',
- scope: 'instance'
- }, 'explicit, prototype');
-
- t.deepEqual(pick(evaluate(function () {
- /** Test */
- Foo.bar = 0;
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'static'
- }, 'implicit');
-
- t.deepEqual(pick(evaluate(function () {
- /** Test */
- Foo.prototype.bar = 0;
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'instance'
- }, 'instance');
-
- t.deepEqual(pick(evaluate(function () {
- /** Test */
- Foo.bar.baz = 0;
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo.bar',
- scope: 'static'
- }, 'compound');
-
- t.deepEqual(pick(evaluate(function () {
- /** Test */
- (0).baz = 0;
- })[0], ['memberof', 'scope']), { }, 'unknown');
-
- t.deepEqual(pick(evaluate(function () {
- Foo.bar = {
- /** Test */
- baz: 0
- };
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo.bar',
- scope: 'static'
- }, 'static object assignment');
-
- t.deepEqual(pick(evaluate(function () {
- Foo.prototype = {
- /** Test */
- bar: 0
- };
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'instance'
- }, 'instance object assignment');
-
- t.deepEqual(pick(evaluate(function () {
- Foo.prototype = {
- /**
- * Test
- */
- bar: function () {}
- };
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'instance'
- }, 'instance object assignment, function');
-
- t.deepEqual(pick(evaluate(function () {
- var Foo = {
- /** Test */
- baz: 0
- };
- return Foo;
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'static'
- }, 'variable object assignment');
-
- t.deepEqual(pick(evaluate(function () {
- var Foo = {
- /** Test */
- baz: function () {}
- };
- return Foo;
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'static'
- }, 'variable object assignment, function');
-
- t.deepEqual(pick(evaluate(function () {
- function Foo() {
- {
- /** */
- this.bar = 0;
- }
- }
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'instance'
- }, 'constructor function declaration assignment');
-
- t.deepEqual(pick(evaluate(function () {
- var Foo = function Bar() {
- {
- /** */
- this.baz = 0;
- }
- };
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'instance'
- }, 'constructor function expression assignment');
-
- t.deepEqual(pick(evaluate(function () {
- class Foo {
- constructor() {
- {
- /** */
- this.bar = 0;
- }
- }
- }
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'instance'
- }, 'constructor assignment');
-
- t.deepEqual(pick(evaluate(function () {
- /** Test */
- module.exports = function () {};
- })[0], ['memberof', 'scope']), {
- memberof: 'module',
- scope: 'static'
- }, 'simple');
-
- t.deepEqual(pick(evaluate(function () {
- lend(/** @lends Foo */{
- /** Test */
- bar: 0
- });
- })[1], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'static'
- }, 'lends, static');
-
- t.deepEqual(pick(evaluate(function () {
- lend(/** @lends Foo */{
- /** Test */
- bar: function () {}
- });
- })[1], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'static'
- }, 'inferMembership - lends, static, function');
-
- t.deepEqual(pick(evaluate(function () {
- lend(/** @lends Foo.prototype */{
- /** Test */
- bar: 0
- });
- })[1], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'instance'
- });
-
- t.deepEqual(pick(evaluate(function () {
- lend(/** @lends Foo.prototype */{
- /** Test */
- bar: function () {}
- });
- })[1], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'instance'
- }, 'inferMembership - lends, instance, function');
-
- // t.deepEqual(pick(evaluate(function () {
- // /** Foo */
- // function Foo() {
- // /** Test */
- // function bar() {}
- // return {
- // bar: bar
- // };
- // }
- // })[1], ['memberof', 'scope']), {
- // memberof: 'Foo',
- // scope: 'static'
- // }, 'inferMembership - revealing, static, function');
-
- t.equal(evaluate(function () {
- lend(/** @lends Foo */{});
- /** Test */
- })[1].memberof, undefined, 'inferMembership - lends applies only to following object');
-
- t.equal(evaluate(function () {
- lend(/** @lends Foo */{});
- })[0], undefined, 'inferMembership - drops lends');
-
- t.end();
-});
-
-test('inferMembership - exports', function (t) {
- t.equal(evaluate(function () {
- /** @module mod */
- /** foo */
- exports.foo = 1;
- })[1].memberof, 'mod');
-
- t.equal(evaluate(function () {
- /** @module mod */
- /** foo */
- exports.foo = function () {};
- })[1].memberof, 'mod');
-
- t.equal(evaluate(function () {
- /** @module mod */
- /** bar */
- exports.foo.bar = 1;
- })[1].memberof, 'mod.foo');
-
- t.equal(evaluate(function () {
- /** @module mod */
- exports.foo = {
- /** bar */
- bar: 1
- };
- })[1].memberof, 'mod.foo');
-
- t.equal(evaluate(function () {
- /** @module mod */
- exports.foo = {
- /** bar */
- bar: function () {}
- };
- })[1].memberof, 'mod.foo');
-
- t.equal(evaluate(function () {
- /** @module mod */
- /** bar */
- exports.foo.prototype.bar = function () {};
- })[1].memberof, 'mod.foo');
-
- t.equal(evaluate(function () {
- /** @module mod */
- exports.foo.prototype = {
- /** bar */
- bar: function () {}
- };
- })[1].memberof, 'mod.foo');
-
- t.end();
-});
-
-test('inferMembership - module.exports', function (t) {
- t.equal(evaluate(function () {
- /** @module mod */
- /** foo */
- module.exports.foo = 1;
- })[1].memberof, 'mod');
-
- t.equal(evaluate(function () {
- /** @module mod */
- /** foo */
- module.exports.foo = function () {};
- })[1].memberof, 'mod');
-
- t.equal(evaluate(function () {
- /** @module mod */
- /** bar */
- module.exports.foo.bar = 1;
- })[1].memberof, 'mod.foo');
-
- t.equal(evaluate(function () {
- /** @module mod */
- module.exports.foo = {
- /** bar */
- bar: 1
- };
- })[1].memberof, 'mod.foo');
-
- t.equal(evaluate(function () {
- /** @module mod */
- module.exports.foo = {
- /** bar */
- bar: function () {}
- };
- })[1].memberof, 'mod.foo');
-
- t.equal(evaluate(function () {
- /** @module mod */
- /** bar */
- module.exports.prototype.bar = function () {};
- })[1].memberof, 'mod');
-
- t.equal(evaluate(function () {
- /** @module mod */
- module.exports.prototype = {
- /** bar */
- bar: function () {}
- };
- })[1].memberof, 'mod');
-
- t.equal(evaluate(function () {
- /**
- * @module mod
- * @name exports
- */
- module.exports = 1;
- })[0].memberof, undefined);
-
- t.equal(evaluate(function () {
- /**
- * @module mod
- * @name exports
- */
- module.exports = function () {};
- })[0].memberof, undefined);
-
- t.equal(evaluate(function () {
- /** @module mod */
- module.exports = {
- /** foo */
- foo: 1
- };
- })[1].memberof, 'mod');
-
- t.end();
-});
-
-test('inferMembership - not module exports', function (t) {
- var result = evaluate(function () {
- /**
- * @module mod
- */
- /** Test */
- global.module.exports.foo = 1;
- }, '/path/mod.js');
-
- t.equal(result.length, 2);
- t.notEqual(result[0].memberof, 'mod');
- t.end();
-});
-
-test('inferMembership - anonymous @module', function (t) {
- var result = evaluate(function () {
- /**
- * @module
- */
- /** Test */
- exports.foo = 1;
- }, '/path/mod.js');
-
- t.equal(result.length, 2);
- t.equal(result[1].memberof, 'mod');
- t.end();
-});
-
-test('inferMembership - no @module', function (t) {
- var result = evaluate(function () {
- /** Test */
- exports.foo = 1;
- }, '/path/mod.js');
-
- t.equal(result.length, 1);
- t.equal(result[0].memberof, 'mod');
- t.end();
-});
-
-test('inferMembership - https://github.com/documentationjs/documentation/issues/378', function (t) {
- t.deepEqual(pick(evaluate(function () {
- Foo.prototype = {
- /** Test */
- bar: function () {
- lend();
- lend();
- }
- };
- })[0], ['memberof', 'scope']), {
- memberof: 'Foo',
- scope: 'instance'
- });
-
- t.end();
-});
-
-test('inferMembership - export', function (t) {
- t.deepEqual(pick(evaluate(
- 'export default class {' +
- ' /** */' +
- ' method() {}' +
- '}',
- 'test-file'
- )[0], ['memberof', 'scope']), {
- memberof: 'test-file',
- scope: 'instance'
- });
-
- t.deepEqual(pick(evaluate(
- 'export default class C {' +
- ' /** */' +
- ' method() {}' +
- '}',
- 'test-file'
- )[0], ['memberof', 'scope']), {
- memberof: 'C',
- scope: 'instance'
- });
-
- t.deepEqual(pick(evaluate(
- 'export class C {' +
- ' /** */' +
- ' method() {}' +
- '}',
- 'test-file'
- )[0], ['memberof', 'scope']), {
- memberof: 'C',
- scope: 'instance'
- });
-
- t.end();
-});
diff --git a/test/lib/infer/name.js b/test/lib/infer/name.js
deleted file mode 100644
index c155ba781..000000000
--- a/test/lib/infer/name.js
+++ /dev/null
@@ -1,145 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- parse = require('../../../lib/parsers/javascript'),
- inferName = require('../../../lib/infer/name')();
-
-function toComment(fn, file) {
- return parse({
- file: file,
- source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
- })[0];
-}
-
-function evaluate(fn, file) {
- return inferName(toComment(fn, file));
-}
-
-test('inferName', function (t) {
- t.equal(evaluate(function () {
- // ExpressionStatement (comment attached here)
- // AssignmentExpression
- // MemberExpression
- // Identifier
- /** Test */
- exports.name = test;
- }).name, 'name', 'expression statement');
-
- t.equal(evaluate(function () {
- // ExpressionStatement
- // AssignmentExpression
- // MemberExpression (comment attached here)
- // FunctionExpression
- /** Test */
- exports.name = function () {};
- }).name, 'name', 'expression statement, function');
-
- t.equal(evaluate(function () {
- exports = {
- // Property (comment attached here)
- // Identifier
- // FunctionExpression
- /** Test */
- name: test
- };
- }).name, 'name', 'property');
-
- t.equal(evaluate(function () {
- exports = {
- // Property
- // Identifier (comment attached here)
- // FunctionExpression
- /** Test */
- name: function () {}
- };
- }).name, 'name', 'property, function');
-
- t.equal(evaluate(function () {
- /** Test */
- function name() {}
- }).name, 'name', 'function declaration');
-
- t.equal(evaluate(function () {
- /** Test */
- var name = function () {};
- }).name, 'name', 'anonymous function expression');
-
- t.equal(evaluate(function () {
- /** Test */
- var name = function name2() {};
- }).name, 'name', 'named function expression');
-
- t.equal(evaluate(function () {
- /** @name explicitName */
- function implicitName() {}
- }).name, 'explicitName', 'explicit name');
-
- t.equal(evaluate(function () {
- /** @alias explicitAlias */
- function implicitName() {}
- }).name, 'explicitAlias', 'explicit alias');
-
- t.equal(evaluate(function () {
- /** @class ExplicitClass */
- function ImplicitClass() {}
- }).name, 'ExplicitClass', 'explicit class');
-
- t.equal(evaluate(function () {
- /** @class */
- function ImplicitClass() {}
- }).name, 'ImplicitClass', 'anonymous class');
-
- t.equal(evaluate(function () {
- /** @event explicitEvent */
- function implicitName() {}
- }).name, 'explicitEvent', 'explicitEvent');
-
- t.equal(evaluate(function () {
- /** @typedef {Object} ExplicitTypedef */
- function implicitName() {}
- }).name, 'ExplicitTypedef', 'ExplicitTypedef');
-
- t.equal(evaluate(function () {
- /** @callback explicitCallback */
- function implicitName() {}
- }).name, 'explicitCallback', 'explicitCallback');
-
- t.equal(evaluate(function () {
- /** @module explicitModule */
- function implicitName() {}
- }).name, 'explicitModule');
-
- t.equal(evaluate(function () {
- /** @module {Function} explicitModule */
- function implicitName() {}
- }).name, 'explicitModule');
-
- t.equal(evaluate(function () {
- /** @module */
- function implicitName() {}
- }, '/path/inferred-from-file.js').name, 'inferred-from-file');
-
- t.equal(evaluate(function () {
- /** @module */
- }, '/path/inferred-from-file.js').name, 'inferred-from-file');
-
- t.equal(evaluate('/** Test */ export function exported() {}').name, 'exported');
-
- t.equal(evaluate('/** Test */ export default function() {}',
- '/path/inferred-from-file.js').name, 'inferred-from-file');
-
- t.equal(evaluate('/** Test */ export default function exported() {}',
- '/path/inferred-from-file.js').name, 'exported');
-
- t.equal(evaluate('/** Test */ export var life = 42;').name, 'life');
-
- t.equal(evaluate('/** Test */ export class Wizard {}').name, 'Wizard');
-
- t.equal(evaluate('/** Test */ export default class Warlock {}',
- '/path/inferred-from-file.js').name, 'Warlock');
-
- t.equal(evaluate('/** Test */ export default class {}',
- '/path/inferred-from-file.js').name, 'inferred-from-file');
-
- t.end();
-});
diff --git a/test/lib/infer/params.js b/test/lib/infer/params.js
deleted file mode 100644
index b318918c4..000000000
--- a/test/lib/infer/params.js
+++ /dev/null
@@ -1,47 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- parse = require('../../../lib/parsers/javascript'),
- inferParams = require('../../../lib/infer/params')();
-
-function toComment(fn, file) {
- return parse({
- file: file,
- source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
- })[0];
-}
-
-function evaluate(fn, file) {
- return inferParams(toComment(fn, file));
-}
-
-test('inferParams', function (t) {
- t.deepEqual(evaluate(function () {
- /** Test */
- function f(x) {}
- }).params, [{lineNumber: 3, name: 'x', title: 'param'}]);
-
- t.deepEqual(evaluate(function () {
- /** Test */
- var f = function (x) {};
- }).params, [{lineNumber: 3, name: 'x', title: 'param'}]);
-
- t.deepEqual(evaluate('/** Test */ var f = (x) => {}').params,
- [{lineNumber: 1, name: 'x', title: 'param'}]);
-
- t.deepEqual(evaluate(function () {
- var x = 1,
- g = function (y) {},
- /** Test */
- f = function (x) {};
- }).params, [{lineNumber: 5, name: 'x', title: 'param'}]);
-
-
- t.deepEqual(evaluate('/** Test */ export function f(x) {}').params,
- [{lineNumber: 1, name: 'x', title: 'param'}]);
-
- t.deepEqual(evaluate('/** Test */ export default function f(x) {}').params,
- [{lineNumber: 1, name: 'x', title: 'param'}]);
-
- t.end();
-});
diff --git a/test/lib/infer/type.js b/test/lib/infer/type.js
deleted file mode 100644
index 6777d79dc..000000000
--- a/test/lib/infer/type.js
+++ /dev/null
@@ -1,135 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- parse = require('../../../lib/parsers/javascript'),
- inferKind = require('../../../lib/infer/kind')(),
- inferType = require('../../../lib/infer/type')();
-
-function toComment(code) {
- return parse({
- source: code
- })[0];
-}
-
-function evaluate(code) {
- return inferType(inferKind(toComment(code)));
-}
-
-test('inferType', function (t) {
- t.deepEqual(evaluate(
- '/** @typedef {T} V */'
- ).type, {
- name: 'T',
- type: 'NameExpression'
- });
-
- t.deepEqual(evaluate(
- '/** */' +
- 'type V = T'
- ).type, {
- name: 'T',
- type: 'NameExpression'
- });
-
- t.deepEqual(evaluate(
- '/** @typedef {Array} V */'
- ).type, {
- applications: [
- {
- name: 'T',
- type: 'NameExpression'
- }
- ],
- expression: {
- name: 'Array',
- type: 'NameExpression'
- },
- type: 'TypeApplication'
- });
-
- t.deepEqual(evaluate(
- '/** */' +
- 'type V = Array'
- ).type, {
- applications: [
- {
- name: 'T',
- type: 'NameExpression'
- }
- ],
- expression: {
- name: 'Array',
- type: 'NameExpression'
- },
- type: 'TypeApplication'
- });
-
- t.deepEqual(evaluate(
- '/** */' +
- 'var x: number'
- ).type, {
- name: 'number',
- type: 'NameExpression'
- });
-
- t.deepEqual(evaluate(
- '/** */' +
- 'let x: number'
- ).type, {
- name: 'number',
- type: 'NameExpression'
- });
-
- t.deepEqual(evaluate(
- '/** */' +
- 'const x: number = 42;'
- ).type, {
- name: 'number',
- type: 'NameExpression'
- });
-
- t.deepEqual(evaluate(
- 'let x,' +
- '/** */' +
- 'y: number'
- ).type, {
- name: 'number',
- type: 'NameExpression'
- });
-
- t.deepEqual(evaluate(
- 'class C {' +
- '/** */' +
- 'x: number;' +
- '}'
- ).type, {
- name: 'number',
- type: 'NameExpression'
- });
-
- t.deepEqual(evaluate(
- '/** */' +
- 'const x = 42;'
- ).type, {
- name: 'number',
- type: 'NameExpression'
- });
-
- t.deepEqual(evaluate(
- '/** */' +
- 'const x = "abc";'
- ).type, {
- name: 'string',
- type: 'NameExpression'
- });
-
- t.deepEqual(evaluate(
- '/** */' +
- 'const x = true;'
- ).type, {
- name: 'boolean',
- type: 'NameExpression'
- });
-
- t.end();
-});
diff --git a/test/lib/input/shallow.js b/test/lib/input/shallow.js
deleted file mode 100644
index 6eb9fc491..000000000
--- a/test/lib/input/shallow.js
+++ /dev/null
@@ -1,60 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- path = require('path'),
- shallow = require('../../../lib/input/shallow');
-
-test('shallow deps', function (t) {
- shallow([path.resolve(path.join(__dirname, '../../fixture/es6.input.js'))], {}, function (err, deps) {
- t.ifError(err);
- t.equal(deps.length, 1);
- t.ok(deps[0], 'has path');
- t.end();
- });
-});
-
-test('shallow deps multi', function (t) {
- shallow([
- path.resolve(path.join(__dirname, '../../fixture/es6.input.js')),
- path.resolve(path.join(__dirname, '../../fixture/es6.output.json'))
- ], {}, function (err, deps) {
- t.ifError(err);
- t.equal(deps.length, 2);
- t.ok(deps[0], 'has path');
- t.end();
- });
-});
-
-test('shallow deps directory', function (t) {
- shallow([
- path.resolve(path.join(__dirname, '../../fixture/html'))
- ], {}, function (err, deps) {
- t.ifError(err);
- t.equal(deps.length, 1);
- t.ok(deps[0].match(/input.js/), 'is the input file');
- t.end();
- });
-});
-
-test('shallow deps not found', function (t) {
- t.throws(function () {
- shallow([
- 'not-found-file'
- ], {});
- }, 'not found');
- t.end();
-});
-
-test('shallow deps literal', function (t) {
- var obj = {
- file: 'foo.js',
- source: '//bar'
- };
- shallow([
- obj
- ], {}, function (err, deps) {
- t.ifError(err);
- t.equal(deps[0], obj);
- t.end();
- });
-});
diff --git a/test/lib/lint.js b/test/lib/lint.js
deleted file mode 100644
index 8b769ade5..000000000
--- a/test/lib/lint.js
+++ /dev/null
@@ -1,69 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- parse = require('../../lib/parsers/javascript'),
- lintComments = require('../../lib/lint').lintComments,
- formatLint = require('../../lib/lint').formatLint;
-
-function toComment(fn, filename) {
- return parse({
- file: filename,
- source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
- })[0];
-}
-
-function evaluate(fn) {
- return lintComments(toComment(fn, 'input.js'));
-}
-
-test('lintComments', function (t) {
- t.deepEqual(evaluate(function () {
- /**
- * @param {foo
- */
- }).errors, [
- { message: 'Braces are not balanced' },
- { message: 'Missing or invalid tag name' }
- ], 'doctrine error');
-
- t.deepEqual(evaluate(function () {
- /**
- * @param {String} foo
- * @param {array} bar
- */
- }).errors, [
- { commentLineNumber: 1, message: 'type String found, string is standard' },
- { commentLineNumber: 2, message: 'type array found, Array is standard' }
- ], 'non-canonical');
-
- t.deepEqual(evaluate(function () {
- /**
- * @param {string} foo
- */
- }).errors, [], 'no errors');
-
- t.end();
-});
-
-test('formatLint', function (t) {
- var comment = evaluate(function () {
- // 2
- // 3
- /** 4
- * @param {String} foo
- * @param {array} bar
- * @param {foo
- */
- });
-
- var formatted = formatLint([comment]);
-
- t.contains(formatted, 'input.js');
- t.contains(formatted, /4:1[^\n]+Braces are not balanced/);
- t.contains(formatted, /4:1[^\n]+Missing or invalid tag name/);
- t.contains(formatted, /5:1[^\n]+type String found, string is standard/);
- t.contains(formatted, /6:1[^\n]+type array found, Array is standard/);
- t.contains(formatted, '4 warnings');
-
- t.end();
-});
diff --git a/test/lib/load_config.js b/test/lib/load_config.js
deleted file mode 100644
index 64ee5d48f..000000000
--- a/test/lib/load_config.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- path = require('path'),
- loadConfig = require('../../lib/load_config');
-
-test('loadConfig', function (t) {
-
- t.throws(function () {
- loadConfig('DOES-NOT-EXIST');
- });
-
- t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config.json')),
- { foo: 'bar' });
-
- t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config_comments.json')),
- { foo: 'bar' }, 'config with comments');
-
- t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config.yaml')),
- { foo: 'bar' }, 'config.yaml');
-
- t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config.yml')),
- { foo: 'bar' }, 'config.yml');
-
- t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config')),
- { foo: 'bar' }, 'config in yaml without extension');
-
- t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config_links.yml')),
- { foo: 'hello [link](https://github.com/my/link) world' }, 'config with markdown link');
-
- t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config_file.yml')),{
- toc: [{
- name: 'snowflake',
- file: path.join(__dirname, '../fixture/snowflake.md')
- }]
- }, 'config with file reference');
-
- t.end();
-});
diff --git a/test/lib/nest.js b/test/lib/nest.js
deleted file mode 100644
index 5b4aa286b..000000000
--- a/test/lib/nest.js
+++ /dev/null
@@ -1,90 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- parse = require('../../lib/parsers/javascript'),
- nest = require('../../lib/nest');
-
-function toComment(fn, filename) {
- return parse({
- file: filename,
- source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
- }).map(nest);
-}
-
-test('nest params - no params', function (t) {
- t.equal(toComment(function () {
- /** @name foo */
- })[0].params, undefined, 'no params');
- t.end();
-});
-
-test('nest params - no nesting', function (t) {
- var result = toComment(function () {
- /** @param {Object} foo */
- });
- t.equal(result[0].params.length, 1);
- t.equal(result[0].params[0].name, 'foo');
- t.equal(result[0].params[0].properties, undefined);
- t.end();
-});
-
-test('nest params - basic', function (t) {
- var result = toComment(function () {
- /**
- * @param {Object} foo
- * @param {string} foo.bar
- * @param {string} foo.baz
- */
- });
- t.equal(result[0].params.length, 1);
- t.equal(result[0].params[0].name, 'foo');
- t.equal(result[0].params[0].properties.length, 2);
- t.equal(result[0].params[0].properties[0].name, 'foo.bar');
- t.equal(result[0].params[0].properties[1].name, 'foo.baz');
- t.end();
-});
-
-test('nest properties - basic', function (t) {
- var result = toComment(function () {
- /**
- * @property {Object} foo
- * @property {string} foo.bar
- * @property {string} foo.baz
- */
- });
- t.equal(result[0].properties.length, 1);
- t.equal(result[0].properties[0].name, 'foo');
- t.equal(result[0].properties[0].properties.length, 2);
- t.equal(result[0].properties[0].properties[0].name, 'foo.bar');
- t.equal(result[0].properties[0].properties[1].name, 'foo.baz');
- t.end();
-});
-
-test('nest params - array', function (t) {
- var result = toComment(function () {
- /**
- * @param {Object[]} employees - The employees who are responsible for the project.
- * @param {string} employees[].name - The name of an employee.
- * @param {string} employees[].department - The employee's department.
- */
- });
- t.equal(result[0].params.length, 1);
- t.equal(result[0].params[0].name, 'employees');
- t.equal(result[0].params[0].properties.length, 2);
- t.equal(result[0].params[0].properties[0].name, 'employees[].name');
- t.equal(result[0].params[0].properties[1].name, 'employees[].department');
- t.end();
-});
-
-test('nest params - missing parent', function (t) {
- var result = toComment(function () {
- /** @param {string} foo.bar */
- });
- t.equal(result[0].params.length, 1);
- t.deepEqual(result[0].errors[0], {
- message: '@param foo.bar\'s parent foo not found',
- commentLineNumber: 0
- }, 'correct error message');
- t.equal(result[0].params[0].name, 'foo.bar');
- t.end();
-});
diff --git a/test/lib/output/util/formatters.js b/test/lib/output/util/formatters.js
deleted file mode 100644
index 4a95b72a1..000000000
--- a/test/lib/output/util/formatters.js
+++ /dev/null
@@ -1,38 +0,0 @@
-var test = require('tap').test;
-var formatters = require('../../../../lib/output/util/formatters')(getHref);
-
-test('formatters.parameters -- long form', function (t) {
- t.deepEqual(formatters.parameters({}), '()');
- t.deepEqual(formatters.parameters({ params: [] }), '()');
- t.deepEqual(formatters.parameters({ params: [{ name: 'foo' }] }), '(foo: any)');
- t.deepEqual(formatters.parameters({ params: [{ name: 'foo', type: { type: 'OptionalType' } }] }), '(foo: any?)');
- t.done();
-});
-
-test('formatters.parameters -- short form', function (t) {
- t.deepEqual(formatters.parameters({}, true), '()');
- t.deepEqual(formatters.parameters({ params: [] }, true), '()');
- t.deepEqual(formatters.parameters({ params: [{ name: 'foo' }] }, true), '(foo)');
- t.deepEqual(formatters.parameters({
- params: [{ name: 'foo', type: { type: 'OptionalType' } }]
- }, true), '(foo?)');
- t.deepEqual(formatters.parameters({
- params: [{
- title: 'param',
- description: 'param',
- type: {
- type: 'OptionalType',
- expression: {
- type: 'NameExpression',
- name: 'number'
- }},
- name: 'bar',
- default: '1'
- }]
- }, true), '(bar = 1)');
- t.done();
-});
-
-function getHref(x) {
- return x;
-}
diff --git a/test/lib/parse.js b/test/lib/parse.js
deleted file mode 100644
index 46c50bdbf..000000000
--- a/test/lib/parse.js
+++ /dev/null
@@ -1,1001 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- parse = require('../../lib/parsers/javascript'),
- remark = require('remark'),
- visit = require('unist-util-visit');
-
-function pick(obj, props) {
- if (Array.isArray(props)) {
- return props.reduce(function (memo, prop) {
- if (obj[prop] !== undefined) {
- memo[prop] = obj[prop];
- }
- return memo;
- }, {});
- }
- return obj[props];
-}
-
-function evaluate(fn, filename) {
- return parse({
- file: filename || 'test.js',
- source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
- });
-}
-
-function addJSDocTag(tree) {
- visit(tree, 'link', function (node) {
- node.jsdoc = true;
- });
- return tree;
-}
-
-function removePosition(tree) {
- visit(tree, function (node) {
- delete node.position;
- });
- return tree;
-}
-
-test('parse - @abstract', function (t) {
- t.equal(evaluate(function () {
- /** @abstract */
- })[0].abstract, true);
-
- t.end();
-});
-
-test('parse - @access', function (t) {
- t.equal(evaluate(function () {
- /** @access public */
- })[0].access, 'public', 'access public');
-
- t.equal(evaluate(function () {
- /** @access protected */
- })[0].access, 'protected', 'access protected');
-
- t.equal(evaluate(function () {
- /** @access private */
- })[0].access, 'private', 'access private');
-
- t.end();
-});
-
-test('parse - @alias', function (t) {
- t.end();
-});
-
-test('parse - @arg', function (t) {
- t.end();
-});
-
-test('parse - @argument', function (t) {
- t.end();
-});
-
-test('parse - @augments', function (t) {
- t.equal(evaluate(function () {
- /** @augments Foo */
- })[0].augments[0].name, 'Foo', 'augments');
-
- t.end();
-});
-
-test('parse - @author', function (t) {
- t.end();
-});
-
-test('parse - @borrows', function (t) {
- t.end();
-});
-
-test('parse - @callback', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @callback name */
- })[0], ['kind', 'name', 'type']), {
- name: 'name',
- kind: 'typedef',
- type: {
- type: 'NameExpression',
- name: 'Function'
- }
- });
-
- t.end();
-});
-
-test('parse - @class', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @class */
- })[0], ['kind', 'name', 'type']), {
- kind: 'class'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @class name */
- })[0], ['kind', 'name', 'type']), {
- name: 'name',
- kind: 'class'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @class {Object} name */
- })[0], ['kind', 'name', 'type']), {
- name: 'name',
- kind: 'class',
- type: {
- type: 'NameExpression',
- name: 'Object'
- }
- });
-
- t.end();
-});
-
-test('parse - @classdesc', function (t) {
- t.deepEqual(evaluate(function () {
- /** @classdesc test */
- })[0].classdesc, remark().parse('test'));
-
- t.end();
-});
-
-test('parse - @const', function (t) {
- t.end();
-});
-
-test('parse - @constant', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @constant */
- })[0], ['kind', 'name', 'type']), {
- kind: 'constant'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @constant name */
- })[0], ['kind', 'name', 'type']), {
- kind: 'constant',
- name: 'name'
- });
-
-
- t.deepEqual(pick(evaluate(function () {
- /** @constant {Object} */
- })[0], ['kind', 'name', 'type']), {
- kind: 'constant',
- type: {
- type: 'NameExpression',
- name: 'Object'
- }
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @constant {Object} name */
- })[0], ['kind', 'name', 'type']), {
- kind: 'constant',
- name: 'name',
- type: {
- type: 'NameExpression',
- name: 'Object'
- }
- });
-
- t.end();
-});
-
-test('parse - @constructor', function (t) {
- t.end();
-});
-
-test('parse - @constructs', function (t) {
- t.end();
-});
-
-test('parse - @copyright', function (t) {
- t.deepEqual(evaluate(function () {
- /** @copyright test */
- })[0].copyright, remark().parse('test'));
-
- t.end();
-});
-
-test('parse - @default', function (t) {
- t.end();
-});
-
-test('parse - @defaultvalue', function (t) {
- t.end();
-});
-
-test('parse - @deprecated', function (t) {
- t.deepEqual(evaluate(function () {
- /** @deprecated test */
- })[0].deprecated, remark().parse('test'));
-
- t.end();
-});
-
-test('parse - @desc', function (t) {
- t.deepEqual(evaluate(function () {
- /** @desc test */
- })[0].description, remark().parse('test'));
-
- t.end();
-});
-
-test('parse - @description', function (t) {
- t.deepEqual(evaluate(function () {
- /** @description test */
- })[0].description, remark().parse('test'));
-
- t.end();
-});
-
-test('parse - description', function (t) {
- t.deepEqual(evaluate(function () {
- /** test */
- })[0].description, remark().parse('test'));
-
- t.end();
-});
-
-test('parse - @emits', function (t) {
- t.end();
-});
-
-test('parse - @enum', function (t) {
- t.end();
-});
-
-test('parse - @event', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @event name */
- })[0], ['kind', 'name']), {
- kind: 'event',
- name: 'name'
- });
-
- t.end();
-});
-
-test('parse - @example', function (t) {
- t.deepEqual(evaluate(function () {
- /** @example test */
- })[0].examples[0], {
- description: 'test'
- }, 'single line');
-
- t.deepEqual(evaluate(function () {
- /**
- * @example
- * a
- * b
- */
- })[0].examples[0], {
- description: 'a\nb'
- }, 'multiline');
-
- t.deepEqual(evaluate(function () {
- /**
- * @example caption
- * a
- * b
- */
- })[0].examples[0], {
- description: 'a\nb',
- caption: remark().parse('caption')
- }, 'with caption');
-
- t.deepEqual(evaluate(function () {
- /** @example */
- })[0].errors[0], {
- message: '@example without code',
- commentLineNumber: 0
- }, 'missing description');
-
- t.end();
-});
-
-test('parse - @exception', function (t) {
- t.end();
-});
-
-test('parse - @exports', function (t) {
- t.end();
-});
-
-test('parse - @extends', function (t) {
- t.deepEqual(evaluate(function () {
- /** @extends Foo */
- })[0].augments[0].name, 'Foo', 'extends');
-
- t.end();
-});
-
-test('parse - @external', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @external name */
- })[0], ['kind', 'name']), {
- kind: 'external',
- name: 'name'
- });
-
- t.end();
-});
-
-test('parse - @file', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @file */
- })[0], ['kind']), {
- kind: 'file'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @file desc */
- })[0], ['kind', 'description']), {
- kind: 'file',
- description: remark().parse('desc')
- });
-
- t.end();
-});
-
-test('parse - @fileoverview', function (t) {
- t.end();
-});
-
-test('parse - @fires', function (t) {
- t.end();
-});
-
-test('parse - @func', function (t) {
- t.end();
-});
-
-test('parse - @function', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @function */
- })[0], ['kind', 'name']), {
- kind: 'function'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @function name */
- })[0], ['kind', 'name']), {
- kind: 'function',
- name: 'name'
- });
-
- t.end();
-});
-
-test('parse - @global', function (t) {
- t.equal(evaluate(function () {
- /** @global */
- })[0].scope, 'global', 'global');
-
- t.end();
-});
-
-test('parse - @host', function (t) {
- t.end();
-});
-
-test('parse - @ignore', function (t) {
- t.equal(evaluate(function () {
- /** @ignore */
- })[0].ignore, true);
-
- t.end();
-});
-
-test('parse - @implements', function (t) {
- t.end();
-});
-
-test('parse - @inheritdoc', function (t) {
- t.end();
-});
-
-test('parse - @inner', function (t) {
- t.equal(evaluate(function () {
- /** @inner*/
- })[0].scope, 'inner', 'inner');
-
- t.end();
-});
-
-test('parse - @instance', function (t) {
- t.equal(evaluate(function () {
- /** @instance*/
- })[0].scope, 'instance', 'instance');
-
- t.end();
-});
-
-test('parse - @interface', function (t) {
- t.deepEqual(evaluate(function () {
- /** @interface */
- })[0].interface, true, 'anonymous');
-
- t.deepEqual(evaluate(function () {
- /** @interface Foo */
- })[0].name, 'Foo', 'named');
-
- t.end();
-});
-
-test('parse - @kind', function (t) {
- t.equal(evaluate(function () {
- /** @kind class */
- })[0].kind, 'class', 'kind');
-
- t.end();
-});
-
-test('parse - @lends', function (t) {
- t.equal(evaluate(function () {
- /** @lends lendee */
- })[0].lends, 'lendee', 'lends');
-
- t.end();
-});
-
-test('parse - @license', function (t) {
- t.end();
-});
-
-test('parse - @listens', function (t) {
- t.end();
-});
-
-test('parse - @member', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @member */
- })[0], ['kind', 'name', 'type']), {
- kind: 'member'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @member name */
- })[0], ['kind', 'name', 'type']), {
- kind: 'member',
- name: 'name'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @member {Object} */
- })[0], ['kind', 'name', 'type']), {
- kind: 'member',
- type: {
- type: 'NameExpression',
- name: 'Object'
- }
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @member {Object} name */
- })[0], ['kind', 'name', 'type']), {
- kind: 'member',
- name: 'name',
- type: {
- type: 'NameExpression',
- name: 'Object'
- }
- });
-
- t.end();
-});
-
-test('parse - @memberof', function (t) {
- t.equal(evaluate(function () {
- /** @memberof test */
- })[0].memberof, 'test', 'memberof');
-
- t.end();
-});
-
-test('parse - @method', function (t) {
- t.end();
-});
-
-test('parse - @mixes', function (t) {
- t.end();
-});
-
-test('parse - @mixin', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @mixin */
- })[0], ['kind', 'name']), {
- kind: 'mixin'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @mixin name */
- })[0], ['kind', 'name']), {
- kind: 'mixin',
- name: 'name'
- });
-
- t.end();
-});
-
-test('parse - @module', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @module */
- })[0], ['kind', 'name', 'type']), {
- kind: 'module'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @module name */
- })[0], ['kind', 'name', 'type']), {
- kind: 'module',
- name: 'name'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @module {Object} name */
- })[0], ['kind', 'name', 'type']), {
- kind: 'module',
- name: 'name',
- type: {
- type: 'NameExpression',
- name: 'Object'
- }
- });
-
- t.end();
-});
-
-test('parse - @name', function (t) {
- t.equal(evaluate(function () {
- /** @name test */
- })[0].name, 'test', 'name');
-
- t.end();
-});
-
-test('parse - @namespace', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @namespace */
- })[0], ['kind', 'name', 'type']), {
- kind: 'namespace'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @namespace name */
- })[0], ['kind', 'name', 'type']), {
- kind: 'namespace',
- name: 'name'
- });
-
- t.deepEqual(pick(evaluate(function () {
- /** @namespace {Object} name */
- })[0], ['kind', 'name', 'type']), {
- kind: 'namespace',
- name: 'name',
- type: {
- type: 'NameExpression',
- name: 'Object'
- }
- });
-
- t.end();
-});
-
-test('parse - @override', function (t) {
- t.equal(evaluate(function () {
- /** @override */
- })[0].override, true);
-
- t.end();
-});
-
-test('parse - @overview', function (t) {
- t.end();
-});
-
-test('parse - @param', function (t) {
- t.deepEqual(evaluate(function () {
- /** @param test */
- })[0].params[0], {
- name: 'test',
- lineNumber: 0
- }, 'name');
-
- t.deepEqual(evaluate(function () {
- /** @param {number} test */
- })[0].params[0], {
- name: 'test',
- type: {
- name: 'number',
- type: 'NameExpression'
- },
- lineNumber: 0
- }, 'name and type');
-
- t.deepEqual(evaluate(function () {
- /** @param {number} test - desc */
- })[0].params[0], {
- name: 'test',
- type: {
- name: 'number',
- type: 'NameExpression'
- },
- description: remark().parse('desc'),
- lineNumber: 0
- }, 'complete');
-
- t.end();
-});
-
-test('parse - @private', function (t) {
- t.equal(evaluate(function () {
- /** @private */
- })[0].access, 'private', 'private');
-
- t.end();
-});
-
-test('parse - @prop', function (t) {
- t.deepEqual(evaluate(function () {
- /** @prop {number} test */
- })[0].properties[0], {
- name: 'test',
- type: {
- name: 'number',
- type: 'NameExpression'
- },
- lineNumber: 0
- }, 'name and type');
-
- t.deepEqual(evaluate(function () {
- /** @prop {number} test - desc */
- })[0].properties[0], {
- name: 'test',
- type: {
- name: 'number',
- type: 'NameExpression'
- },
- description: remark().parse('desc'),
- lineNumber: 0
- }, 'complete');
-
- t.end();
-});
-
-test('parse - @property', function (t) {
- t.deepEqual(evaluate(function () {
- /** @property {number} test */
- })[0].properties[0], {
- name: 'test',
- type: {
- name: 'number',
- type: 'NameExpression'
- },
- lineNumber: 0
- }, 'name and type');
-
- t.deepEqual(evaluate(function () {
- /** @property {number} test - desc */
- })[0].properties[0], {
- name: 'test',
- type: {
- name: 'number',
- type: 'NameExpression'
- },
- description: remark().parse('desc'),
- lineNumber: 0
- }, 'complete');
-
- t.end();
-});
-
-test('parse - @protected', function (t) {
- t.equal(evaluate(function () {
- /** @protected */
- })[0].access, 'protected', 'protected');
-
- t.end();
-});
-
-test('parse - @public', function (t) {
- t.end();
-});
-
-test('parse - @readonly', function (t) {
- t.equal(evaluate(function () {
- /** @readonly */
- })[0].readonly, true);
-
- t.end();
-});
-
-test('parse - @requires', function (t) {
- t.end();
-});
-
-test('parse - @return', function (t) {
- t.deepEqual(evaluate(function () {
- /** @return test */
- })[0].returns[0], {
- description: remark().parse('test')
- }, 'description');
-
- t.deepEqual(evaluate(function () {
- /** @return {number} test */
- })[0].returns[0], {
- description: remark().parse('test'),
- type: {
- name: 'number',
- type: 'NameExpression'
- }
- }, 'description and type');
-
- t.end();
-});
-
-test('parse - @returns', function (t) {
- t.deepEqual(evaluate(function () {
- /** @returns test */
- })[0].returns[0], {
- description: remark().parse('test')
- }, 'description');
-
- t.deepEqual(evaluate(function () {
- /** @returns {number} test */
- })[0].returns[0], {
- description: remark().parse('test'),
- type: {
- name: 'number',
- type: 'NameExpression'
- }
- }, 'description and type');
-
- t.end();
-});
-
-test('parse - @see', function (t) {
- t.deepEqual(evaluate(function () {
- /** @see test */
- })[0].sees, [
- remark().parse('test')
- ], 'single');
-
- t.deepEqual(evaluate(function () {
- /**
- * @see a
- * @see b
- */
- })[0].sees, [
- remark().parse('a'),
- remark().parse('b')
- ], 'multiple');
-
- t.end();
-});
-
-test('parse - @since', function (t) {
- t.end();
-});
-
-test('parse - @static', function (t) {
- t.equal(evaluate(function () {
- /** @static */
- })[0].scope, 'static', 'static');
-
- t.end();
-});
-
-test('parse - @summary', function (t) {
- t.deepEqual(evaluate(function () {
- /** @summary test */
- })[0].summary, remark().parse('test'));
-
- t.end();
-});
-
-test('parse - @this', function (t) {
- t.end();
-});
-
-test('parse - @throws', function (t) {
- t.deepEqual(evaluate(function () {
- /** @throws desc */
- })[0].throws[0], {
- description: remark().parse('desc')
- }, 'description');
-
- t.deepEqual(evaluate(function () {
- /** @throws {Error} */
- })[0].throws[0], {
- type: {
- name: 'Error',
- type: 'NameExpression'
- }
- }, 'type');
-
- t.deepEqual(evaluate(function () {
- /** @throws {Error} desc */
- })[0].throws[0], {
- type: {
- name: 'Error',
- type: 'NameExpression'
- },
- description: remark().parse('desc')
- }, 'type and description');
-
- t.deepEqual(evaluate(function () {
- /**
- * @throws a
- * @throws b
- */
- })[0].throws, [{
- description: remark().parse('a')
- }, {
- description: remark().parse('b')
- }], 'multiple');
-
- t.end();
-});
-
-test('parse - @todo', function (t) {
- t.deepEqual(evaluate(function () {
- /** @todo test */
- })[0].todos, [
- remark().parse('test')
- ], 'single');
-
- t.deepEqual(evaluate(function () {
- /**
- * @todo a
- * @todo b
- */
- })[0].todos, [
- remark().parse('a'),
- remark().parse('b')
- ], 'multiple');
-
- t.end();
-});
-
-test('parse - @tutorial', function (t) {
- t.end();
-});
-
-test('parse - @type', function (t) {
- t.end();
-});
-
-test('parse - @typedef', function (t) {
- t.deepEqual(pick(evaluate(function () {
- /** @typedef {Object} name */
- })[0], ['kind', 'name', 'type']), {
- kind: 'typedef',
- name: 'name',
- type: {
- type: 'NameExpression',
- name: 'Object'
- }
- });
-
- t.end();
-});
-
-test('parse - @var', function (t) {
- t.end();
-});
-
-test('parse - @variation', function (t) {
- t.equal(evaluate(function () {
- /** @variation 1 */
- })[0].variation, 1, 'variation');
-
- t.end();
-});
-
-test('parse - @version', function (t) {
- t.end();
-});
-
-test('parse - @virtual', function (t) {
- t.end();
-});
-
-test('parse - unknown tag', function (t) {
- t.deepEqual(evaluate(function () {
- /** @unknown */
- })[0].errors[0], {
- message: 'unknown tag @unknown',
- commentLineNumber: 0
- });
-
- t.end();
-});
-
-test('parse - {@link}', function (t) {
- t.deepEqual(removePosition(evaluate(function () {
- /** {@link Foo} */
- })[0].description), addJSDocTag(removePosition(remark().parse('[Foo](Foo)'))));
-
- t.deepEqual(removePosition(evaluate(function () {
- /** {@link Foo|text} */
- })[0].description), addJSDocTag(removePosition(remark().parse('[text](Foo)'))));
-
- t.deepEqual(removePosition(evaluate(function () {
- /** {@link Foo text} */
- })[0].description), addJSDocTag(removePosition(remark().parse('[text](Foo)'))));
-
- t.done();
-});
-
-test('parse - {@linkcode}', function (t) {
- t.end();
-});
-
-test('parse - {@linkplain}', function (t) {
- t.end();
-});
-
-test('parse - {@tutorial}', function (t) {
- t.deepEqual(removePosition(evaluate(function () {
- /** {@tutorial id} */
- })[0].description), {
- type: 'root',
- children: [{
- type: 'paragraph',
- children: [{
- type: 'tutorial',
- url: 'id',
- jsdoc: true,
- title: null,
- children: [{
- type: 'text',
- value: 'id'
- }]
- }]
- }]
- });
-
- t.deepEqual(removePosition(evaluate(function () {
- /** {@tutorial id|text} */
- })[0].description), {
- type: 'root',
- children: [{
- type: 'paragraph',
- children: [{
- type: 'tutorial',
- url: 'id',
- jsdoc: true,
- title: null,
- children: [{
- type: 'text',
- value: 'text'
- }]
- }]
- }]
- });
-
- t.deepEqual(removePosition(evaluate(function () {
- /** {@tutorial id text} */
- })[0].description), {
- type: 'root',
- children: [{
- type: 'paragraph',
- children: [{
- type: 'tutorial',
- url: 'id',
- jsdoc: true,
- title: null,
- children: [{
- type: 'text',
- value: 'text'
- }]
- }]
- }]
- });
-
- t.done();
-});
diff --git a/test/lib/parsers/javascript.js b/test/lib/parsers/javascript.js
deleted file mode 100644
index 3c7e18499..000000000
--- a/test/lib/parsers/javascript.js
+++ /dev/null
@@ -1,66 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- remark = require('remark'),
- parse = require('../../../lib/parsers/javascript');
-
-function toComments(source, filename, opts) {
- source = typeof source === 'string' ? source : '(' + source.toString() + ')';
- return parse({
- file: filename || 'test.js',
- source: source
- }, opts);
-}
-
-test('parse - leading comment', function (t) {
- t.deepEqual(toComments(function () {
- /** one */
- /** two */
- function two() {}
- }).map(function (c) {
- return c.description;
- }), [remark().parse('one'), remark().parse('two')]);
- t.end();
-});
-
-test('parse - trailing comment', function (t) {
- t.deepEqual(toComments(function () {
- /** one */
- function one() {}
- /** two */
- }).map(function (c) {
- return c.description;
- }), [remark().parse('one'), remark().parse('two')]);
- t.end();
-});
-
-test('parse - unknown tag', function (t) {
- t.equal(toComments(function () {
- /** @unknown */
- })[0].tags[0].title, 'unknown');
- t.end();
-});
-
-test('parse - error', function (t) {
- t.deepEqual(toComments(function () {
- /** @param {foo */
- })[0].errors, [
- { message: 'Braces are not balanced' },
- { message: 'Missing or invalid tag name' }]);
- t.end();
-});
-
-test('parse - document exported', function (t) {
- t.equal(toComments(`
- export class C {}
- `).length, 0);
- t.equal(toComments(`
- export class C {}
- `, 'test.js', {documentExported: true}).length, 1);
- t.equal(toComments(`
- export class C {
- method() {}
- }
- `, 'test.js', {documentExported: true}).length, 2);
- t.end();
-});
diff --git a/test/lib/parsers/polyglot.js b/test/lib/parsers/polyglot.js
deleted file mode 100644
index 028abd122..000000000
--- a/test/lib/parsers/polyglot.js
+++ /dev/null
@@ -1,37 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- fs = require('fs'),
- path = require('path'),
- remark = require('remark'),
- polyglot = require('../../../lib/parsers/polyglot');
-
-test('polyglot', function (t) {
- var file = path.resolve(path.join(__dirname, '../../fixture/polyglot/blend.cpp'));
- var result = polyglot({
- file: file,
- source: fs.readFileSync(file, 'utf8')
- });
- delete result[0].context.file;
- delete result[0].context.sortKey;
- t.deepEqual(result, [{
- errors: [],
- context: {
- loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } } },
- description: remark().parse('This method moves a hex to a color'),
- loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } },
- name: 'hexToUInt32Color', params: [
- { lineNumber: 3, name: 'hex', type: { name: 'string', type: 'NameExpression' } } ],
- returns: [
- {
- description: remark().parse('color'),
- type: { name: 'number', type: 'NameExpression' } } ],
- tags: [ { description: null, lineNumber: 2, name: 'hexToUInt32Color', title: 'name' },
- { description: null, lineNumber: 3, name: 'hex', title: 'param', type: {
- name: 'string', type: 'NameExpression'
- } },
- { description: 'color', lineNumber: 4, title: 'returns', type: {
- name: 'number', type: 'NameExpression'
- } } ] } ], 'polyglot parser');
- t.end();
-});
diff --git a/test/lib/server.js b/test/lib/server.js
deleted file mode 100644
index 301510830..000000000
--- a/test/lib/server.js
+++ /dev/null
@@ -1,93 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- get = require('../utils').get,
- File = require('vinyl'),
- Server = require('../../lib/serve/server');
-
-var jsFile = new File({
- cwd: '/',
- base: '/test/',
- path: '/test/file.js',
- contents: new Buffer('var test = 123;')
-});
-
-var coffeeFile = new File({
- cwd: '/',
- base: '/test/',
- path: '/test/file.coffee',
- contents: new Buffer('test = 123')
-});
-
-var indexFile = new File({
- cwd: '/',
- base: '/test/',
- path: '/test/index.html',
- contents: new Buffer('')
-});
-
-test('server - throws on bad port', function (t) {
- t.throws(function () {
- var server = new Server('4001');
- }, 'port must be a number');
- t.throws(function () {
- var server = new Server();
- }, 'port must be provided');
- t.end();
-});
-
-test('server', function (t) {
- var server = new Server(4001);
- t.ok(server, 'server is initialized');
- server.start(function () {
-
- t.test('start can be called more than once, without a callback', function (tt) {
- server.start();
- tt.end();
- });
-
- t.test('base path', function (tt) {
- get('http://localhost:4001/file.coffee', function (code) {
- tt.equal(code, 404, 'does not have a file, emits 404');
- tt.end();
- });
- });
-
- t.test('base path', function (tt) {
- server.setFiles([coffeeFile]);
- get('http://localhost:4001/file.coffee', function (text) {
- tt.equal(text, 'test = 123', 'emits response');
- tt.end();
- });
- });
-
- t.test('reset files', function (tt) {
- server.setFiles([coffeeFile, jsFile]);
- get('http://localhost:4001/file.js', function (text) {
- tt.equal(text, 'var test = 123;', 'emits response');
- tt.end();
- });
- });
-
- t.test('index.html special case', function (tt) {
- server.setFiles([coffeeFile, indexFile, jsFile]);
- get('http://localhost:4001/', function (text) {
- tt.equal(text, '', 'sends index.html when / is requested');
- tt.end();
- });
- });
-
- t.test('cleanup', function (tt) {
- server.stop(function () {
- tt.end();
- });
- });
-
- t.test('stop can be called more than once, without a callback', function (tt) {
- server.stop();
- tt.end();
- });
-
- t.end();
- });
-});
diff --git a/test/lib/sort.js b/test/lib/sort.js
deleted file mode 100644
index 9b3f405aa..000000000
--- a/test/lib/sort.js
+++ /dev/null
@@ -1,280 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- sort = require('../../lib/sort'),
- path = require('path');
-
-test('sort stream alphanumeric', function (t) {
- var apples = { context: { sortKey: 'a' }, name: 'apples' };
- var carrot = { context: { sortKey: 'b' }, name: 'carrot' };
- var banana = { context: { sortKey: 'c' }, name: 'bananas' };
-
- t.deepEqual(sort([
- apples, carrot, banana
- ]), [
- apples, carrot, banana
- ], 'sort stream alphanumeric');
-
- t.deepEqual(sort([
- carrot, apples, banana
- ]), [
- apples, carrot, banana
- ], 'sort stream alphanumeric');
-
- t.end();
-});
-
-test('sort stream with configuration', function (t) {
- var apples = { context: { sortKey: 'a' }, name: 'apples' };
- var carrot = { context: { sortKey: 'b' }, name: 'carrot' };
- var bananas = { context: { sortKey: 'c' }, name: 'bananas' };
-
- t.deepEqual(sort([
- apples, carrot, bananas
- ], {
- toc: ['carrot', 'bananas']
- }), [
- carrot, bananas, apples
- ], 'with configuration');
-
- t.end();
-});
-
-test('sort stream with configuration and a section', function (t) {
- var apples = { context: { sortKey: 'a' }, name: 'apples' };
- var carrot = { context: { sortKey: 'b' }, name: 'carrot' };
- var bananas = { context: { sortKey: 'c' }, name: 'bananas' };
-
- var section = { name: 'This is the banana type', description: 'here lies bananas' };
-
- var sectionMarkdown = {
- 'name': 'This is the banana type',
- 'description': {
- 'type': 'root',
- 'children': [{
- 'type': 'paragraph',
- 'children': [{
- 'type': 'text',
- 'value': 'here lies bananas',
- 'position': {
- 'start': {
- 'line': 1,
- 'column': 1,
- 'offset': 0
- },
- 'end': {
- 'line': 1,
- 'column': 18,
- 'offset': 17
- },
- 'indent': []
- }
- }],
- 'position': {
- 'start': {
- 'line': 1,
- 'column': 1,
- 'offset': 0
- },
- 'end': {
- 'line': 1,
- 'column': 18,
- 'offset': 17
- },'indent': []
- }
- }],
- 'position': {
- 'start': {
- 'line': 1,
- 'column': 1,
- 'offset': 0
- },
- 'end': {
- 'line': 1,
- 'column': 18,
- 'offset': 17
- }
- }
- },
- 'kind': 'note'
- };
-
- t.deepEqual(sort([
- apples, carrot, bananas
- ], {
- toc: ['carrot', section, 'bananas']
- }), [
- carrot, sectionMarkdown, bananas, apples
- ], 'with configuration');
-
- t.end();
-});
-
-test('sort an already-sorted stream containing a section/description', function (t) {
- // this happens in the 'serve' task
- var apples = { context: { sortKey: 'a' }, name: 'apples' };
- var carrot = { context: { sortKey: 'b' }, name: 'carrot' };
- var bananas = { context: { sortKey: 'c' }, name: 'bananas' };
-
- var section = { name: 'This is the banana type', description: 'here lies bananas' };
- var sectionMarkdown = {
- 'name': 'This is the banana type',
- 'description': {
- 'type': 'root',
- 'children': [{
- 'type': 'paragraph',
- 'children': [{
- 'type': 'text',
- 'value': 'here lies bananas',
- 'position': {
- 'start': {
- 'line': 1,
- 'column': 1,
- 'offset': 0
- },
- 'end': {
- 'line': 1,
- 'column': 18,
- 'offset': 17
- },
- 'indent': []
- }
- }],
- 'position': {
- 'start': {
- 'line': 1,
- 'column': 1,
- 'offset': 0
- },
- 'end': {
- 'line': 1,
- 'column': 18,
- 'offset': 17
- },'indent': []
- }
- }],
- 'position': {
- 'start': {
- 'line': 1,
- 'column': 1,
- 'offset': 0
- },
- 'end': {
- 'line': 1,
- 'column': 18,
- 'offset': 17
- }
- }
- },
- 'kind': 'note'
- };
-
- var config = {
- toc: ['carrot', section, 'bananas']
- };
-
- var sortOnce = sort([apples, carrot, bananas], config);
- var sortTwice = sort(sortOnce, config);
- t.deepEqual(sortTwice, [carrot, sectionMarkdown, bananas, apples]);
- t.end();
-});
-
-test('sort toc with files', function (t) {
- var apples = { context: { sortKey: 'a' }, name: 'apples' };
- var carrot = { context: { sortKey: 'b' }, name: 'carrot' };
- var bananas = { context: { sortKey: 'c' }, name: 'bananas' };
-
- var snowflake = {
- name: 'snowflake',
- file: 'test/fixture/snowflake.md'
- };
-
- var processedSnowflake = {
- name: 'snowflake',
- kind: 'note',
- description: {
- children: [{
- children: [{
- position: {
- end: {column: 16, line: 1, offset: 15},
- indent: [],
- start: {column: 3, line: 1, offset: 2}
- },
- type: 'text',
- value: 'The Snowflake'
- }],
- depth: 1,
- position: {
- end: {column: 16, line: 1, offset: 15},
- indent: [],
- start: {column: 1, line: 1, offset: 0}
- },
- type: 'heading'
- }],
- position: {
- end: {column: 1, line: 2, offset: 16},
- start: {column: 1, line: 1, offset: 0}
- },
- type: 'root'
- }
- };
- t.deepEqual(sort([
- apples, carrot, bananas
- ], {
- toc: [snowflake]
- }), [
- processedSnowflake, apples, carrot, bananas
- ], 'with configuration');
-
- t.end();
-});
-
-test('sort toc with files absolute path', function (t) {
- var apples = { context: { sortKey: 'a' }, name: 'apples' };
- var carrot = { context: { sortKey: 'b' }, name: 'carrot' };
- var bananas = { context: { sortKey: 'c' }, name: 'bananas' };
-
- var snowflake = {
- name: 'snowflake',
- file: path.join(__dirname, '../fixture/snowflake.md')
- };
-
- var processedSnowflake = {
- name: 'snowflake',
- kind: 'note',
- description: {
- children: [{
- children: [{
- position: {
- end: {column: 16, line: 1, offset: 15},
- indent: [],
- start: {column: 3, line: 1, offset: 2}
- },
- type: 'text',
- value: 'The Snowflake'
- }],
- depth: 1,
- position: {
- end: {column: 16, line: 1, offset: 15},
- indent: [],
- start: {column: 1, line: 1, offset: 0}
- },
- type: 'heading'
- }],
- position: {
- end: {column: 1, line: 2, offset: 16},
- start: {column: 1, line: 1, offset: 0}
- },
- type: 'root'
- }
- };
- t.deepEqual(sort([
- apples, carrot, bananas
- ], {
- toc: [snowflake]
- }), [
- processedSnowflake, apples, carrot, bananas
- ], 'with configuration');
-
- t.end();
-});
diff --git a/test/lib/walk.js b/test/lib/walk.js
deleted file mode 100644
index 1f20f7928..000000000
--- a/test/lib/walk.js
+++ /dev/null
@@ -1,74 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- walk = require('../../lib/walk');
-
-test('walk', function (group) {
-
- group.test('flat comments', function (t) {
-
- var comments = [{ name: 'Tom' }];
-
- function renamer(comment, options) {
- if (options) {
- comment.name = options.name;
- } else {
- comment.name = 'Tim';
- }
- }
-
- t.deepEqual(walk(comments, renamer), [
- { name: 'Tim' }
- ], 'no-option case');
-
- t.deepEqual(walk(comments, renamer, { name: 'John' }), [
- { name: 'John' }
- ], 'with options');
-
- t.end();
- });
-
- group.test('nested comments', function (t) {
-
- var comments = [{
- name: 'Tom',
- members: {
- static: [{
- name: 'Billy'
- }]
- }
- }];
-
- function renamer(comment, options) {
- if (options) {
- comment.name = options.name;
- } else {
- comment.name = 'Tim';
- }
- }
-
- t.deepEqual(walk(comments, renamer), [{
- name: 'Tim',
- members: {
- static: [{
- name: 'Tim'
- }]
- }
- }], 'no-option case');
-
- t.deepEqual(walk(comments, renamer, {
- name: 'Bob'
- }), [{
- name: 'Bob',
- members: {
- static: [{
- name: 'Bob'
- }]
- }
- }], 'with options');
-
- t.end();
- });
-
- group.end();
-});
diff --git a/test/linker.js b/test/linker.js
deleted file mode 100644
index f3cca7c7a..000000000
--- a/test/linker.js
+++ /dev/null
@@ -1,47 +0,0 @@
-var createLinkerStack = require('../lib/output/util/linker_stack'),
- test = require('tap').test;
-
-test('linkerStack', function (t) {
-
- var linkerStack = createLinkerStack({});
-
- t.equal(linkerStack.link('string'),
- 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String',
- 'Default global resolution of string');
-
- t.equal(createLinkerStack({
- paths: {
- Point: 'http://geojson.org/geojson-spec.html#point'
- }
- }).link('Point'),
- 'http://geojson.org/geojson-spec.html#point',
- 'Custom hardcoded path for a GeoJSON type');
-
-
- t.equal(createLinkerStack({
- paths: {
- Image: 'http://custom.com/'
- }
- }).link('Image'),
- 'http://custom.com/',
- 'Prefers config link to native.');
-
-
- var linker = createLinkerStack({
- paths: {
- Image: 'http://custom.com/'
- }
- });
-
- linker.namespaceResolver([{
- namespace: 'Image',
- }], function (namespace) {
- return '#' + namespace;
- });
-
- t.equal(linker.link('Image'),
- '#Image',
- 'Prefers local link over all.');
-
- t.end();
-});
diff --git a/test/normalize.js b/test/normalize.js
deleted file mode 100644
index e977f8d36..000000000
--- a/test/normalize.js
+++ /dev/null
@@ -1,17 +0,0 @@
-var walk = require('../lib/walk');
-
-module.exports = function (comments) {
- return walk(comments, function (comment) {
- var hasGithub = !!comment.context.github;
- var path = comment.context.path;
- comment.context = {
- loc: comment.context.loc
- };
- if (hasGithub) {
- comment.context.github = '[github]';
- }
- if (path) {
- comment.context.path = path;
- }
- });
-};
diff --git a/test/test.js b/test/test.js
deleted file mode 100644
index 91e561d0b..000000000
--- a/test/test.js
+++ /dev/null
@@ -1,297 +0,0 @@
-'use strict';
-
-var test = require('tap').test,
- documentationSchema = require('documentation-schema'),
- validate = require('json-schema'),
- documentation = require('../'),
- outputMarkdown = require('../lib/output/markdown.js'),
- outputMarkdownAST = require('../lib/output/markdown_ast.js'),
- outputHtml = require('../lib/output/html.js'),
- normalize = require('./normalize'),
- glob = require('glob'),
- path = require('path'),
- fs = require('fs'),
- _ = require('lodash'),
- chdir = require('chdir');
-
-var UPDATE = !!process.env.UPDATE;
-
-function makePOJO(ast) {
- return JSON.parse(JSON.stringify(ast));
-}
-
-function readOptionsFromFile(file) {
- var s = fs.readFileSync(file, 'utf-8');
- var lines = s.split(/\n/, 20);
- for (var i = 0; i < lines.length; i++) {
- var m = lines[i].match(/^\/\/\s+Options:\s*(.+)$/);
- if (m) {
- return JSON.parse(m[1]);
- }
- }
- return {};
-}
-
-if (fs.existsSync(path.join(__dirname, '../.git'))) {
- test('git option', function (t) {
- var file = path.join(__dirname, './fixture/simple.input.js');
- documentation.build([file], { github: true }, function (err, result) {
- t.ifError(err);
- normalize(result);
- var outputfile = file.replace('.input.js', '.output.github.json');
- if (UPDATE) {
- fs.writeFileSync(outputfile, JSON.stringify(result, null, 2));
- }
- var expect = require(outputfile);
- t.deepEqual(result, expect, 'produces correct JSON');
-
- outputMarkdown(result, {}, function (err, result) {
- t.ifError(err);
- var outputfile = file.replace('.input.js', '.output.github.md');
- if (UPDATE) {
- fs.writeFileSync(outputfile, result, 'utf8');
- }
- var expect = fs.readFileSync(outputfile, 'utf8');
- t.equal(result.toString(), expect, 'markdown output correct');
- t.end();
- });
- });
- });
-}
-
-test('external modules option', function (t) {
- documentation.build([
- path.join(__dirname, 'fixture', 'external.input.js')
- ], {
- external: '(external|external/node_modules/*)'
- }, function (err, result) {
- t.ifError(err);
- normalize(result);
- var outputfile = path.join(__dirname, 'fixture', '_external-deps-included.json');
- if (UPDATE) {
- fs.writeFileSync(outputfile, JSON.stringify(result, null, 2));
- }
- var expect = require(outputfile);
- t.deepEqual(result, expect);
- t.end();
- });
-});
-
-test('bad input', function (tt) {
- glob.sync(path.join(__dirname, 'fixture/bad', '*.input.js')).forEach(function (file) {
- tt.test(path.basename(file), function (t) {
- documentation.build([file], readOptionsFromFile(file), function (error, res) {
- t.equal(res, undefined);
- // make error a serializable object
- error = JSON.parse(JSON.stringify(error));
- // remove system-specific path
- delete error.filename;
- delete error.codeFrame;
- var outputfile = file.replace('.input.js', '.output.json');
- if (UPDATE) {
- fs.writeFileSync(outputfile, JSON.stringify(error, null, 2));
- }
- var expect = JSON.parse(fs.readFileSync(outputfile));
- t.deepEqual(error, expect);
- t.end();
- });
- });
- });
- tt.end();
-});
-
-test('html', function (tt) {
- glob.sync(path.join(__dirname, 'fixture/html', '*.input.js')).forEach(function (file) {
- tt.test(path.basename(file), function (t) {
- documentation.build([file], readOptionsFromFile(file), function (err, result) {
- t.ifError(err);
- outputHtml(result, null, function (err, result) {
- t.ifError(err);
- var clean = result.sort(function (a, b) {
- return a.path > b.path;
- }).filter(function (r) {
- return r.path.match(/(html)$/);
- }).map(function (r) {
- return r.contents;
- }).join('\n');
- var outputfile = file.replace('.input.js', '.output.files');
- if (UPDATE) {
- fs.writeFileSync(outputfile, clean, 'utf8');
- }
- var expect = fs.readFileSync(outputfile, 'utf8');
- t.deepEqual(clean, expect);
- t.end();
- });
- });
- });
- });
- tt.end();
-});
-
-test('outputs', function (ttt) {
- glob.sync(path.join(__dirname, 'fixture', '*.input.js')).forEach(function (file) {
- ttt.test(path.basename(file), function (tt) {
- documentation.build([file], readOptionsFromFile(file), function (err, result) {
- tt.ifError(err);
-
- tt.test('markdown', function (t) {
- outputMarkdown(_.cloneDeep(result), {}, function (err, result) {
- t.ifError(err);
- var outputfile = file.replace('.input.js', '.output.md');
- if (UPDATE) {
- fs.writeFileSync(outputfile, result, 'utf8');
- }
- var expect = fs.readFileSync(outputfile, 'utf8');
- t.equal(result.toString(), expect, 'markdown output correct');
- t.end();
- });
- });
-
- tt.test('markdown AST', function (t) {
- outputMarkdownAST(_.cloneDeep(result), {}, function (err, result) {
- t.ifError(err);
- var outputfile = file.replace('.input.js', '.output.md.json');
- if (UPDATE) {
- fs.writeFileSync(outputfile, JSON.stringify(result, null, 2), 'utf8');
- }
- var expect = JSON.parse(fs.readFileSync(outputfile, 'utf8'));
- t.deepEqual(result, expect, 'markdown AST output correct');
- t.end();
- });
- });
-
- tt.test('JSON', function (t) {
- normalize(result);
- result.forEach(function (comment) {
- validate(comment, documentationSchema.jsonSchema).errors.forEach(function (error) {
- t.ifError(error);
- });
- });
- var outputfile = file.replace('.input.js', '.output.json');
- if (UPDATE) {
- fs.writeFileSync(outputfile, JSON.stringify(result, null, 2));
- }
- var expect = require(outputfile);
- t.deepEqual(makePOJO(result), expect);
- t.end();
- });
-
- tt.end();
- });
- });
- });
- ttt.end();
-});
-
-test('outputs - sync', function (ttt) {
- glob.sync(path.join(__dirname, 'fixture/sync', '*.input.js')).forEach(function (file) {
- ttt.test(path.basename(file), function (tt) {
- var result = documentation.buildSync([file], readOptionsFromFile(file));
-
- tt.test('markdown', function (t) {
- outputMarkdown(result, {}, function (err, result) {
- t.ifError(err);
- var outputfile = file.replace('.input.js', '.output.md');
- if (UPDATE) {
- fs.writeFileSync(outputfile, result, 'utf8');
- }
- var expect = fs.readFileSync(outputfile, 'utf8');
- t.equal(result.toString(), expect, 'markdown output correct');
- t.end();
- });
- });
-
- tt.test('markdown AST', function (t) {
- outputMarkdownAST(result, {}, function (err, result) {
- t.ifError(err);
- var outputfile = file.replace('.input.js', '.output.md.json');
- if (UPDATE) {
- fs.writeFileSync(outputfile, JSON.stringify(result, null, 2), 'utf8');
- }
- var expect = JSON.parse(fs.readFileSync(outputfile, 'utf8'));
- t.deepEqual(result, expect, 'markdown AST output correct');
- t.end();
- });
- });
-
- tt.test('JSON', function (t) {
- normalize(result);
- var outputfile = file.replace('.input.js', '.output.json');
- if (UPDATE) {
- fs.writeFileSync(outputfile, JSON.stringify(result, null, 2));
- }
- var expect = require(outputfile);
- t.deepEqual(makePOJO(result), expect);
- t.end();
- });
-
- tt.end();
- });
- });
- ttt.end();
-});
-
-test('highlightAuto md output', function (t) {
- var file = path.join(__dirname, 'fixture/auto_lang_hljs/multilanguage.input.js'),
- hljsConfig = {hljs: {highlightAuto: true, languages: ['js', 'css', 'html']}};
-
- documentation.build(file, null, function (err, result) {
- t.ifError(err);
- outputMarkdown(result, hljsConfig, function (err, result) {
- t.ifError(err);
- var outputfile = file.replace('.input.js', '.output.md');
- if (UPDATE) {
- fs.writeFileSync(outputfile, result, 'utf8');
- }
- var expect = fs.readFileSync(outputfile, 'utf8');
- t.equal(result.toString(), expect, 'recognizes examples in html, css and js');
- t.end();
- });
- });
-});
-
-test('multi-file input', function (t) {
- documentation.build([
- path.join(__dirname, 'fixture', 'simple.input.js'),
- path.join(__dirname, 'fixture', 'simple-two.input.js')
- ], null, function (err, result) {
- t.ifError(err);
- normalize(result);
- var outputfile = path.join(__dirname, 'fixture', '_multi-file-input.json');
- if (UPDATE) {
- fs.writeFileSync(outputfile, JSON.stringify(result, null, 2));
- }
- var expect = require(outputfile);
- t.deepEqual(result, expect);
- t.end();
- });
-});
-
-test('accepts simple relative paths', function (t) {
- chdir(__dirname, function () {
- documentation.build('fixture/simple.input.js', null, function (err, data) {
- t.ifError(err);
- t.equal(data.length, 1, 'simple has no dependencies');
- t.end();
- });
- });
-});
-
-test('.lint', function (t) {
- chdir(__dirname, function () {
- documentation.lint('fixture/simple.input.js', null, function (err, data) {
- t.ifError(err);
- t.equal(data, '', 'outputs lint information');
- t.end();
- });
- });
-});
-
-test('.lint with bad input', function (t) {
- chdir(__dirname, function () {
- documentation.lint('fixture/bad/syntax.input.js', null, function (err, data) {
- t.ok(err, 'returns an error when syntax is incorrect');
- t.end();
- });
- });
-});
diff --git a/test/utils.js b/test/utils.js
deleted file mode 100644
index e9b075614..000000000
--- a/test/utils.js
+++ /dev/null
@@ -1,15 +0,0 @@
-var http = require('http'),
- concat = require('concat-stream');
-
-function get(url, callback) {
- http.get(url, function (res) {
- res.pipe(concat(function (text) {
- if (res.statusCode >= 400) {
- return callback(res.statusCode);
- }
- callback(text.toString());
- }));
- });
-}
-
-module.exports.get = get;