From 51d4478ac2daee58cfca64d2a655f9c2d2a37a51 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 3 Nov 2015 10:50:18 -0500 Subject: [PATCH] Refactor Markdown AST representation. Fixes #216 --- lib/output/markdown.js | 5 +- lib/output/markdown_ast.js | 53 +- test/fixture/class.output.custom.md | 11 - test/fixture/class.output.md | 11 - test/fixture/class.output.md.json | 715 ++++++------- test/fixture/default-param.output.custom.md | 3 - test/fixture/default-param.output.md | 3 - test/fixture/default-param.output.md.json | 179 ++-- test/fixture/es6-import.output.custom.md | 25 - test/fixture/es6-import.output.md | 25 - test/fixture/es6-import.output.md.json | 972 +++++++----------- test/fixture/es6.output.custom.md | 21 - test/fixture/es6.output.md | 21 - test/fixture/es6.output.md.json | 790 ++++++-------- test/fixture/event.output.custom.md | 3 - test/fixture/event.output.md | 3 - test/fixture/event.output.md.json | 315 +++--- test/fixture/external.output.custom.md | 2 - test/fixture/external.output.md | 2 - test/fixture/external.output.md.json | 132 +-- test/fixture/factory.output.custom.md | 11 - test/fixture/factory.output.md | 11 - test/fixture/factory.output.md.json | 352 +++---- test/fixture/flow-default.output.custom.md | 4 - test/fixture/flow-default.output.md | 4 - test/fixture/flow-default.output.md.json | 282 +++-- test/fixture/flow-types.output.custom.md | 4 - test/fixture/flow-types.output.md | 4 - test/fixture/flow-types.output.md.json | 548 +++++----- test/fixture/infer-params.output.custom.md | 3 - test/fixture/infer-params.output.md | 3 - test/fixture/infer-params.output.md.json | 543 +++++----- test/fixture/inline-link.output.custom.md | 8 - test/fixture/inline-link.output.md | 8 - test/fixture/inline-link.output.md.json | 520 +++++----- test/fixture/internal.output.custom.md | 2 - test/fixture/internal.output.md | 2 - test/fixture/internal.output.md.json | 132 +-- test/fixture/jsx.output.custom.md | 3 - test/fixture/jsx.output.md | 3 - test/fixture/jsx.output.md.json | 137 +-- test/fixture/multiexample.output.custom.md | 5 - test/fixture/multiexample.output.md | 5 - test/fixture/multiexample.output.md.json | 185 ++-- test/fixture/multisignature.output.custom.md | 8 - test/fixture/multisignature.output.md | 8 - test/fixture/multisignature.output.md.json | 426 ++++---- test/fixture/nearby_params.output.custom.md | 4 - test/fixture/nearby_params.output.md | 4 - test/fixture/nearby_params.output.md.json | 672 ++++++------ .../nested_properties.output.custom.md | 6 - test/fixture/nested_properties.output.md | 6 - test/fixture/nested_properties.output.md.json | 401 ++++---- .../newline-in-description.output.custom.md | 3 - test/fixture/newline-in-description.output.md | 3 - .../newline-in-description.output.md.json | 211 ++-- test/fixture/no-name.output.custom.md | 3 - test/fixture/no-name.output.md | 3 - test/fixture/no-name.output.md.json | 161 ++- test/fixture/optional.output.custom.md | 5 - test/fixture/optional.output.md | 5 - test/fixture/optional.output.md.json | 383 ++++--- test/fixture/param_nest.output.custom.md | 3 - test/fixture/param_nest.output.md | 3 - test/fixture/param_nest.output.md.json | 695 ++++++------- test/fixture/simple-hashbang.output.custom.md | 3 - test/fixture/simple-hashbang.output.md | 3 - test/fixture/simple-hashbang.output.md.json | 137 +-- test/fixture/simple-two.output.custom.md | 6 - test/fixture/simple-two.output.md | 6 - test/fixture/simple-two.output.md.json | 300 +++--- test/fixture/simple.output.custom.md | 3 - test/fixture/simple.output.md | 3 - test/fixture/simple.output.md.json | 137 +-- test/fixture/throws.output.custom.md | 6 - test/fixture/throws.output.md | 6 - test/fixture/throws.output.md.json | 300 +++--- test/fixture/trailing-only.output.custom.md | 3 - test/fixture/trailing-only.output.md | 3 - test/fixture/trailing-only.output.md.json | 137 +-- test/fixture/trailing.output.custom.md | 8 - test/fixture/trailing.output.md | 8 - test/fixture/trailing.output.md.json | 342 +++--- .../fixture/type_application.output.custom.md | 3 - test/fixture/type_application.output.md | 3 - test/fixture/type_application.output.md.json | 201 ++-- test/fixture/typedef.output.custom.md | 3 - test/fixture/typedef.output.md | 3 - test/fixture/typedef.output.md.json | 315 +++--- test/fixture/untyped-param.output.custom.md | 3 - test/fixture/untyped-param.output.md | 3 - test/fixture/untyped-param.output.md.json | 183 ++-- 92 files changed, 4762 insertions(+), 6449 deletions(-) diff --git a/lib/output/markdown.js b/lib/output/markdown.js index 03d1ee95f..004df77b7 100644 --- a/lib/output/markdown.js +++ b/lib/output/markdown.js @@ -1,6 +1,7 @@ 'use strict'; var mdast = require('mdast'), + toc = require('mdast-toc'), markdownAST = require('./markdown_ast'); /** @@ -14,7 +15,9 @@ var mdast = require('mdast'), * @return {undefined} calls callback */ module.exports = function (comments, opts, callback) { + var processor = mdast().use(toc); markdownAST(comments, opts, function (err, ast) { - return callback(null, mdast.stringify(ast)); + var processedAST = processor.run(ast); + return callback(null, processor.stringify(processedAST)); }); }; diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js index 380c31360..c97dabc36 100644 --- a/lib/output/markdown_ast.js +++ b/lib/output/markdown_ast.js @@ -45,14 +45,14 @@ function commentsToAST(comments, opts, callback) { } function paramSection(comment) { - return !!comment.params && u('root', [ + return !!comment.params && [ u('strong', [u('text', 'Parameters')]), paramList(comment.params) - ]); + ]; } function propertySection(comment) { - return !!comment.properties && u('root', [ + return !!comment.properties && [ u('strong', [u('text', 'Properties')]), u('list', { ordered: false }, comment.properties.map(function (property) { @@ -66,46 +66,47 @@ function commentsToAST(comments, opts, callback) { ]) ].filter(Boolean)) })) - ]); + ]; } function examplesSection(comment) { - return !!comment.examples && u('root', [ - u('strong', [u('text', 'Examples')]), - u('root', comment.examples.map(function (example) { + return !!comment.examples && [u('strong', [u('text', 'Examples')])] + .concat(comment.examples.map(function (example) { return u('code', { lang: 'javascript' }, example); - })) - ]); + })); } function returnsSection(comment) { - return !!comment.returns && u('root', comment.returns.map(function (returns) { + return !!comment.returns && comment.returns.map(function (returns) { return u('paragraph', [ u('text', 'Returns '), u('strong', [u('text', formatType(returns.type))]), u('text', ' '), mdast.parse(formatInlineTags(returns.description)) ]); - })); + }); } - return u('root', [ - u('heading', { depth: depth }, [u('text', comment.name)]), - mdast.parse(formatInlineTags(comment.description)), - paramSection(comment), - propertySection(comment), - examplesSection(comment), - returnsSection(comment), - !!comment.members.instance.length && - u('root', comment.members.instance.map(generate.bind(null, depth + 1))), - !!comment.members.static.length && - u('root', comment.members.static.map(generate.bind(null, depth + 1))) - ].filter(Boolean)); + return [u('heading', { depth: depth }, [u('text', comment.name)])] + .concat(mdast.parse(formatInlineTags(comment.description)).children[0]) + .concat(paramSection(comment)) + .concat(propertySection(comment)) + .concat(examplesSection(comment)) + .concat(returnsSection(comment)) + .concat(!!comment.members.instance.length && + comment.members.instance.reduce(function (memo, child) { + return memo.concat(generate(depth + 1, child)); + }, [])) + .concat(!!comment.members.static.length && + comment.members.static.reduce(function (memo, child) { + return memo.concat(generate(depth + 1, child)); + }, [])) + .filter(Boolean); } - return callback(null, u('root', comments.map(function (comment) { - return generate(1, comment); - }))); + return callback(null, u('root', comments.reduce(function (memo, comment) { + return memo.concat(generate(1, comment)); + }, []))); } module.exports = commentsToAST; diff --git a/test/fixture/class.output.custom.md b/test/fixture/class.output.custom.md index f88770e93..e062c9555 100644 --- a/test/fixture/class.output.custom.md +++ b/test/fixture/class.output.custom.md @@ -2,37 +2,26 @@ This is my class, a demo thing. - **Properties** - `howMany` how many things it contains - ## getFoo Get the number 42 - **Parameters** - `getIt` **boolean** whether to get the number - Returns **number** forty-two - - ## getUndefined Get undefined - Returns **undefined** does not return anything. - - - - diff --git a/test/fixture/class.output.md b/test/fixture/class.output.md index f88770e93..e062c9555 100644 --- a/test/fixture/class.output.md +++ b/test/fixture/class.output.md @@ -2,37 +2,26 @@ This is my class, a demo thing. - **Properties** - `howMany` how many things it contains - ## getFoo Get the number 42 - **Parameters** - `getIt` **boolean** whether to get the number - Returns **number** forty-two - - ## getUndefined Get undefined - Returns **undefined** does not return anything. - - - - diff --git a/test/fixture/class.output.md.json b/test/fixture/class.output.md.json index cf260b179..c861f3aa1 100644 --- a/test/fixture/class.output.md.json +++ b/test/fixture/class.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "MyClass" - } - ] - }, + "type": "text", + "value": "MyClass" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my class, a demo thing.", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 32 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 32 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "This is my class, a demo thing.", "position": { "start": { "line": 1, @@ -57,122 +25,63 @@ "end": { "line": 1, "column": 32 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, + "end": { + "line": 1, + "column": 32 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", + "type": "text", + "value": "Properties" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "type": "inlineCode", + "value": "howMany" + }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "howMany" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "how many things it contains", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "root", - "children": [ - { - "type": "root", - "children": [ + "type": "text", + "value": " " + }, { - "depth": 2, - "type": "heading", + "type": "text", "children": [ { "type": "text", - "value": "getFoo" + "value": "number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -181,7 +90,7 @@ "children": [ { "type": "text", - "value": "Get the number 42", + "value": "how many things it contains", "position": { "start": { "line": 1, @@ -189,7 +98,7 @@ }, "end": { "line": 1, - "column": 18 + "column": 28 }, "indent": [] } @@ -202,7 +111,7 @@ }, "end": { "line": 1, - "column": 18 + "column": 28 }, "indent": [] } @@ -215,195 +124,97 @@ }, "end": { "line": 1, - "column": 18 + "column": 28 } } - }, - { - "type": "root", - "children": [ - { - "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": [ - { - "type": "text", - "value": "boolean" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "whether to get the number", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "forty-two", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ] - } - ] } ] + } + ] + } + ] + }, + { + "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 }, + "end": { + "line": 1, + "column": 18 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 18 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 2, - "type": "heading", + "type": "inlineCode", + "value": "getIt" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "getUndefined" + "value": "boolean" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -412,7 +223,7 @@ "children": [ { "type": "text", - "value": "Get undefined", + "value": "whether to get the number", "position": { "start": { "line": 1, @@ -420,7 +231,7 @@ }, "end": { "line": 1, - "column": 14 + "column": 26 }, "indent": [] } @@ -433,7 +244,7 @@ }, "end": { "line": 1, - "column": 14 + "column": 26 }, "indent": [] } @@ -446,88 +257,192 @@ }, "end": { "line": 1, - "column": 14 + "column": 26 } } - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "undefined" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "does not return anything.", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ] - } - ] } ] } ] } ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "number" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "forty-two", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + } + } + ] + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "getUndefined" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Get undefined", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 14 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 14 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "undefined" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "does not return anything.", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + } + } + ] } ] } \ No newline at end of file diff --git a/test/fixture/default-param.output.custom.md b/test/fixture/default-param.output.custom.md index 317a873b8..0a9c79d69 100644 --- a/test/fixture/default-param.output.custom.md +++ b/test/fixture/default-param.output.custom.md @@ -2,10 +2,7 @@ Very Important Transform - **Parameters** - `foo` (optional, default `'bar'`) - - diff --git a/test/fixture/default-param.output.md b/test/fixture/default-param.output.md index 317a873b8..0a9c79d69 100644 --- a/test/fixture/default-param.output.md +++ b/test/fixture/default-param.output.md @@ -2,10 +2,7 @@ Very Important Transform - **Parameters** - `foo` (optional, default `'bar'`) - - diff --git a/test/fixture/default-param.output.md.json b/test/fixture/default-param.output.md.json index c88621473..12fa8ad85 100644 --- a/test/fixture/default-param.output.md.json +++ b/test/fixture/default-param.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "veryImportantTransform" - } - ] - }, + "type": "text", + "value": "veryImportantTransform" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Very Important Transform", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "Very Important Transform", "position": { "start": { "line": 1, @@ -57,75 +25,82 @@ "end": { "line": 1, "column": 25 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 25 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "foo" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, + { + "type": "text", + "value": " " + }, { - "type": "listItem", + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "paragraph", "children": [ { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "foo" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "'bar'" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "'bar'" + }, + { + "type": "text", + "value": ")" } ] } diff --git a/test/fixture/es6-import.output.custom.md b/test/fixture/es6-import.output.custom.md index eb0137614..a1712d6eb 100644 --- a/test/fixture/es6-import.output.custom.md +++ b/test/fixture/es6-import.output.custom.md @@ -2,12 +2,8 @@ This is a sink - ## constructor - - - **Parameters** - `height` **number** the height of the thing @@ -15,34 +11,22 @@ This is a sink - `width` **number** the width of the thing - - ## empty Is it empty - - - ## hello This method says hello - - - - # foo This is an async method - - # multiply This function returns the number one. - **Parameters** - `a` @@ -50,30 +34,21 @@ This function returns the number one. - `b` - Returns **Number** numberone - - # multiplyTwice This function returns the number one. - **Parameters** - `a` - Returns **Number** numberone - - # staticProp This is a property of the sink. - - diff --git a/test/fixture/es6-import.output.md b/test/fixture/es6-import.output.md index eb0137614..a1712d6eb 100644 --- a/test/fixture/es6-import.output.md +++ b/test/fixture/es6-import.output.md @@ -2,12 +2,8 @@ This is a sink - ## constructor - - - **Parameters** - `height` **number** the height of the thing @@ -15,34 +11,22 @@ This is a sink - `width` **number** the width of the thing - - ## empty Is it empty - - - ## hello This method says hello - - - - # foo This is an async method - - # multiply This function returns the number one. - **Parameters** - `a` @@ -50,30 +34,21 @@ This function returns the number one. - `b` - Returns **Number** numberone - - # multiplyTwice This function returns the number one. - **Parameters** - `a` - Returns **Number** numberone - - # staticProp This is a property of the sink. - - diff --git a/test/fixture/es6-import.output.md.json b/test/fixture/es6-import.output.md.json index 96735767a..e60af5d6d 100644 --- a/test/fixture/es6-import.output.md.json +++ b/test/fixture/es6-import.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Sink" - } - ] - }, + "type": "text", + "value": "Sink" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a sink", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "This is a sink", "position": { "start": { "line": 1, @@ -57,228 +25,73 @@ "end": { "line": 1, "column": 15 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 15 }, + "indent": [] + } + }, + { + "depth": 2, + "type": "heading", + "children": [ { - "type": "root", + "type": "text", + "value": "constructor" + } + ] + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "constructor" - } - ] + "type": "inlineCode", + "value": "height" }, { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } + "type": "text", + "value": " " }, { - "type": "root", - "children": [ - { - "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": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "width" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "root", - "children": [ - { - "depth": 2, - "type": "heading", + "type": "strong", "children": [ { "type": "text", - "value": "empty" + "value": "number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -287,7 +100,7 @@ "children": [ { "type": "text", - "value": "Is it empty", + "value": "the height of the thing", "position": { "start": { "line": 1, @@ -295,7 +108,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 24 }, "indent": [] } @@ -308,7 +121,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 24 }, "indent": [] } @@ -321,7 +134,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 24 } } } @@ -330,21 +143,32 @@ ] }, { - "type": "root", + "type": "listItem", "children": [ { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 2, - "type": "heading", + "type": "inlineCode", + "value": "width" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "hello" + "value": "number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -353,7 +177,7 @@ "children": [ { "type": "text", - "value": "This method says hello", + "value": "the width of the thing", "position": { "start": { "line": 1, @@ -398,53 +222,62 @@ ] }, { - "type": "root", + "depth": 2, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] + "type": "text", + "value": "empty" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Is it empty", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 }, + "indent": [] + } + }, + { + "depth": 2, + "type": "heading", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is an async method", - "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": "text", + "value": "hello" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method says hello", "position": { "start": { "line": 1, @@ -452,60 +285,81 @@ }, "end": { "line": 1, - "column": 24 - } + "column": 23 + }, + "indent": [] } } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + }, + "indent": [] + } + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "foo" + } ] }, { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "multiply" - } - ] + "type": "text", + "value": "This is an async method", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 24 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, + "end": { + "line": 1, + "column": 24 + }, + "indent": [] + } + }, + { + "depth": 1, + "type": "heading", + "children": [ { - "type": "root", - "children": [ - { - "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": "text", + "value": "multiply" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function returns the number one.", "position": { "start": { "line": 1, @@ -514,119 +368,85 @@ "end": { "line": 1, "column": 38 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "a" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] - } - ] + "type": "text", + "value": " " }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 } - ] + } } ] } ] }, { - "type": "root", + "type": "listItem", "children": [ { "type": "paragraph", "children": [ { - "type": "text", - "value": "Returns " + "type": "inlineCode", + "value": "b" }, { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Number" - } - ] + "type": "text", + "value": " " }, { "type": "text", @@ -634,39 +454,7 @@ }, { "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], + "children": [], "position": { "start": { "line": 1, @@ -674,7 +462,7 @@ }, "end": { "line": 1, - "column": 10 + "column": 1 } } } @@ -685,18 +473,25 @@ ] }, { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "multiplyTwice" + "value": "Number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -705,7 +500,7 @@ "children": [ { "type": "text", - "value": "This function returns the number one.", + "value": "numberone", "position": { "start": { "line": 1, @@ -713,7 +508,7 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 }, "indent": [] } @@ -726,7 +521,7 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 }, "indent": [] } @@ -739,84 +534,79 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 } } - }, + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ { - "type": "root", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] + "type": "text", + "value": "multiplyTwice" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function returns the number one.", + "position": { + "start": { + "line": 1, + "column": 1 }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "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": "root", + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { "type": "paragraph", "children": [ { - "type": "text", - "value": "Returns " + "type": "inlineCode", + "value": "a" }, { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Number" - } - ] + "type": "text", + "value": " " }, { "type": "text", @@ -824,39 +614,7 @@ }, { "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], + "children": [], "position": { "start": { "line": 1, @@ -864,7 +622,7 @@ }, "end": { "line": 1, - "column": 10 + "column": 1 } } } @@ -875,18 +633,25 @@ ] }, { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "staticProp" + "value": "Number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -895,7 +660,7 @@ "children": [ { "type": "text", - "value": "This is a property of the sink.", + "value": "numberone", "position": { "start": { "line": 1, @@ -903,7 +668,7 @@ }, "end": { "line": 1, - "column": 32 + "column": 10 }, "indent": [] } @@ -916,7 +681,7 @@ }, "end": { "line": 1, - "column": 32 + "column": 10 }, "indent": [] } @@ -929,11 +694,52 @@ }, "end": { "line": 1, - "column": 32 + "column": 10 } } } ] + }, + { + "depth": 1, + "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 + }, + "end": { + "line": 1, + "column": 32 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 32 + }, + "indent": [] + } } ] } \ No newline at end of file diff --git a/test/fixture/es6.output.custom.md b/test/fixture/es6.output.custom.md index 9d53be7a7..da0496748 100644 --- a/test/fixture/es6.output.custom.md +++ b/test/fixture/es6.output.custom.md @@ -2,12 +2,8 @@ This is a sink - ## constructor - - - **Parameters** - `height` **number** the height of the thing @@ -15,34 +11,22 @@ This is a sink - `width` **number** the width of the thing - - ## empty Is it empty - - - ## hello This method says hello - - - - # foo This is an async method - - # multiply This function returns the number one. - **Parameters** - `a` @@ -50,14 +34,9 @@ This function returns the number one. - `b` - Returns **Number** numberone - - # staticProp This is a property of the sink. - - diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md index 9d53be7a7..da0496748 100644 --- a/test/fixture/es6.output.md +++ b/test/fixture/es6.output.md @@ -2,12 +2,8 @@ This is a sink - ## constructor - - - **Parameters** - `height` **number** the height of the thing @@ -15,34 +11,22 @@ This is a sink - `width` **number** the width of the thing - - ## empty Is it empty - - - ## hello This method says hello - - - - # foo This is an async method - - # multiply This function returns the number one. - **Parameters** - `a` @@ -50,14 +34,9 @@ This function returns the number one. - `b` - Returns **Number** numberone - - # staticProp This is a property of the sink. - - diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json index 9814a66cb..b1d99cfb4 100644 --- a/test/fixture/es6.output.md.json +++ b/test/fixture/es6.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Sink" - } - ] - }, + "type": "text", + "value": "Sink" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a sink", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "This is a sink", "position": { "start": { "line": 1, @@ -57,228 +25,73 @@ "end": { "line": 1, "column": 15 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 15 }, + "indent": [] + } + }, + { + "depth": 2, + "type": "heading", + "children": [ { - "type": "root", + "type": "text", + "value": "constructor" + } + ] + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "constructor" - } - ] + "type": "inlineCode", + "value": "height" }, { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } + "type": "text", + "value": " " }, { - "type": "root", - "children": [ - { - "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": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "width" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "root", - "children": [ - { - "depth": 2, - "type": "heading", + "type": "strong", "children": [ { "type": "text", - "value": "empty" + "value": "number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -287,7 +100,7 @@ "children": [ { "type": "text", - "value": "Is it empty", + "value": "the height of the thing", "position": { "start": { "line": 1, @@ -295,7 +108,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 24 }, "indent": [] } @@ -308,7 +121,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 24 }, "indent": [] } @@ -321,7 +134,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 24 } } } @@ -330,21 +143,32 @@ ] }, { - "type": "root", + "type": "listItem", "children": [ { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 2, - "type": "heading", + "type": "inlineCode", + "value": "width" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "hello" + "value": "number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -353,7 +177,7 @@ "children": [ { "type": "text", - "value": "This method says hello", + "value": "the width of the thing", "position": { "start": { "line": 1, @@ -398,53 +222,62 @@ ] }, { - "type": "root", + "depth": 2, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] + "type": "text", + "value": "empty" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Is it empty", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, + "end": { + "line": 1, + "column": 12 + }, + "indent": [] + } + }, + { + "depth": 2, + "type": "heading", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is an async method", - "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": "text", + "value": "hello" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method says hello", "position": { "start": { "line": 1, @@ -452,60 +285,81 @@ }, "end": { "line": 1, - "column": 24 - } + "column": 23 + }, + "indent": [] } } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + }, + "indent": [] + } + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "foo" + } ] }, { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "multiply" - } - ] + "type": "text", + "value": "This is an async method", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 24 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 24 }, + "indent": [] + } + }, + { + "depth": 1, + "type": "heading", + "children": [ { - "type": "root", - "children": [ - { - "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": "text", + "value": "multiply" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function returns the number one.", "position": { "start": { "line": 1, @@ -514,119 +368,85 @@ "end": { "line": 1, "column": 38 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "a" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] - } - ] + "type": "text", + "value": " " }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 } - ] + } } ] } ] }, { - "type": "root", + "type": "listItem", "children": [ { "type": "paragraph", "children": [ { - "type": "text", - "value": "Returns " + "type": "inlineCode", + "value": "b" }, { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Number" - } - ] + "type": "text", + "value": " " }, { "type": "text", @@ -634,39 +454,7 @@ }, { "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], + "children": [], "position": { "start": { "line": 1, @@ -674,7 +462,7 @@ }, "end": { "line": 1, - "column": 10 + "column": 1 } } } @@ -685,18 +473,25 @@ ] }, { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "staticProp" + "value": "Number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -705,7 +500,7 @@ "children": [ { "type": "text", - "value": "This is a property of the sink.", + "value": "numberone", "position": { "start": { "line": 1, @@ -713,7 +508,7 @@ }, "end": { "line": 1, - "column": 32 + "column": 10 }, "indent": [] } @@ -726,7 +521,7 @@ }, "end": { "line": 1, - "column": 32 + "column": 10 }, "indent": [] } @@ -739,11 +534,52 @@ }, "end": { "line": 1, - "column": 32 + "column": 10 } } } ] + }, + { + "depth": 1, + "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 + }, + "end": { + "line": 1, + "column": 32 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 32 + }, + "indent": [] + } } ] } \ No newline at end of file diff --git a/test/fixture/event.output.custom.md b/test/fixture/event.output.custom.md index 5f80df6c5..20eaaacd0 100644 --- a/test/fixture/event.output.custom.md +++ b/test/fixture/event.output.custom.md @@ -2,12 +2,9 @@ Mouse event - **Properties** - `point` the pixel location of the event - `originalEvent` the original DOM event - - diff --git a/test/fixture/event.output.md b/test/fixture/event.output.md index 5f80df6c5..20eaaacd0 100644 --- a/test/fixture/event.output.md +++ b/test/fixture/event.output.md @@ -2,12 +2,9 @@ Mouse event - **Properties** - `point` the pixel location of the event - `originalEvent` the original DOM event - - diff --git a/test/fixture/event.output.md.json b/test/fixture/event.output.md.json index d6975a113..0460c1bb2 100644 --- a/test/fixture/event.output.md.json +++ b/test/fixture/event.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Map#mousemove" - } - ] - }, + "type": "text", + "value": "Map#mousemove" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Mouse event", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "Mouse event", "position": { "start": { "line": 1, @@ -57,87 +25,72 @@ "end": { "line": 1, "column": 12 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Properties" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "point" + }, { "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, { - "type": "listItem", + "type": "text", + "children": [ + { + "type": "text", + "value": "Point" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "point" - }, - { - "type": "text", - "value": " " - }, { "type": "text", - "children": [ - { - "type": "text", - "value": "Point" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the pixel location of the event", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 32 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 32 - }, - "indent": [] - } - } - ], + "value": "the pixel location of the event", "position": { "start": { "line": 1, @@ -146,75 +99,75 @@ "end": { "line": 1, "column": 32 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 32 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 32 + } + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "originalEvent" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "children": [ + { + "type": "text", + "value": "Event" } ] }, { - "type": "listItem", + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "originalEvent" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "children": [ - { - "type": "text", - "value": "Event" - } - ] - }, { "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the original DOM event", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], + "value": "the original DOM event", "position": { "start": { "line": 1, @@ -223,12 +176,34 @@ "end": { "line": 1, "column": 23 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + }, + "indent": [] + } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + } + } } ] } diff --git a/test/fixture/external.output.custom.md b/test/fixture/external.output.custom.md index 9b47a60c1..069747607 100644 --- a/test/fixture/external.output.custom.md +++ b/test/fixture/external.output.custom.md @@ -1,5 +1,3 @@ # foo I am in `external.input.js`. - - diff --git a/test/fixture/external.output.md b/test/fixture/external.output.md index 9b47a60c1..069747607 100644 --- a/test/fixture/external.output.md +++ b/test/fixture/external.output.md @@ -1,5 +1,3 @@ # foo I am in `external.input.js`. - - diff --git a/test/fixture/external.output.md.json b/test/fixture/external.output.md.json index e71a85de7..b0488877d 100644 --- a/test/fixture/external.output.md.json +++ b/test/fixture/external.output.md.json @@ -2,95 +2,75 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, + "type": "text", + "value": "foo" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "I am in ", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "external.input.js", - "position": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 29 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "I am in ", "position": { "start": { "line": 1, "column": 1 }, + "end": { + "line": 1, + "column": 9 + }, + "indent": [] + } + }, + { + "type": "inlineCode", + "value": "external.input.js", + "position": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + }, + "indent": [] + } + }, + { + "type": "text", + "value": ".", + "position": { + "start": { + "line": 1, + "column": 28 + }, "end": { "line": 1, "column": 29 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 29 + }, + "indent": [] + } } ] } \ No newline at end of file diff --git a/test/fixture/factory.output.custom.md b/test/fixture/factory.output.custom.md index 3d303e197..bf34354f5 100644 --- a/test/fixture/factory.output.custom.md +++ b/test/fixture/factory.output.custom.md @@ -2,32 +2,21 @@ an area chart generator - Returns **area** chart - - # area - - - **Parameters** - `selection` - - # data Sets the chart data. - **Parameters** - `_` - - diff --git a/test/fixture/factory.output.md b/test/fixture/factory.output.md index 3d303e197..bf34354f5 100644 --- a/test/fixture/factory.output.md +++ b/test/fixture/factory.output.md @@ -2,32 +2,21 @@ an area chart generator - Returns **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 index faf4bf354..02c3897e2 100644 --- a/test/fixture/factory.output.md.json +++ b/test/fixture/factory.output.md.json @@ -2,11 +2,55 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "area" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "an area chart generator", + "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": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", @@ -14,6 +58,10 @@ } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -22,7 +70,7 @@ "children": [ { "type": "text", - "value": "an area chart generator", + "value": "chart", "position": { "start": { "line": 1, @@ -30,7 +78,7 @@ }, "end": { "line": 1, - "column": 24 + "column": 6 }, "indent": [] } @@ -43,7 +91,7 @@ }, "end": { "line": 1, - "column": 24 + "column": 6 }, "indent": [] } @@ -56,28 +104,48 @@ }, "end": { "line": 1, - "column": 24 + "column": 6 } } - }, + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ { - "type": "root", + "type": "text", + "value": "area" + } + ] + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { "type": "paragraph", "children": [ { - "type": "text", - "value": "Returns " + "type": "inlineCode", + "value": "selection" }, { - "type": "strong", - "children": [ - { - "type": "text", - "value": "area" - } - ] + "type": "text", + "value": " " }, { "type": "text", @@ -85,39 +153,7 @@ }, { "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "chart", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - }, - "indent": [] - } - } - ], + "children": [], "position": { "start": { "line": 1, @@ -125,7 +161,7 @@ }, "end": { "line": 1, - "column": 6 + "column": 1 } } } @@ -136,21 +172,21 @@ ] }, { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "area" - } - ] - }, + "type": "text", + "value": "data" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [], + "type": "text", + "value": "Sets the chart data.", "position": { "start": { "line": 1, @@ -158,90 +194,58 @@ }, "end": { "line": 1, - "column": 1 - } + "column": 21 + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 21 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", - "children": [ - { - "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": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] - } - ] - } - ] - } - ] + "type": "text", + "value": "Parameters" } ] }, { - "type": "root", + "ordered": false, + "type": "list", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "data" - } - ] - }, - { - "type": "root", + "type": "listItem", "children": [ { "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "_" + }, + { + "type": "text", + "value": " " + }, { "type": "text", - "value": "Sets the chart data.", + "value": " " + }, + { + "type": "root", + "children": [], "position": { "start": { "line": 1, @@ -249,87 +253,9 @@ }, "end": { "line": 1, - "column": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - { - "type": "root", - "children": [ - { - "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": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "column": 1 } - ] + } } ] } diff --git a/test/fixture/flow-default.output.custom.md b/test/fixture/flow-default.output.custom.md index 59a03b1a2..e69104271 100644 --- a/test/fixture/flow-default.output.custom.md +++ b/test/fixture/flow-default.output.custom.md @@ -2,7 +2,6 @@ Very Important Transform - **Parameters** - `input` **Array<string>** @@ -10,8 +9,5 @@ Very Important Transform - `options` **[Object]** (optional, default `{}`) - Returns **string** - - diff --git a/test/fixture/flow-default.output.md b/test/fixture/flow-default.output.md index 59a03b1a2..e69104271 100644 --- a/test/fixture/flow-default.output.md +++ b/test/fixture/flow-default.output.md @@ -2,7 +2,6 @@ Very Important Transform - **Parameters** - `input` **Array<string>** @@ -10,8 +9,5 @@ Very Important Transform - `options` **[Object]** (optional, default `{}`) - Returns **string** - - diff --git a/test/fixture/flow-default.output.md.json b/test/fixture/flow-default.output.md.json index 9fdf8759c..054060272 100644 --- a/test/fixture/flow-default.output.md.json +++ b/test/fixture/flow-default.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "veryImportantTransform" - } - ] - }, + "type": "text", + "value": "veryImportantTransform" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Very Important Transform", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "Very Important Transform", "position": { "start": { "line": 1, @@ -57,152 +25,101 @@ "end": { "line": 1, "column": 25 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, + "end": { + "line": 1, + "column": 25 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "input" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, { - "type": "listItem", + "type": "strong", "children": [ { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "input" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Array<string>" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "text", + "value": "Array<string>" } ] }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "[Object]" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "{}" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 } - ] + } } ] } ] }, { - "type": "root", + "type": "listItem", "children": [ { "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "options" + }, { "type": "text", - "value": "Returns " + "value": " " }, { "type": "strong", "children": [ { "type": "text", - "value": "string" + "value": "[Object]" } ] }, @@ -223,12 +140,65 @@ "column": 1 } } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "{}" + }, + { + "type": "text", + "value": ")" + } + ] } ] } ] } ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "string" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ] } ] } \ No newline at end of file diff --git a/test/fixture/flow-types.output.custom.md b/test/fixture/flow-types.output.custom.md index 8ec8f2b08..8c77c5819 100644 --- a/test/fixture/flow-types.output.custom.md +++ b/test/fixture/flow-types.output.custom.md @@ -2,7 +2,6 @@ This function returns the number one. - **Parameters** - `a` **number** @@ -18,8 +17,5 @@ This function returns the number one. - `f` **Named** - Returns **number** - - diff --git a/test/fixture/flow-types.output.md b/test/fixture/flow-types.output.md index 8ec8f2b08..8c77c5819 100644 --- a/test/fixture/flow-types.output.md +++ b/test/fixture/flow-types.output.md @@ -2,7 +2,6 @@ This function returns the number one. - **Parameters** - `a` **number** @@ -18,8 +17,5 @@ This function returns the number one. - `f` **Named** - Returns **number** - - diff --git a/test/fixture/flow-types.output.md.json b/test/fixture/flow-types.output.md.json index e0bd551a5..357ce822b 100644 --- a/test/fixture/flow-types.output.md.json +++ b/test/fixture/flow-types.output.md.json @@ -2,27 +2,89 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addThem" - } - ] + "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": "root", + "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": [ + { + "type": "text", + "value": "number" + } + ] + }, { "type": "text", - "value": "This function returns the number one.", + "value": " " + }, + { + "type": "root", + "children": [], "position": { "start": { "line": 1, @@ -30,342 +92,214 @@ }, "end": { "line": 1, - "column": 38 - }, - "indent": [] + "column": 1 + } } } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 + ] } - } + ] }, { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "b" + }, { "type": "text", - "value": "Parameters" + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "string" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } } ] - }, + } + ] + }, + { + "type": "listItem", + "children": [ { - "ordered": false, - "type": "list", + "type": "paragraph", "children": [ { - "type": "listItem", + "type": "inlineCode", + "value": "c" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", "children": [ { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "text", + "value": "[boolean]" } ] }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 } - ] + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "d" + }, + { + "type": "text", + "value": " " }, { - "type": "listItem", + "type": "strong", "children": [ { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "c" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "[boolean]" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "text", + "value": "Array<number>" } ] }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "d" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Array<number>" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 } - ] + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "e" + }, + { + "type": "text", + "value": " " }, { - "type": "listItem", + "type": "strong", "children": [ { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "e" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "text", + "value": "Object" } ] }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "f" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Named" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 } - ] + } } ] } ] }, { - "type": "root", + "type": "listItem", "children": [ { "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "f" + }, { "type": "text", - "value": "Returns " + "value": " " }, { "type": "strong", "children": [ { "type": "text", - "value": "number" + "value": "Named" } ] }, @@ -392,6 +326,42 @@ ] } ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "number" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ] } ] } \ No newline at end of file diff --git a/test/fixture/infer-params.output.custom.md b/test/fixture/infer-params.output.custom.md index 5e2effbfa..e30ee55fc 100644 --- a/test/fixture/infer-params.output.custom.md +++ b/test/fixture/infer-params.output.custom.md @@ -2,7 +2,6 @@ This function returns the number one. - **Parameters** - `a` @@ -18,5 +17,3 @@ This function returns the number one. - `$3.f` - - diff --git a/test/fixture/infer-params.output.md b/test/fixture/infer-params.output.md index 5e2effbfa..e30ee55fc 100644 --- a/test/fixture/infer-params.output.md +++ b/test/fixture/infer-params.output.md @@ -2,7 +2,6 @@ This function returns the number one. - **Parameters** - `a` @@ -18,5 +17,3 @@ This function returns the number one. - `$3.f` - - diff --git a/test/fixture/infer-params.output.md.json b/test/fixture/infer-params.output.md.json index d85e61e2f..a34911797 100644 --- a/test/fixture/infer-params.output.md.json +++ b/test/fixture/infer-params.output.md.json @@ -2,27 +2,80 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addThem" - } - ] + "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": "root", + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "a" + }, { "type": "text", - "value": "This function returns the number one.", + "value": " " + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], "position": { "start": { "line": 1, @@ -30,73 +83,50 @@ }, "end": { "line": 1, - "column": 38 - }, - "indent": [] + "column": 1 + } } } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 + ] } - } + ] }, { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "b" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "number" + } + ] + }, + { + "type": "text", + "value": " " + }, { - "type": "listItem", + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "a" - }, { "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], + "value": "the second param", "position": { "start": { "line": 1, @@ -104,63 +134,133 @@ }, "end": { "line": 1, - "column": 1 - } + "column": 17 + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + }, + "indent": [] + } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "c" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$3" + }, + { + "type": "text", + "value": " " }, { - "type": "listItem", + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "ordered": false, + "type": "list", "children": [ { - "type": "paragraph", + "type": "listItem", "children": [ { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "$3.d" + }, { "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ + "value": " " + }, { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the second param", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - }, - "indent": [] - } - } - ], + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], "position": { "start": { "line": 1, @@ -168,206 +268,81 @@ }, "end": { "line": 1, - "column": 17 - }, - "indent": [] + "column": 1 + } } } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - } + ] } ] - } - ] - }, - { - "type": "listItem", - "children": [ + }, { - "type": "paragraph", + "type": "listItem", "children": [ { - "type": "inlineCode", - "value": "c" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$3.e" }, - "end": { - "line": 1, - "column": 1 + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } } - } + ] } ] - } - ] - }, - { - "type": "listItem", - "children": [ + }, { - "type": "paragraph", + "type": "listItem", "children": [ { - "type": "inlineCode", - "value": "$3" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "ordered": false, - "type": "list", + "type": "paragraph", "children": [ { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.d" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] - } - ] + "type": "inlineCode", + "value": "$3.f" }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.e" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] - } - ] + "type": "text", + "value": " " }, { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.f" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 } - ] + } } ] } diff --git a/test/fixture/inline-link.output.custom.md b/test/fixture/inline-link.output.custom.md index 0e638ead9..acdb9f095 100644 --- a/test/fixture/inline-link.output.custom.md +++ b/test/fixture/inline-link.output.custom.md @@ -2,31 +2,23 @@ Adds one to a number - **Parameters** - `a` **number** the input - Returns **number** the output - - # inline-link.input This function returns the number one. Internally, this uses `addOne` to do the math. - **Parameters** - `a` **number** the input - Returns **number** numberone - - diff --git a/test/fixture/inline-link.output.md b/test/fixture/inline-link.output.md index 0e638ead9..acdb9f095 100644 --- a/test/fixture/inline-link.output.md +++ b/test/fixture/inline-link.output.md @@ -2,31 +2,23 @@ Adds one to a number - **Parameters** - `a` **number** the input - Returns **number** the output - - # inline-link.input This function returns the number one. Internally, this uses `addOne` to do the math. - **Parameters** - `a` **number** the input - Returns **number** numberone - - diff --git a/test/fixture/inline-link.output.md.json b/test/fixture/inline-link.output.md.json index d7ebbb9e8..154c28252 100644 --- a/test/fixture/inline-link.output.md.json +++ b/test/fixture/inline-link.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addOne" - } - ] - }, + "type": "text", + "value": "addOne" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Adds one to a number", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "Adds one to a number", "position": { "start": { "line": 1, @@ -57,115 +25,49 @@ "end": { "line": 1, "column": 21 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, - { - "type": "root", - "children": [ - { - "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": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the input", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ] - } - ] - } - ] - } - ] + "end": { + "line": 1, + "column": 21 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "a" + }, { "type": "text", - "value": "Returns " + "value": " " }, { "type": "strong", @@ -188,7 +90,7 @@ "children": [ { "type": "text", - "value": "the output", + "value": "the input", "position": { "start": { "line": 1, @@ -196,7 +98,7 @@ }, "end": { "line": 1, - "column": 11 + "column": 10 }, "indent": [] } @@ -209,7 +111,7 @@ }, "end": { "line": 1, - "column": 11 + "column": 10 }, "indent": [] } @@ -222,7 +124,7 @@ }, "end": { "line": 1, - "column": 11 + "column": 10 } } } @@ -233,18 +135,25 @@ ] }, { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "inline-link.input" + "value": "number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -253,47 +162,15 @@ "children": [ { "type": "text", - "value": "This function returns the number one. Internally, this uses\n", + "value": "the output", "position": { "start": { "line": 1, "column": 1 }, "end": { - "line": 2, - "column": 1 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "inlineCode", - "value": "addOne", - "position": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 9 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " to do the math.", - "position": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 25 + "line": 1, + "column": 11 }, "indent": [] } @@ -305,12 +182,10 @@ "column": 1 }, "end": { - "line": 2, - "column": 25 + "line": 1, + "column": 11 }, - "indent": [ - 1 - ] + "indent": [] } } ], @@ -320,117 +195,114 @@ "column": 1 }, "end": { - "line": 2, - "column": 25 + "line": 1, + "column": 11 } } + } + ] + }, + { + "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 + }, + "end": { + "line": 2, + "column": 1 + }, + "indent": [ + 1 + ] + } }, { - "type": "root", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] + "type": "inlineCode", + "value": "addOne", + "position": { + "start": { + "line": 2, + "column": 1 }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the input", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ] - } - ] - } - ] - } - ] + "end": { + "line": 2, + "column": 9 + }, + "indent": [] + } }, { - "type": "root", + "type": "text", + "value": " to do the math.", + "position": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 25 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 2, + "column": 25 + }, + "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": "Returns " + "value": " " }, { "type": "strong", @@ -453,7 +325,7 @@ "children": [ { "type": "text", - "value": "numberone", + "value": "the input", "position": { "start": { "line": 1, @@ -496,6 +368,74 @@ ] } ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "number" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "numberone", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + } + } + ] } ] } \ No newline at end of file diff --git a/test/fixture/internal.output.custom.md b/test/fixture/internal.output.custom.md index 9b47a60c1..069747607 100644 --- a/test/fixture/internal.output.custom.md +++ b/test/fixture/internal.output.custom.md @@ -1,5 +1,3 @@ # foo I am in `external.input.js`. - - diff --git a/test/fixture/internal.output.md b/test/fixture/internal.output.md index 9b47a60c1..069747607 100644 --- a/test/fixture/internal.output.md +++ b/test/fixture/internal.output.md @@ -1,5 +1,3 @@ # foo I am in `external.input.js`. - - diff --git a/test/fixture/internal.output.md.json b/test/fixture/internal.output.md.json index e71a85de7..b0488877d 100644 --- a/test/fixture/internal.output.md.json +++ b/test/fixture/internal.output.md.json @@ -2,95 +2,75 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, + "type": "text", + "value": "foo" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "I am in ", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "external.input.js", - "position": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 29 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "I am in ", "position": { "start": { "line": 1, "column": 1 }, + "end": { + "line": 1, + "column": 9 + }, + "indent": [] + } + }, + { + "type": "inlineCode", + "value": "external.input.js", + "position": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + }, + "indent": [] + } + }, + { + "type": "text", + "value": ".", + "position": { + "start": { + "line": 1, + "column": 28 + }, "end": { "line": 1, "column": 29 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 29 + }, + "indent": [] + } } ] } \ No newline at end of file diff --git a/test/fixture/jsx.output.custom.md b/test/fixture/jsx.output.custom.md index fc2f7c1d5..25c8c0c48 100644 --- a/test/fixture/jsx.output.custom.md +++ b/test/fixture/jsx.output.custom.md @@ -2,8 +2,5 @@ This function returns the number one. - Returns **Number** numberone - - diff --git a/test/fixture/jsx.output.md b/test/fixture/jsx.output.md index fc2f7c1d5..25c8c0c48 100644 --- a/test/fixture/jsx.output.md +++ b/test/fixture/jsx.output.md @@ -2,8 +2,5 @@ This function returns the number one. - Returns **Number** numberone - - diff --git a/test/fixture/jsx.output.md.json b/test/fixture/jsx.output.md.json index ce3cdfc1b..c4a930c26 100644 --- a/test/fixture/jsx.output.md.json +++ b/test/fixture/jsx.output.md.json @@ -2,18 +2,66 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "jsx.input" + } + ] + }, + { + "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": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "jsx.input" + "value": "Number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -22,7 +70,7 @@ "children": [ { "type": "text", - "value": "This function returns the number one.", + "value": "numberone", "position": { "start": { "line": 1, @@ -30,7 +78,7 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 }, "indent": [] } @@ -43,7 +91,7 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 }, "indent": [] } @@ -56,82 +104,9 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 } } - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ] - } - ] } ] } diff --git a/test/fixture/multiexample.output.custom.md b/test/fixture/multiexample.output.custom.md index 1936816af..31880b0f6 100644 --- a/test/fixture/multiexample.output.custom.md +++ b/test/fixture/multiexample.output.custom.md @@ -2,7 +2,6 @@ This function returns the number one. - **Examples** ```javascript @@ -13,9 +12,5 @@ foo(1); foo(2); ``` - - Returns **Number** numberone - - diff --git a/test/fixture/multiexample.output.md b/test/fixture/multiexample.output.md index 1936816af..31880b0f6 100644 --- a/test/fixture/multiexample.output.md +++ b/test/fixture/multiexample.output.md @@ -2,7 +2,6 @@ This function returns the number one. - **Examples** ```javascript @@ -13,9 +12,5 @@ foo(1); foo(2); ``` - - Returns **Number** numberone - - diff --git a/test/fixture/multiexample.output.md.json b/test/fixture/multiexample.output.md.json index d61fa332a..43f509581 100644 --- a/test/fixture/multiexample.output.md.json +++ b/test/fixture/multiexample.output.md.json @@ -2,18 +2,85 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "multiexample.input" + } + ] + }, + { + "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": "Examples" + } + ] + }, + { + "lang": "javascript", + "type": "code", + "value": "foo(1);" + }, + { + "lang": "javascript", + "type": "code", + "value": "foo(2);" + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "multiexample.input" + "value": "Number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -22,7 +89,7 @@ "children": [ { "type": "text", - "value": "This function returns the number one.", + "value": "numberone", "position": { "start": { "line": 1, @@ -30,7 +97,7 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 }, "indent": [] } @@ -43,7 +110,7 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 }, "indent": [] } @@ -56,111 +123,9 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 } } - }, - { - "type": "root", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "type": "root", - "children": [ - { - "lang": "javascript", - "type": "code", - "value": "foo(1);" - }, - { - "lang": "javascript", - "type": "code", - "value": "foo(2);" - } - ] - } - ] - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ] - } - ] } ] } diff --git a/test/fixture/multisignature.output.custom.md b/test/fixture/multisignature.output.custom.md index fbd2aef76..6f489d427 100644 --- a/test/fixture/multisignature.output.custom.md +++ b/test/fixture/multisignature.output.custom.md @@ -2,30 +2,22 @@ Get the time - **Parameters** - `time` - Returns **Date** the current date - - # getTheTime Set the time - **Parameters** - `time` **Date** the current time - Returns **undefined** nothing - - diff --git a/test/fixture/multisignature.output.md b/test/fixture/multisignature.output.md index fbd2aef76..6f489d427 100644 --- a/test/fixture/multisignature.output.md +++ b/test/fixture/multisignature.output.md @@ -2,30 +2,22 @@ Get the time - **Parameters** - `time` - Returns **Date** the current date - - # getTheTime Set the time - **Parameters** - `time` **Date** the current time - Returns **undefined** nothing - - diff --git a/test/fixture/multisignature.output.md.json b/test/fixture/multisignature.output.md.json index 57625e144..87f344af4 100644 --- a/test/fixture/multisignature.output.md.json +++ b/test/fixture/multisignature.output.md.json @@ -2,18 +2,117 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "getTheTime" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Get the time", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + }, + "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": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ] + } + ] + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "getTheTime" + "value": "Date" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -22,7 +121,7 @@ "children": [ { "type": "text", - "value": "Get the time", + "value": "the current date", "position": { "start": { "line": 1, @@ -30,7 +129,7 @@ }, "end": { "line": 1, - "column": 13 + "column": 17 }, "indent": [] } @@ -43,7 +142,7 @@ }, "end": { "line": 1, - "column": 13 + "column": 17 }, "indent": [] } @@ -56,75 +155,79 @@ }, "end": { "line": 1, - "column": 13 + "column": 17 } } - }, + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ { - "type": "root", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] + "type": "text", + "value": "getTheTime" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Set the time", + "position": { + "start": { + "line": 1, + "column": 1 }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "time" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] - } - ] - } - ] - } - ] + "end": { + "line": 1, + "column": 13 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, + "end": { + "line": 1, + "column": 13 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "time" + }, { "type": "text", - "value": "Returns " + "value": " " }, { "type": "strong", @@ -147,7 +250,7 @@ "children": [ { "type": "text", - "value": "the current date", + "value": "the current time", "position": { "start": { "line": 1, @@ -192,18 +295,25 @@ ] }, { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "getTheTime" + "value": "undefined" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -212,7 +322,7 @@ "children": [ { "type": "text", - "value": "Set the time", + "value": "nothing", "position": { "start": { "line": 1, @@ -220,7 +330,7 @@ }, "end": { "line": 1, - "column": 13 + "column": 8 }, "indent": [] } @@ -233,7 +343,7 @@ }, "end": { "line": 1, - "column": 13 + "column": 8 }, "indent": [] } @@ -246,179 +356,9 @@ }, "end": { "line": 1, - "column": 13 + "column": 8 } } - }, - { - "type": "root", - "children": [ - { - "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": [ - { - "type": "text", - "value": "Date" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current time", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "undefined" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "nothing", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ] - } - ] } ] } diff --git a/test/fixture/nearby_params.output.custom.md b/test/fixture/nearby_params.output.custom.md index 7155ae45e..b0ca94926 100644 --- a/test/fixture/nearby_params.output.custom.md +++ b/test/fixture/nearby_params.output.custom.md @@ -2,7 +2,6 @@ Attempt to establish a cookie-based session in exchange for credentials. - **Parameters** - `credentials` **object** @@ -13,8 +12,5 @@ Attempt to establish a cookie-based session in exchange for credentials. - `callback` **[function]** Gets passed `(err, { success:Boolean })`. - Returns **Promise** promise, to be resolved on success or rejected on failure - - diff --git a/test/fixture/nearby_params.output.md b/test/fixture/nearby_params.output.md index 7155ae45e..b0ca94926 100644 --- a/test/fixture/nearby_params.output.md +++ b/test/fixture/nearby_params.output.md @@ -2,7 +2,6 @@ Attempt to establish a cookie-based session in exchange for credentials. - **Parameters** - `credentials` **object** @@ -13,8 +12,5 @@ Attempt to establish a cookie-based session in exchange for credentials. - `callback` **[function]** Gets passed `(err, { success:Boolean })`. - Returns **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 index 879c97db2..d82f6ee7b 100644 --- a/test/fixture/nearby_params.output.md.json +++ b/test/fixture/nearby_params.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "sessions.create" - } - ] - }, + "type": "text", + "value": "sessions.create" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "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 - }, - "end": { - "line": 1, - "column": 73 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 73 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "Attempt to establish a cookie-based session in exchange for credentials.", "position": { "start": { "line": 1, @@ -57,192 +25,117 @@ "end": { "line": 1, "column": 73 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 73 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "credentials" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, { - "type": "listItem", + "type": "strong", "children": [ { - "type": "paragraph", + "type": "text", + "value": "object" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", "children": [ { - "type": "inlineCode", - "value": "credentials" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "credentials.name" + }, { "type": "text", - "value": "object" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 + "value": " " }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "ordered": false, - "type": "list", - "children": [ { - "type": "listItem", + "type": "strong", + "children": [ + { + "type": "text", + "value": "string" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "credentials.name" - }, { "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Login username. Also accepted as ", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 34 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "username", - "position": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 44 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " or ", - "position": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 48 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "email", - "position": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 55 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 56 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 56 - }, - "indent": [] - } - } - ], + "value": "Login username. Also accepted as ", "position": { "start": { "line": 1, @@ -250,171 +143,157 @@ }, "end": { "line": 1, - "column": 56 - } + "column": 34 + }, + "indent": [] } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ + }, { "type": "inlineCode", - "value": "credentials.password" + "value": "username", + "position": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 44 + }, + "indent": [] + } }, { "type": "text", - "value": " " + "value": " or ", + "position": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 48 + }, + "indent": [] + } }, { - "type": "strong", - "children": [ - { - "type": "text", - "value": "string" - } - ] + "type": "inlineCode", + "value": "email", + "position": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 55 + }, + "indent": [] + } }, { "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Login password", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - }, - "indent": [] - } - } - ], + "value": ".", "position": { "start": { "line": 1, - "column": 1 + "column": 55 }, "end": { "line": 1, - "column": 15 - } + "column": 56 + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 56 + }, + "indent": [] + } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 56 + } + } } ] } ] - } - ] - }, - { - "type": "listItem", - "children": [ + }, { - "type": "paragraph", + "type": "listItem", "children": [ { - "type": "inlineCode", - "value": "callback" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "credentials.password" + }, { "type": "text", - "value": "[function]" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ + "value": " " + }, { - "type": "paragraph", + "type": "strong", "children": [ { "type": "text", - "value": "Gets passed ", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "(err, { success:Boolean })", - "position": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 41 - }, - "indent": [] - } - }, + "value": "string" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [ { - "type": "text", - "value": ".", + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Login password", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 15 + }, + "indent": [] + } + } + ], "position": { "start": { "line": 1, - "column": 41 + "column": 1 }, "end": { "line": 1, - "column": 42 + "column": 15 }, "indent": [] } @@ -427,22 +306,11 @@ }, "end": { "line": 1, - "column": 42 - }, - "indent": [] + "column": 15 + } } } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - } - } + ] } ] } @@ -453,21 +321,25 @@ ] }, { - "type": "root", + "type": "listItem", "children": [ { "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "callback" + }, { "type": "text", - "value": "Returns " + "value": " " }, { "type": "strong", "children": [ { "type": "text", - "value": "Promise" + "value": "[function]" } ] }, @@ -483,7 +355,7 @@ "children": [ { "type": "text", - "value": "promise, to be resolved on success or rejected on failure", + "value": "Gets passed ", "position": { "start": { "line": 1, @@ -491,7 +363,37 @@ }, "end": { "line": 1, - "column": 58 + "column": 13 + }, + "indent": [] + } + }, + { + "type": "inlineCode", + "value": "(err, { success:Boolean })", + "position": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 41 + }, + "indent": [] + } + }, + { + "type": "text", + "value": ".", + "position": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 }, "indent": [] } @@ -504,7 +406,7 @@ }, "end": { "line": 1, - "column": 58 + "column": 42 }, "indent": [] } @@ -517,7 +419,7 @@ }, "end": { "line": 1, - "column": 58 + "column": 42 } } } @@ -526,6 +428,74 @@ ] } ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Promise" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "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 + }, + "end": { + "line": 1, + "column": 58 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 58 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 58 + } + } + } + ] } ] } \ No newline at end of file diff --git a/test/fixture/nested_properties.output.custom.md b/test/fixture/nested_properties.output.custom.md index d9b4f2339..9f75e4971 100644 --- a/test/fixture/nested_properties.output.custom.md +++ b/test/fixture/nested_properties.output.custom.md @@ -1,8 +1,5 @@ # foo - - - **Parameters** - `options` **Object** some options @@ -11,8 +8,5 @@ - `bar` **number** something else - Returns **Object** foo something else - - diff --git a/test/fixture/nested_properties.output.md b/test/fixture/nested_properties.output.md index d9b4f2339..9f75e4971 100644 --- a/test/fixture/nested_properties.output.md +++ b/test/fixture/nested_properties.output.md @@ -1,8 +1,5 @@ # foo - - - **Parameters** - `options` **Object** some options @@ -11,8 +8,5 @@ - `bar` **number** something else - Returns **Object** foo something else - - diff --git a/test/fixture/nested_properties.output.md.json b/test/fixture/nested_properties.output.md.json index 867d0944c..78568421d 100644 --- a/test/fixture/nested_properties.output.md.json +++ b/test/fixture/nested_properties.output.md.json @@ -2,110 +2,64 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, + "type": "text", + "value": "foo" + } + ] + }, + { + "type": "strong", + "children": [ { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "options" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, { - "type": "listItem", + "type": "strong", + "children": [ + { + "type": "text", + "value": "Object" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "options" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, { "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "some options", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - }, - "indent": [] - } - } - ], + "value": "some options", "position": { "start": { "line": 1, @@ -114,75 +68,75 @@ "end": { "line": 1, "column": 13 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, + "end": { + "line": 1, + "column": 13 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ { - "ordered": false, - "type": "list", + "type": "paragraph", "children": [ { - "type": "listItem", + "type": "inlineCode", + "value": "options.much" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "number" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "options.much" - }, { "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "how much", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - }, - "indent": [] - } - } - ], + "value": "how much", "position": { "start": { "line": 1, @@ -191,55 +145,11 @@ "end": { "line": 1, "column": 9 - } + }, + "indent": [] } } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "bar" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something else", + ], "position": { "start": { "line": 1, @@ -247,7 +157,7 @@ }, "end": { "line": 1, - "column": 15 + "column": 9 }, "indent": [] } @@ -260,22 +170,11 @@ }, "end": { "line": 1, - "column": 15 - }, - "indent": [] + "column": 9 + } } } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - } - } + ] } ] } @@ -286,21 +185,25 @@ ] }, { - "type": "root", + "type": "listItem", "children": [ { "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "bar" + }, { "type": "text", - "value": "Returns " + "value": " " }, { "type": "strong", "children": [ { "type": "text", - "value": "Object" + "value": "number" } ] }, @@ -316,7 +219,7 @@ "children": [ { "type": "text", - "value": "foo something else", + "value": "something else", "position": { "start": { "line": 1, @@ -324,7 +227,7 @@ }, "end": { "line": 1, - "column": 19 + "column": 15 }, "indent": [] } @@ -337,7 +240,7 @@ }, "end": { "line": 1, - "column": 19 + "column": 15 }, "indent": [] } @@ -350,7 +253,7 @@ }, "end": { "line": 1, - "column": 19 + "column": 15 } } } @@ -359,6 +262,74 @@ ] } ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Object" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "foo something else", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + } + } + ] } ] } \ No newline at end of file diff --git a/test/fixture/newline-in-description.output.custom.md b/test/fixture/newline-in-description.output.custom.md index 709e0207b..647621bca 100644 --- a/test/fixture/newline-in-description.output.custom.md +++ b/test/fixture/newline-in-description.output.custom.md @@ -2,12 +2,9 @@ A function. - **Parameters** - `a` **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 b/test/fixture/newline-in-description.output.md index 709e0207b..647621bca 100644 --- a/test/fixture/newline-in-description.output.md +++ b/test/fixture/newline-in-description.output.md @@ -2,12 +2,9 @@ A function. - **Parameters** - `a` **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 index 11560fff0..09284ef58 100644 --- a/test/fixture/newline-in-description.output.md.json +++ b/test/fixture/newline-in-description.output.md.json @@ -2,52 +2,20 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text" - } - ] - }, + "type": "text" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A function.", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "A function.", "position": { "start": { "line": 1, @@ -56,93 +24,72 @@ "end": { "line": 1, "column": 12 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "a" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Number" + } + ] + }, { - "type": "listItem", + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "a" - }, { "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "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 - }, - "end": { - "line": 3, - "column": 34 - }, - "indent": [ - 1, - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 3, - "column": 34 - }, - "indent": [ - 1, - 1 - ] - } - } - ], + "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, @@ -151,12 +98,40 @@ "end": { "line": 3, "column": 34 - } + }, + "indent": [ + 1, + 1 + ] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 3, + "column": 34 + }, + "indent": [ + 1, + 1 + ] + } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 3, + "column": 34 + } + } } ] } diff --git a/test/fixture/no-name.output.custom.md b/test/fixture/no-name.output.custom.md index 35c4ddd86..d380d20a2 100644 --- a/test/fixture/no-name.output.custom.md +++ b/test/fixture/no-name.output.custom.md @@ -2,10 +2,7 @@ Set the time - **Parameters** - `bar` **number** - - diff --git a/test/fixture/no-name.output.md b/test/fixture/no-name.output.md index 35c4ddd86..d380d20a2 100644 --- a/test/fixture/no-name.output.md +++ b/test/fixture/no-name.output.md @@ -2,10 +2,7 @@ Set the time - **Parameters** - `bar` **number** - - diff --git a/test/fixture/no-name.output.md.json b/test/fixture/no-name.output.md.json index 7dfe83949..a087e57b6 100644 --- a/test/fixture/no-name.output.md.json +++ b/test/fixture/no-name.output.md.json @@ -2,52 +2,20 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text" - } - ] - }, + "type": "text" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Set the time", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "Set the time", "position": { "start": { "line": 1, @@ -56,69 +24,76 @@ "end": { "line": 1, "column": 13 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "bar" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, { - "type": "listItem", + "type": "strong", "children": [ { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "bar" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ] + "type": "text", + "value": "number" } ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } } ] } diff --git a/test/fixture/optional.output.custom.md b/test/fixture/optional.output.custom.md index 173f15c38..bdcc14dcf 100644 --- a/test/fixture/optional.output.custom.md +++ b/test/fixture/optional.output.custom.md @@ -2,7 +2,6 @@ Represents an IPv6 address - **Parameters** - `address` **string** An IPv6 address string @@ -10,12 +9,8 @@ Represents an IPv6 address - `groups` **[number]** How many octets to parse (optional, default `8`) - **Examples** ```javascript var address = new Address6('2001::/32'); ``` - - - diff --git a/test/fixture/optional.output.md b/test/fixture/optional.output.md index 173f15c38..bdcc14dcf 100644 --- a/test/fixture/optional.output.md +++ b/test/fixture/optional.output.md @@ -2,7 +2,6 @@ Represents an IPv6 address - **Parameters** - `address` **string** An IPv6 address string @@ -10,12 +9,8 @@ Represents an IPv6 address - `groups` **[number]** How many octets to parse (optional, default `8`) - **Examples** ```javascript var address = new Address6('2001::/32'); ``` - - - diff --git a/test/fixture/optional.output.md.json b/test/fixture/optional.output.md.json index 83db59fce..7ea728e33 100644 --- a/test/fixture/optional.output.md.json +++ b/test/fixture/optional.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Address6" - } - ] - }, + "type": "text", + "value": "Address6" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 27 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "Represents an IPv6 address", "position": { "start": { "line": 1, @@ -57,87 +25,72 @@ "end": { "line": 1, "column": 27 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 27 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "address" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "string" + } + ] + }, { - "type": "listItem", + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "address" - }, { "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], + "value": "An IPv6 address string", "position": { "start": { "line": 1, @@ -146,75 +99,75 @@ "end": { "line": 1, "column": 23 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + } + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "groups" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "[number]" } ] }, { - "type": "listItem", + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "groups" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "[number]" - } - ] - }, { "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "How many octets to parse", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - }, - "indent": [] - } - } - ], + "value": "How many octets to parse", "position": { "start": { "line": 1, @@ -223,59 +176,71 @@ "end": { "line": 1, "column": 25 - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "8" }, - { - "type": "text", - "value": ")" - } - ] + "indent": [] + } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 25 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 25 + } + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "8" + }, + { + "type": "text", + "value": ")" } ] } ] } ] - }, + } + ] + }, + { + "type": "strong", + "children": [ { - "type": "root", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "type": "root", - "children": [ - { - "lang": "javascript", - "type": "code", - "value": "var address = new Address6('2001::/32');" - } - ] - } - ] + "type": "text", + "value": "Examples" } ] + }, + { + "lang": "javascript", + "type": "code", + "value": "var address = new Address6('2001::/32');" } ] } \ No newline at end of file diff --git a/test/fixture/param_nest.output.custom.md b/test/fixture/param_nest.output.custom.md index b41c43181..3027d762c 100644 --- a/test/fixture/param_nest.output.custom.md +++ b/test/fixture/param_nest.output.custom.md @@ -2,7 +2,6 @@ Create a GeoJSON data source instance given an options object - **Parameters** - `options` **[Object]** optional options @@ -15,5 +14,3 @@ Create a GeoJSON data source instance given an options object - `options.tolerance` **[number]** Simplification tolerance (higher means simpler). - - diff --git a/test/fixture/param_nest.output.md b/test/fixture/param_nest.output.md index b41c43181..3027d762c 100644 --- a/test/fixture/param_nest.output.md +++ b/test/fixture/param_nest.output.md @@ -2,7 +2,6 @@ Create a GeoJSON data source instance given an options object - **Parameters** - `options` **[Object]** optional options @@ -15,5 +14,3 @@ Create a GeoJSON data source instance given an options object - `options.tolerance` **[number]** Simplification tolerance (higher means simpler). - - diff --git a/test/fixture/param_nest.output.md.json b/test/fixture/param_nest.output.md.json index 9d1978f65..77accc478 100644 --- a/test/fixture/param_nest.output.md.json +++ b/test/fixture/param_nest.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "GeoJSONSource" - } - ] - }, + "type": "text", + "value": "GeoJSONSource" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "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 - }, - "end": { - "line": 1, - "column": 62 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 62 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "Create a GeoJSON data source instance given an options object", "position": { "start": { "line": 1, @@ -57,71 +25,176 @@ "end": { "line": 1, "column": 62 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, + "end": { + "line": 1, + "column": 62 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "options" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, { - "type": "listItem", + "type": "strong", + "children": [ + { + "type": "text", + "value": "[Object]" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "options" - }, { "type": "text", - "value": " " + "value": "optional options", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, + "end": { + "line": 1, + "column": 17 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "options.data" + }, { "type": "text", - "value": "[Object]" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ + "value": " " + }, { - "type": "paragraph", + "type": "strong", "children": [ { "type": "text", - "value": "optional options", + "value": "Object or string" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "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 + }, + "end": { + "line": 2, + "column": 57 + }, + "indent": [ + 1 + ] + } + } + ], "position": { "start": { "line": 1, "column": 1 }, "end": { - "line": 1, - "column": 17 + "line": 2, + "column": 57 }, - "indent": [] + "indent": [ + 1 + ] } } ], @@ -131,171 +204,51 @@ "column": 1 }, "end": { - "line": 1, - "column": 17 - }, - "indent": [] + "line": 2, + "column": 57 + } } } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, + ] + } + ] + }, + { + "type": "listItem", + "children": [ { - "ordered": false, - "type": "list", + "type": "paragraph", "children": [ { - "type": "listItem", + "type": "inlineCode", + "value": "options.maxzoom" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", "children": [ { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.data" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Object or string" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "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 - }, - "end": { - "line": 2, - "column": 57 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 57 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 57 - } - } - } - ] + "type": "text", + "value": "[number]" } ] }, { - "type": "listItem", + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "options.maxzoom" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "[number]" - } - ] - }, { "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Maximum zoom to preserve detail at.", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 36 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 36 - }, - "indent": [] - } - } - ], + "value": "Maximum zoom to preserve detail at.", "position": { "start": { "line": 1, @@ -304,92 +257,92 @@ "end": { "line": 1, "column": 36 - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " }, - { - "type": "inlineCode", - "value": "14" - }, - { - "type": "text", - "value": ")" - } - ] + "indent": [] + } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 36 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 36 + } + } + }, + { + "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": [ + { + "type": "text", + "value": "[number]" } ] }, { - "type": "listItem", + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "options.buffer" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "[number]" - } - ] - }, { "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Tile buffer on each side.", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - }, - "indent": [] - } - } - ], + "value": "Tile buffer on each side.", "position": { "start": { "line": 1, @@ -398,75 +351,75 @@ "end": { "line": 1, "column": 26 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "options.tolerance" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "[number]" } ] }, { - "type": "listItem", + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "options.tolerance" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "[number]" - } - ] - }, { "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Simplification tolerance (higher means simpler).", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 49 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 49 - }, - "indent": [] - } - } - ], + "value": "Simplification tolerance (higher means simpler).", "position": { "start": { "line": 1, @@ -475,12 +428,34 @@ "end": { "line": 1, "column": 49 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 49 + }, + "indent": [] + } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 49 + } + } } ] } diff --git a/test/fixture/simple-hashbang.output.custom.md b/test/fixture/simple-hashbang.output.custom.md index 35df8b9c6..1b6298668 100644 --- a/test/fixture/simple-hashbang.output.custom.md +++ b/test/fixture/simple-hashbang.output.custom.md @@ -2,8 +2,5 @@ This function returns the number one. - Returns **Number** numberone - - diff --git a/test/fixture/simple-hashbang.output.md b/test/fixture/simple-hashbang.output.md index 35df8b9c6..1b6298668 100644 --- a/test/fixture/simple-hashbang.output.md +++ b/test/fixture/simple-hashbang.output.md @@ -2,8 +2,5 @@ This function returns the number one. - Returns **Number** numberone - - diff --git a/test/fixture/simple-hashbang.output.md.json b/test/fixture/simple-hashbang.output.md.json index 59f4170c3..72b32c2ac 100644 --- a/test/fixture/simple-hashbang.output.md.json +++ b/test/fixture/simple-hashbang.output.md.json @@ -2,18 +2,66 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "simple-hashbang.input" + } + ] + }, + { + "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": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "simple-hashbang.input" + "value": "Number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -22,7 +70,7 @@ "children": [ { "type": "text", - "value": "This function returns the number one.", + "value": "numberone", "position": { "start": { "line": 1, @@ -30,7 +78,7 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 }, "indent": [] } @@ -43,7 +91,7 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 }, "indent": [] } @@ -56,82 +104,9 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 } } - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ] - } - ] } ] } diff --git a/test/fixture/simple-two.output.custom.md b/test/fixture/simple-two.output.custom.md index 12597841c..a0b62f63a 100644 --- a/test/fixture/simple-two.output.custom.md +++ b/test/fixture/simple-two.output.custom.md @@ -2,13 +2,11 @@ This function returns the number plus two. - **Parameters** - `a` **Number** the number - **Examples** ```javascript @@ -16,9 +14,5 @@ var result = returnTwo(4); // result is 6 ``` - - Returns **Number** numbertwo - - diff --git a/test/fixture/simple-two.output.md b/test/fixture/simple-two.output.md index 12597841c..a0b62f63a 100644 --- a/test/fixture/simple-two.output.md +++ b/test/fixture/simple-two.output.md @@ -2,13 +2,11 @@ This function returns the number plus two. - **Parameters** - `a` **Number** the number - **Examples** ```javascript @@ -16,9 +14,5 @@ var result = returnTwo(4); // result is 6 ``` - - Returns **Number** numbertwo - - diff --git a/test/fixture/simple-two.output.md.json b/test/fixture/simple-two.output.md.json index d3252d1ba..4a15137a5 100644 --- a/test/fixture/simple-two.output.md.json +++ b/test/fixture/simple-two.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "returnTwo" - } - ] - }, + "type": "text", + "value": "returnTwo" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number plus two.", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 43 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 43 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "This function returns the number plus two.", "position": { "start": { "line": 1, @@ -57,139 +25,49 @@ "end": { "line": 1, "column": 43 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, - { - "type": "root", - "children": [ - { - "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": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the number", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ] - } - ] - } - ] - } - ] + "end": { + "line": 1, + "column": 43 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "type": "root", - "children": [ - { - "lang": "javascript", - "type": "code", - "value": "var result = returnTwo(4);\n// result is 6" - } - ] - } - ] - }, + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "a" + }, { "type": "text", - "value": "Returns " + "value": " " }, { "type": "strong", @@ -212,7 +90,7 @@ "children": [ { "type": "text", - "value": "numbertwo", + "value": "the number", "position": { "start": { "line": 1, @@ -220,7 +98,7 @@ }, "end": { "line": 1, - "column": 10 + "column": 11 }, "indent": [] } @@ -233,7 +111,7 @@ }, "end": { "line": 1, - "column": 10 + "column": 11 }, "indent": [] } @@ -246,7 +124,7 @@ }, "end": { "line": 1, - "column": 10 + "column": 11 } } } @@ -255,6 +133,88 @@ ] } ] + }, + { + "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": [ + { + "type": "text", + "value": "Number" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "numbertwo", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + } + } + ] } ] } \ No newline at end of file diff --git a/test/fixture/simple.output.custom.md b/test/fixture/simple.output.custom.md index 93cf80e8e..4f2c70bd1 100644 --- a/test/fixture/simple.output.custom.md +++ b/test/fixture/simple.output.custom.md @@ -2,8 +2,5 @@ This function returns the number one. - Returns **Number** numberone - - diff --git a/test/fixture/simple.output.md b/test/fixture/simple.output.md index 93cf80e8e..4f2c70bd1 100644 --- a/test/fixture/simple.output.md +++ b/test/fixture/simple.output.md @@ -2,8 +2,5 @@ This function returns the number one. - Returns **Number** numberone - - diff --git a/test/fixture/simple.output.md.json b/test/fixture/simple.output.md.json index bc9e6503a..1f500980b 100644 --- a/test/fixture/simple.output.md.json +++ b/test/fixture/simple.output.md.json @@ -2,18 +2,66 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "simple.input" + } + ] + }, + { + "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": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "simple.input" + "value": "Number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -22,7 +70,7 @@ "children": [ { "type": "text", - "value": "This function returns the number one.", + "value": "numberone", "position": { "start": { "line": 1, @@ -30,7 +78,7 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 }, "indent": [] } @@ -43,7 +91,7 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 }, "indent": [] } @@ -56,82 +104,9 @@ }, "end": { "line": 1, - "column": 38 + "column": 10 } } - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ] - } - ] } ] } diff --git a/test/fixture/throws.output.custom.md b/test/fixture/throws.output.custom.md index 12597841c..a0b62f63a 100644 --- a/test/fixture/throws.output.custom.md +++ b/test/fixture/throws.output.custom.md @@ -2,13 +2,11 @@ This function returns the number plus two. - **Parameters** - `a` **Number** the number - **Examples** ```javascript @@ -16,9 +14,5 @@ var result = returnTwo(4); // result is 6 ``` - - Returns **Number** numbertwo - - diff --git a/test/fixture/throws.output.md b/test/fixture/throws.output.md index 12597841c..a0b62f63a 100644 --- a/test/fixture/throws.output.md +++ b/test/fixture/throws.output.md @@ -2,13 +2,11 @@ This function returns the number plus two. - **Parameters** - `a` **Number** the number - **Examples** ```javascript @@ -16,9 +14,5 @@ var result = returnTwo(4); // result is 6 ``` - - Returns **Number** numbertwo - - diff --git a/test/fixture/throws.output.md.json b/test/fixture/throws.output.md.json index d3252d1ba..4a15137a5 100644 --- a/test/fixture/throws.output.md.json +++ b/test/fixture/throws.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "returnTwo" - } - ] - }, + "type": "text", + "value": "returnTwo" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number plus two.", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 43 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 43 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "This function returns the number plus two.", "position": { "start": { "line": 1, @@ -57,139 +25,49 @@ "end": { "line": 1, "column": 43 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, - { - "type": "root", - "children": [ - { - "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": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the number", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ] - } - ] - } - ] - } - ] + "end": { + "line": 1, + "column": 43 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ { - "type": "root", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "type": "root", - "children": [ - { - "lang": "javascript", - "type": "code", - "value": "var result = returnTwo(4);\n// result is 6" - } - ] - } - ] - }, + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "a" + }, { "type": "text", - "value": "Returns " + "value": " " }, { "type": "strong", @@ -212,7 +90,7 @@ "children": [ { "type": "text", - "value": "numbertwo", + "value": "the number", "position": { "start": { "line": 1, @@ -220,7 +98,7 @@ }, "end": { "line": 1, - "column": 10 + "column": 11 }, "indent": [] } @@ -233,7 +111,7 @@ }, "end": { "line": 1, - "column": 10 + "column": 11 }, "indent": [] } @@ -246,7 +124,7 @@ }, "end": { "line": 1, - "column": 10 + "column": 11 } } } @@ -255,6 +133,88 @@ ] } ] + }, + { + "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": [ + { + "type": "text", + "value": "Number" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "numbertwo", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + } + } + ] } ] } \ No newline at end of file diff --git a/test/fixture/trailing-only.output.custom.md b/test/fixture/trailing-only.output.custom.md index 4318e8677..b941f35d0 100644 --- a/test/fixture/trailing-only.output.custom.md +++ b/test/fixture/trailing-only.output.custom.md @@ -2,8 +2,5 @@ this is a type - Returns **number** nothing - - diff --git a/test/fixture/trailing-only.output.md b/test/fixture/trailing-only.output.md index 4318e8677..b941f35d0 100644 --- a/test/fixture/trailing-only.output.md +++ b/test/fixture/trailing-only.output.md @@ -2,8 +2,5 @@ this is a type - Returns **number** nothing - - diff --git a/test/fixture/trailing-only.output.md.json b/test/fixture/trailing-only.output.md.json index 621ff94f8..e0bb2192a 100644 --- a/test/fixture/trailing-only.output.md.json +++ b/test/fixture/trailing-only.output.md.json @@ -2,17 +2,65 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", + "type": "text" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "this is a type", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 15 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 15 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { - "type": "text" + "type": "text", + "value": "number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -21,7 +69,7 @@ "children": [ { "type": "text", - "value": "this is a type", + "value": "nothing", "position": { "start": { "line": 1, @@ -29,7 +77,7 @@ }, "end": { "line": 1, - "column": 15 + "column": 8 }, "indent": [] } @@ -42,7 +90,7 @@ }, "end": { "line": 1, - "column": 15 + "column": 8 }, "indent": [] } @@ -55,82 +103,9 @@ }, "end": { "line": 1, - "column": 15 + "column": 8 } } - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "nothing", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ] - } - ] } ] } diff --git a/test/fixture/trailing.output.custom.md b/test/fixture/trailing.output.custom.md index 9174207dd..9f7cb3bef 100644 --- a/test/fixture/trailing.output.custom.md +++ b/test/fixture/trailing.output.custom.md @@ -2,24 +2,16 @@ this is a type - - # fooBar ONE - Returns **number** something - - # fooBaz TWO - Returns **number** something - - diff --git a/test/fixture/trailing.output.md b/test/fixture/trailing.output.md index 9174207dd..9f7cb3bef 100644 --- a/test/fixture/trailing.output.md +++ b/test/fixture/trailing.output.md @@ -2,24 +2,16 @@ this is a type - - # fooBar ONE - Returns **number** something - - # fooBaz TWO - Returns **number** something - - diff --git a/test/fixture/trailing.output.md.json b/test/fixture/trailing.output.md.json index 1d49eed37..3cf098bf1 100644 --- a/test/fixture/trailing.output.md.json +++ b/test/fixture/trailing.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Something" - } - ] - }, + "type": "text", + "value": "Something" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "this is a type", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "this is a type", "position": { "start": { "line": 1, @@ -57,24 +25,84 @@ "end": { "line": 1, "column": 15 - } + }, + "indent": [] } } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 15 + }, + "indent": [] + } + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "fooBar" + } ] }, { - "type": "root", + "type": "paragraph", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "ONE", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "fooBar" + "value": "number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -83,7 +111,7 @@ "children": [ { "type": "text", - "value": "ONE", + "value": "something", "position": { "start": { "line": 1, @@ -91,7 +119,7 @@ }, "end": { "line": 1, - "column": 4 + "column": 10 }, "indent": [] } @@ -104,7 +132,7 @@ }, "end": { "line": 1, - "column": 4 + "column": 10 }, "indent": [] } @@ -117,98 +145,73 @@ }, "end": { "line": 1, - "column": 4 + "column": 10 } } - }, + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ] - } - ] + "type": "text", + "value": "fooBaz" } ] }, { - "type": "root", + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "TWO", + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + }, + "indent": [] + } + }, + { + "type": "paragraph", "children": [ { - "depth": 1, - "type": "heading", + "type": "text", + "value": "Returns " + }, + { + "type": "strong", "children": [ { "type": "text", - "value": "fooBaz" + "value": "number" } ] }, + { + "type": "text", + "value": " " + }, { "type": "root", "children": [ @@ -217,7 +220,7 @@ "children": [ { "type": "text", - "value": "TWO", + "value": "something", "position": { "start": { "line": 1, @@ -225,7 +228,7 @@ }, "end": { "line": 1, - "column": 4 + "column": 10 }, "indent": [] } @@ -238,7 +241,7 @@ }, "end": { "line": 1, - "column": 4 + "column": 10 }, "indent": [] } @@ -251,82 +254,9 @@ }, "end": { "line": 1, - "column": 4 + "column": 10 } } - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ] - } - ] } ] } diff --git a/test/fixture/type_application.output.custom.md b/test/fixture/type_application.output.custom.md index 22427a65f..09827e355 100644 --- a/test/fixture/type_application.output.custom.md +++ b/test/fixture/type_application.output.custom.md @@ -2,10 +2,7 @@ Represents an IPv6 address - **Parameters** - `address` **Array<string>** An IPv6 address string - - diff --git a/test/fixture/type_application.output.md b/test/fixture/type_application.output.md index 22427a65f..09827e355 100644 --- a/test/fixture/type_application.output.md +++ b/test/fixture/type_application.output.md @@ -2,10 +2,7 @@ Represents an IPv6 address - **Parameters** - `address` **Array<string>** An IPv6 address string - - diff --git a/test/fixture/type_application.output.md.json b/test/fixture/type_application.output.md.json index 6c267b24c..52a9478a1 100644 --- a/test/fixture/type_application.output.md.json +++ b/test/fixture/type_application.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Address6" - } - ] - }, + "type": "text", + "value": "Address6" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 27 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "Represents an IPv6 address", "position": { "start": { "line": 1, @@ -57,87 +25,72 @@ "end": { "line": 1, "column": 27 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 27 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "address" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Array<string>" + } + ] + }, + { + "type": "text", + "value": " " + }, { - "type": "listItem", + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "address" - }, { "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Array<string>" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], + "value": "An IPv6 address string", "position": { "start": { "line": 1, @@ -146,12 +99,34 @@ "end": { "line": 1, "column": 23 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + }, + "indent": [] + } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + } + } } ] } diff --git a/test/fixture/typedef.output.custom.md b/test/fixture/typedef.output.custom.md index fa96ac585..b807beae4 100644 --- a/test/fixture/typedef.output.custom.md +++ b/test/fixture/typedef.output.custom.md @@ -2,12 +2,9 @@ A type definition. - **Properties** - `prop1` one property - `prop2` another property - - diff --git a/test/fixture/typedef.output.md b/test/fixture/typedef.output.md index fa96ac585..b807beae4 100644 --- a/test/fixture/typedef.output.md +++ b/test/fixture/typedef.output.md @@ -2,12 +2,9 @@ A type definition. - **Properties** - `prop1` one property - `prop2` another property - - diff --git a/test/fixture/typedef.output.md.json b/test/fixture/typedef.output.md.json index 087f97530..6a793d692 100644 --- a/test/fixture/typedef.output.md.json +++ b/test/fixture/typedef.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "MyType" - } - ] - }, + "type": "text", + "value": "MyType" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A type definition.", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "A type definition.", "position": { "start": { "line": 1, @@ -57,87 +25,72 @@ "end": { "line": 1, "column": 19 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Properties" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "prop1" + }, { "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, { - "type": "listItem", + "type": "text", + "children": [ + { + "type": "text", + "value": "number" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "prop1" - }, - { - "type": "text", - "value": " " - }, { "type": "text", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "one property", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - }, - "indent": [] - } - } - ], + "value": "one property", "position": { "start": { "line": 1, @@ -146,75 +99,75 @@ "end": { "line": 1, "column": 13 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + } + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "prop2" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "children": [ + { + "type": "text", + "value": "string" } ] }, { - "type": "listItem", + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "prop2" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, { "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "another property", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - }, - "indent": [] - } - } - ], + "value": "another property", "position": { "start": { "line": 1, @@ -223,12 +176,34 @@ "end": { "line": 1, "column": 17 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + }, + "indent": [] + } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + } } ] } diff --git a/test/fixture/untyped-param.output.custom.md b/test/fixture/untyped-param.output.custom.md index d32e1b067..fd7ced411 100644 --- a/test/fixture/untyped-param.output.custom.md +++ b/test/fixture/untyped-param.output.custom.md @@ -2,10 +2,7 @@ Represents an IPv6 address - **Parameters** - `address` An IPv6 address string - - diff --git a/test/fixture/untyped-param.output.md b/test/fixture/untyped-param.output.md index d32e1b067..fd7ced411 100644 --- a/test/fixture/untyped-param.output.md +++ b/test/fixture/untyped-param.output.md @@ -2,10 +2,7 @@ Represents an IPv6 address - **Parameters** - `address` An IPv6 address string - - diff --git a/test/fixture/untyped-param.output.md.json b/test/fixture/untyped-param.output.md.json index 64ee21ffa..26c3b4733 100644 --- a/test/fixture/untyped-param.output.md.json +++ b/test/fixture/untyped-param.output.md.json @@ -2,53 +2,21 @@ "type": "root", "children": [ { - "type": "root", + "depth": 1, + "type": "heading", "children": [ { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, + "type": "text", + "value": "foo" + } + ] + }, + { + "type": "paragraph", + "children": [ { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 27 - }, - "indent": [] - } - } - ], + "type": "text", + "value": "Represents an IPv6 address", "position": { "start": { "line": 1, @@ -57,78 +25,63 @@ "end": { "line": 1, "column": 27 - } + }, + "indent": [] } + } + ], + "position": { + "start": { + "line": 1, + "column": 1 }, + "end": { + "line": 1, + "column": 27 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ { - "type": "root", + "type": "listItem", "children": [ { - "type": "strong", + "type": "paragraph", "children": [ + { + "type": "inlineCode", + "value": "address" + }, { "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ + "value": " " + }, { - "type": "listItem", + "type": "text", + "value": " " + }, + { + "type": "root", "children": [ { "type": "paragraph", "children": [ - { - "type": "inlineCode", - "value": "address" - }, { "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - }, - "indent": [] - } - } - ], + "value": "An IPv6 address string", "position": { "start": { "line": 1, @@ -137,12 +90,34 @@ "end": { "line": 1, "column": 23 - } + }, + "indent": [] } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + }, + "indent": [] + } } - ] + ], + "position": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + } + } } ] }