-
-
-
-
- Klass event
-
-
- event
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -811,6 +771,57 @@ k.isArrayOfBuffers();
+ Events
+
+
+
+
+
+
+
+
+
+ Klass event
+
+
+ event
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixture/infer-params.output.json b/test/fixture/infer-params.output.json
index 1e241cdc1..c17a42800 100644
--- a/test/fixture/infer-params.output.json
+++ b/test/fixture/infer-params.output.json
@@ -87,6 +87,7 @@
"name": "addThem",
"kind": "function",
"members": {
+ "events": [],
"instance": [],
"static": []
},
@@ -162,6 +163,7 @@
"name": "fishesAndFoxes",
"kind": "function",
"members": {
+ "events": [],
"instance": [],
"static": []
},
@@ -255,6 +257,7 @@
"memberof": "Foo",
"scope": "instance",
"members": {
+ "events": [],
"instance": [],
"static": []
},
@@ -331,6 +334,7 @@
"name": "withDefault",
"kind": "function",
"members": {
+ "events": [],
"instance": [],
"static": []
},
@@ -338,4 +342,4 @@
"withDefault"
]
}
-]
\ No newline at end of file
+]
diff --git a/test/fixture/infer-private.output.json b/test/fixture/infer-private.output.json
index 1b7a0a27b..c22c340dd 100644
--- a/test/fixture/infer-private.output.json
+++ b/test/fixture/infer-private.output.json
@@ -163,7 +163,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/inheritance.output.json b/test/fixture/inheritance.output.json
index e39a63b91..16a278e3a 100644
--- a/test/fixture/inheritance.output.json
+++ b/test/fixture/inheritance.output.json
@@ -86,7 +86,8 @@
"kind": "class",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -147,7 +148,8 @@
"scope": "static",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/inline-link.output.json b/test/fixture/inline-link.output.json
index 4e5b54dce..d1c001841 100644
--- a/test/fixture/inline-link.output.json
+++ b/test/fixture/inline-link.output.json
@@ -222,7 +222,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -634,7 +635,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/internal.output.json b/test/fixture/internal.output.json
index 929a6a4c4..c8e02a0b7 100644
--- a/test/fixture/internal.output.json
+++ b/test/fixture/internal.output.json
@@ -114,7 +114,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/literal_types.output.json b/test/fixture/literal_types.output.json
index 2aa36d096..9de1c7f47 100644
--- a/test/fixture/literal_types.output.json
+++ b/test/fixture/literal_types.output.json
@@ -100,7 +100,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -176,7 +177,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/memberedclass.output.json b/test/fixture/memberedclass.output.json
index 2a10d55f5..2bb2a5abe 100644
--- a/test/fixture/memberedclass.output.json
+++ b/test/fixture/memberedclass.output.json
@@ -324,7 +324,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -492,7 +493,8 @@
"scope": "static",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/merge-infered-type.output.json b/test/fixture/merge-infered-type.output.json
index 74112ac39..41dd91050 100644
--- a/test/fixture/merge-infered-type.output.json
+++ b/test/fixture/merge-infered-type.output.json
@@ -250,7 +250,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/multisignature.output.json b/test/fixture/multisignature.output.json
index 677c1b968..e5f568279 100644
--- a/test/fixture/multisignature.output.json
+++ b/test/fixture/multisignature.output.json
@@ -157,7 +157,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -388,7 +389,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/nearby_params.output.json b/test/fixture/nearby_params.output.json
index ccb5eb9f6..47597bfc9 100644
--- a/test/fixture/nearby_params.output.json
+++ b/test/fixture/nearby_params.output.json
@@ -502,7 +502,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/nest_params.output.json b/test/fixture/nest_params.output.json
index 0fd39a47e..5d02dca64 100644
--- a/test/fixture/nest_params.output.json
+++ b/test/fixture/nest_params.output.json
@@ -340,7 +340,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -797,7 +798,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/newline-in-description.output.json b/test/fixture/newline-in-description.output.json
index 72872085c..ecdde1cca 100644
--- a/test/fixture/newline-in-description.output.json
+++ b/test/fixture/newline-in-description.output.json
@@ -161,7 +161,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{}
diff --git a/test/fixture/no-name.output.json b/test/fixture/no-name.output.json
index 88452f663..4a816852c 100644
--- a/test/fixture/no-name.output.json
+++ b/test/fixture/no-name.output.json
@@ -103,7 +103,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{}
diff --git a/test/fixture/optional-record-field-type.output.json b/test/fixture/optional-record-field-type.output.json
index 7f75271c2..44f07d020 100644
--- a/test/fixture/optional-record-field-type.output.json
+++ b/test/fixture/optional-record-field-type.output.json
@@ -76,7 +76,8 @@
},
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/params.output.json b/test/fixture/params.output.json
index 8bf7d42f1..5b286ea03 100644
--- a/test/fixture/params.output.json
+++ b/test/fixture/params.output.json
@@ -188,7 +188,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -367,7 +368,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -483,7 +485,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -730,7 +733,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -1197,7 +1201,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -1733,7 +1738,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -1974,7 +1980,8 @@
"kind": "constant",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -2135,7 +2142,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/polyglot/blend.json b/test/fixture/polyglot/blend.json
index 7f65cbb51..2e25729bf 100644
--- a/test/fixture/polyglot/blend.json
+++ b/test/fixture/polyglot/blend.json
@@ -175,7 +175,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/react-jsx.output.json b/test/fixture/react-jsx.output.json
index 5a830b1a5..14a9f2f9e 100644
--- a/test/fixture/react-jsx.output.json
+++ b/test/fixture/react-jsx.output.json
@@ -80,7 +80,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/simple-hashbang.output.json b/test/fixture/simple-hashbang.output.json
index 59c584956..a0d7f0904 100644
--- a/test/fixture/simple-hashbang.output.json
+++ b/test/fixture/simple-hashbang.output.json
@@ -150,7 +150,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/simple-two.output.json b/test/fixture/simple-two.output.json
index abf774182..3f98a4adb 100644
--- a/test/fixture/simple-two.output.json
+++ b/test/fixture/simple-two.output.json
@@ -232,7 +232,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/simple.output.github.json b/test/fixture/simple.output.github.json
index 20b5cc7d9..9afbbc824 100644
--- a/test/fixture/simple.output.github.json
+++ b/test/fixture/simple.output.github.json
@@ -152,7 +152,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/simple.output.json b/test/fixture/simple.output.json
index ee6fd4cc9..0867306b0 100644
--- a/test/fixture/simple.output.json
+++ b/test/fixture/simple.output.json
@@ -150,7 +150,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sort-order-alpha.output.json b/test/fixture/sort-order-alpha.output.json
index 9d9257b5c..028a006f2 100644
--- a/test/fixture/sort-order-alpha.output.json
+++ b/test/fixture/sort-order-alpha.output.json
@@ -29,7 +29,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -69,7 +70,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -141,7 +143,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -188,7 +191,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -235,7 +239,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -282,7 +287,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -371,7 +377,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -418,7 +425,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -465,7 +473,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -512,7 +521,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sorting/output.json b/test/fixture/sorting/output.json
index 8e44ee26b..253946fe2 100644
--- a/test/fixture/sorting/output.json
+++ b/test/fixture/sorting/output.json
@@ -80,7 +80,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -171,7 +172,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -262,7 +264,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/string-literal-key.output.json b/test/fixture/string-literal-key.output.json
index 6396ac2c9..7852b17b9 100644
--- a/test/fixture/string-literal-key.output.json
+++ b/test/fixture/string-literal-key.output.json
@@ -37,7 +37,8 @@
"kind": "constant",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -127,7 +128,8 @@
"name": "foo",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sync/alias.output.json b/test/fixture/sync/alias.output.json
index 51d67f58e..1087e5b3f 100644
--- a/test/fixture/sync/alias.output.json
+++ b/test/fixture/sync/alias.output.json
@@ -111,7 +111,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sync/empty-example.output.json b/test/fixture/sync/empty-example.output.json
index a6dc7618a..787b35174 100644
--- a/test/fixture/sync/empty-example.output.json
+++ b/test/fixture/sync/empty-example.output.json
@@ -91,7 +91,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sync/flow-types.output.json b/test/fixture/sync/flow-types.output.json
index 6dbe4b0bf..837ccd756 100644
--- a/test/fixture/sync/flow-types.output.json
+++ b/test/fixture/sync/flow-types.output.json
@@ -156,7 +156,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -480,7 +481,8 @@
},
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -635,7 +637,8 @@
},
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -739,7 +742,8 @@
},
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -834,7 +838,8 @@
},
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -965,7 +970,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -1070,7 +1076,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -1181,7 +1188,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -1296,7 +1304,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -1413,7 +1422,8 @@
},
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sync/lots-of-options.output.json b/test/fixture/sync/lots-of-options.output.json
index e140f0dca..96d3f4a99 100644
--- a/test/fixture/sync/lots-of-options.output.json
+++ b/test/fixture/sync/lots-of-options.output.json
@@ -1279,7 +1279,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sync/meta.output.json b/test/fixture/sync/meta.output.json
index 4cc0998e2..cdd66e0fc 100644
--- a/test/fixture/sync/meta.output.json
+++ b/test/fixture/sync/meta.output.json
@@ -169,7 +169,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sync/multiexample.output.json b/test/fixture/sync/multiexample.output.json
index 48fd4a2a7..f9ee47492 100644
--- a/test/fixture/sync/multiexample.output.json
+++ b/test/fixture/sync/multiexample.output.json
@@ -334,7 +334,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sync/rename.output.json b/test/fixture/sync/rename.output.json
index 79811ad3c..102ddfa12 100644
--- a/test/fixture/sync/rename.output.json
+++ b/test/fixture/sync/rename.output.json
@@ -86,7 +86,8 @@
"name": "cheese",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sync/throws.output.json b/test/fixture/sync/throws.output.json
index 307fcb29b..a3657f0d1 100644
--- a/test/fixture/sync/throws.output.json
+++ b/test/fixture/sync/throws.output.json
@@ -301,7 +301,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sync/trailing-only.output.json b/test/fixture/sync/trailing-only.output.json
index eaebb188b..cb71c4fea 100644
--- a/test/fixture/sync/trailing-only.output.json
+++ b/test/fixture/sync/trailing-only.output.json
@@ -152,7 +152,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{}
diff --git a/test/fixture/sync/trailing.output.json b/test/fixture/sync/trailing.output.json
index c2bd778d3..b5937fcb5 100644
--- a/test/fixture/sync/trailing.output.json
+++ b/test/fixture/sync/trailing.output.json
@@ -150,7 +150,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -311,7 +312,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -410,7 +412,8 @@
"name": "Something",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/sync/typedef.output.json b/test/fixture/sync/typedef.output.json
index d1199fe40..0b4ed65f2 100644
--- a/test/fixture/sync/typedef.output.json
+++ b/test/fixture/sync/typedef.output.json
@@ -243,7 +243,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/system-import.output.json b/test/fixture/system-import.output.json
index ee6fd4cc9..0867306b0 100644
--- a/test/fixture/system-import.output.json
+++ b/test/fixture/system-import.output.json
@@ -150,7 +150,8 @@
"kind": "function",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/this-class.output.json b/test/fixture/this-class.output.json
index e6c5bf031..c2fbb41fd 100644
--- a/test/fixture/this-class.output.json
+++ b/test/fixture/this-class.output.json
@@ -44,7 +44,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -180,7 +181,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
@@ -332,7 +334,8 @@
"scope": "instance",
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/type_application.output.json b/test/fixture/type_application.output.json
index 04ec75331..ce4194e12 100644
--- a/test/fixture/type_application.output.json
+++ b/test/fixture/type_application.output.json
@@ -178,7 +178,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/fixture/var-function-param-return.output.json b/test/fixture/var-function-param-return.output.json
index 3594637a0..6e5959cb4 100644
--- a/test/fixture/var-function-param-return.output.json
+++ b/test/fixture/var-function-param-return.output.json
@@ -48,7 +48,8 @@
],
"members": {
"instance": [],
- "static": []
+ "static": [],
+ "events": []
},
"path": [
{
diff --git a/test/lib/hierarchy.js b/test/lib/hierarchy.js
index 779d08c1a..18f07cf2b 100644
--- a/test/lib/hierarchy.js
+++ b/test/lib/hierarchy.js
@@ -49,7 +49,6 @@ test('hierarchy', function (t) {
* @name event
* @memberof Class
* @kind event
- * @instance
*/
});
From a4eddba38461dfedbce1465a9890481d30d263c5 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Tue, 13 Dec 2016 15:50:39 -0800
Subject: [PATCH 013/583] chore(globals-docs): Update globals-docs to support
linking TypedArray
Fixes https://github.com/documentationjs/globals-docs/pull/3
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index a81a4facb..6d6f0b958 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,7 @@
"get-comments": "^1.0.1",
"git-url-parse": "^6.0.1",
"github-slugger": "1.1.1",
- "globals-docs": "2.2.0",
+ "globals-docs": "^2.3.0",
"highlight.js": "^9.1.0",
"js-yaml": "^3.3.1",
"lodash": "^4.11.1",
From aea22d4d5a296df320b851662a4eb4ec431f06a8 Mon Sep 17 00:00:00 2001
From: Antonio Quinonez
Date: Thu, 22 Dec 2016 11:03:33 -0800
Subject: [PATCH 014/583] docs(readme): minor style, spelling, and punctuation
fixes
---
docs/FAQ.md | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/docs/FAQ.md b/docs/FAQ.md
index 1b26bf7db..dea82a42d 100644
--- a/docs/FAQ.md
+++ b/docs/FAQ.md
@@ -1,27 +1,27 @@
## What is `documentation`?
-This is a documentation generation system targeting JavaScript code and implemented
+`documentation` is a documentation generation system that targets JavaScript code; and is itself implemented
in JavaScript. It exposes multiple interfaces for users:
* with `npm i -g documentation`, it provides a binary for command-line usage
* install `documentation` with `npm` to use the node-facing interace
`documentation` runs in [node.js](https://nodejs.org/) but supports JavaScript
-that runs in _any environment_: you can use it to document browser libraries,
-server libraries, or even things that use RequireJS or other module systems.
+that runs in _any environment_. You can use it to document browser libraries,
+server libraries, and wherever RequireJS or another module system is used.
## How do I use `documentation`?
There are two main ways:
* You use the `documentation` command on your command-line to generate docs
- from your source code
+ from your source code.
* You use one of the integrations with a build system like Gulp to generate
docs from source code.
## How does `documentation` differ from JSDoc?
-JSDoc is both a **standard syntax for documentating code** as well as a
+JSDoc is both a **standard syntax for documentating code** and an
application, also called `jsdoc`, that processes that syntax into documentation.
`documentation` uses the JSDoc syntax and provides an alternative to the `jsdoc`
@@ -35,7 +35,7 @@ documentation.
* Beatiful defaults for HTML & Markdown output
* Supports CommonJS `require()` syntax so that node modules can be documented
by giving their `main` file
-* Heavily documented internally: all public and private functions in `documentation`
+* Extensively documented internally: all public and private functions in `documentation`
are documented. [JSDoc is not well documented internally](https://github.com/jsdoc3/jsdoc/issues/839).
* Robust ES6 support
* [No Rhino cruft](https://github.com/jsdoc3/jsdoc/issues/942)
@@ -43,16 +43,16 @@ documentation.
and [untagged](https://github.com/jsdoc3/jsdoc/blob/master/package.json#L25) [TaffyDB](http://www.taffydb.com/) project.
* Uses high-quality node modules for syntax parsing, argument parsing, and other
tasks: separates concerns so that we can focus on a robust solution
-* Customization points like plugins & templates are heavily documented and
- made to be flexible
+* Customization points like plugins & templates are well documented and
+ flexible
## Why use `documentation` instead of writing a Markdown file by hand?
-* `documentation` can generate multiple formats: when you create a project
- website, it can take the structure of your documentation and generate
- beautiful HTML output
-* The JSDoc syntax exposes a powerful, standardized type syntax to make it
- simple and clear to express parameter types like 'an array of strings'
+* `documentation` can generate multiple formats. When you create a
+ website, `documentation` can take your documentation and generate
+ beautiful HTML output.
+* The JSDoc syntax exposes a powerful, standardized type syntax to, for example,
+ express parameter types like 'an array of strings'.
as `Array`, and to support custom object types with inter-linking
* The [eslint valid-jsdoc rule](http://eslint.org/docs/rules/valid-jsdoc.html)
makes it possible to require documentation as part of your linting step,
@@ -61,8 +61,8 @@ documentation.
## Which files does documentation.js include?
By default, `documentation.js` follows dependencies within your source tree
-and excludes `node_modules` from results. This is meant to include your application
-code automatically but avoid documenting the random npm modules you're
+and excludes `node_modules` from results. This is meant to process your application
+code automatically but avoid documenting the npm modules you're
using.
This means that if you point `documentation.js` at your `index.js` file and
@@ -71,7 +71,7 @@ those source files will be documented too.
You can customize this behavior by specifying the `--shallow` command-line
option. With `--shallow` specified, dependendencies aren't followed: documentation.js
-documents only the files you explicitly name.
+processes only those files you explicitly name.
If you're using ES modules, you enable the option `--document-exported` to automatically
document all exported bindings in your project, even if they don't have JSDoc comments.
From 87bfe7e8b7addac8cde72a71bf139af96e131504 Mon Sep 17 00:00:00 2001
From: Antonio Quinonez
Date: Fri, 23 Dec 2016 09:04:01 -0800
Subject: [PATCH 015/583] doc(readme): Fix learning documentation
---
docs/GETTING_STARTED.md | 112 +++++++++++++++++++---------------------
1 file changed, 52 insertions(+), 60 deletions(-)
diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md
index 2543dd3ca..dea047d3a 100644
--- a/docs/GETTING_STARTED.md
+++ b/docs/GETTING_STARTED.md
@@ -1,20 +1,15 @@
# Getting Started
-Assuming that you've installed the `documentation` application (`npm install -g documentation` if you haven't), how do you
-get started actually using it to document your code?
+`documentation` is a **documentation generator**. It's used to generates documentation from
+comments _within your code_. `documentation` processes JavaScript comments
+in the JSDoc format.
-Traditionally you might write documentation by creating a new Markdown
-file and typing in each function name and argument. Or you might not
-write documentation at all.
+**But don't worry! Even though it's embedded in your code, JSDoc is not code. It's a simple and standard
+syntax for writing documentation. You don't need to be a developer to use it.**
-`documentation` is a **documentation generator**, which means that it expects
-you to document your code _within the code_: special JavaScript comments
-in a format called JSDoc define what ends up in the docs.
+Before you continue, make sure `documentation` is on your system (do `npm install -g documentation`, if not installed).
-**But don't worry! Even though it's next to code, JSDoc is a simple and standard
-syntax that you can learn even if you aren't a full-time JavaScript developer.**
-
-Let's dive in.
+Now, let's dive in.
## The Essentials
@@ -34,8 +29,9 @@ function addOne(input) {
```
The comment before the `addOne` function is a JSDoc comment. Note that it
-begins with `/**` instead of `/*`. JSDoc requires this: if you were
-to write a comment like
+begins with `/**` instead of `/*`. JSDoc requires this.
+
+If you were to write a comment like
```js
// --- INVALID - this is ignored by JSDOC ---
@@ -44,9 +40,10 @@ to write a comment like
// @returns {number} that number, plus one.
```
-It would be ignored by JSDoc because it uses `//` syntax instead of `/**`.
+the comment would be ignored by `documentation` because it uses `//` syntax instead of `/**`.
+It's not valid JSDoc syntax.
-Okay: so let's break down that example into lines:
+Let's break down the earlier JSDoc example:
```js
/**
@@ -54,19 +51,18 @@ Okay: so let's break down that example into lines:
* ...
```
-The first line of the comment is typically the _description_. This part
-says _what the thing is or does_, within the space of a few sentences.
+The first line of the comment is typically the _description_. This section
+says _what the code is or does_.
```js
* @param {number} input any number
```
-The second line is a little more complex. The parts are
+On the second line:
-* `@param` is **a tag**: there are many tags, and
- they all begin with the `@` symbol.
-* `{number}` is **a type**. It says that the input to this function needs
- to be a JavaScript "number" type. It could also say string, like `{string}`,
+* `@param` is **a tag**: This tag indicates that we'll be documenting a function's parameter.
+* `{number}` is **a type**. It says that the input to this function is
+ a JavaScript "number". It could also say `{string}`,
`{Object}`, `{Date}`, or any other JavaScript built-in type. And if you
defined a custom class, like `FooClass`, you can use it as a type too by
saying `{FooClass}`.
@@ -74,46 +70,59 @@ The second line is a little more complex. The parts are
says right below it (`function addOne(input)`).
* `any number` is the description of the input.
-And then you see the next line: it's very similar to `@param`, but just a little
-different: `@returns` instead of `@param`, and since returned values in JavaScript
-don't have names, it just says the description of the value.
+On the third line, there's `@returns`. JavaScript returned values
+don't have names, so we just have a description of the value.
## Optional Parameters
-Sometimes libraries allow you to omit a parameter. Documentation should
-make this clear, and luckily there's a syntax that describes it:
+Sometimes functions allow you to omit a parameter.
+This is the syntax that describes an optional parameter:
```js
* @param {number} [input=5] any number
```
-This means that the number can be omitted, and if it is, it'll default
-to 5.
+If an input is omitted, the default value of 5 will be passed to the function.
+
+## What `documentation` does, so you don't have to
+
+`documentation` does some minor magic to auto-generate documentation. Unless
+you want to read the code for yourself, here's a summary of its magic:
+
+**Inference**: JSDoc lets you specify absolutely everything about your code:
+use @name to say what something is called, @kind for whether it's a function
+or a class, @param for its parameters, and so on. But writing all of that
+explicitly is tedious, so where it can, `documentation` automatically
+populates @name, @kind, and @memberof tags based on its reading of the
+code.
+
+**Normalization**: JSDoc has multiple words for the same thing: you can
+say @augments or @extends and they'll do the same thing.
## Development Process
-If you're actively contributing documentation to a big project, there
+If you're contributing documentation to a large project, there
are tools to help: [eslint's valid-jsdoc](http://eslint.org/docs/rules/valid-jsdoc) rule
-lets you confirm JSDoc comment presence & validity as part of an
+lets you confirm the presence of, and validate, JSDoc comments as part of an
automated style check.
## The Tags
-[usejsdoc.com](http://usejsdoc.org/index.html) covers all possible tags in the
-JSDoc syntax, and is a great reference material. The most common tags
-you'll see are:
+[usejsdoc.com](http://usejsdoc.org/index.html) covers all available tags in the
+JSDoc syntax, and is a great reference. The most commonly used tags
+are:
-* @param - input values given to a function as an argument
+* @param - input given to a function as an argument
* @returns - output value of a function
* @name - explicitly set the documented name of a function, class, or variable
-* @private - along with @public and @protected, you can use @private to document
- something for yourself without including it in generated documentation,
- since it isn't part of the public API
-* @example - you can use the @example tag to add code examples of how to
- use some thing inline with the thing itself
+* @private - you can use @private to document
+ code and not have it included in the generated documentation,
+ maybe it's not part of the public API. There's also @public and @protected
+* @example - you can use the @example tag to add inline code examples with your
+ documentation
-It'll help to remember the available tags if your text editor highlights correct tags: if it
-doesn't, try [using a plugin for JSDoc](https://github.com/documentationjs/documentation/wiki/Text-editor-plugins).
+If your text editor does not highlight JSDoc tags,
+try [using a plugin for JSDoc](https://github.com/documentationjs/documentation/wiki/Text-editor-plugins).
## Flow type annotations
@@ -127,20 +136,3 @@ function addOne(input: number): number {
return input + 1;
}
```
-
-## What `documentation` does
-
-Documentation does some minor magic to generate documentation. Unless
-you want to read the code for yourself, here's a summary of how it connects
-to your task as a developer.
-
-**Inference**: JSDoc lets you specify absolutely everything about your code:
-use @name to say what something is called, @kind for whether it's a function
-or a class, @param for its parameters, and so on. But writing all of that
-explicitly is tedious, so where it can, `documentation` can automatically
-fill in @name, @kind, and @memberof tags based on its reading of the source
-code.
-
-**Normalization**: JSDoc has multiple words for the same thing: you can
-say @augments or @extends and they'll do the same thing. `documentation`
-normalizes these values to make them styleable.
From 44aab3fe448ab6c6a737a07f03948d2029deaee0 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Fri, 23 Dec 2016 12:10:18 -0500
Subject: [PATCH 016/583] beta.17
---
CHANGELOG.md | 14 ++++++++++++++
package.json | 4 ++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0b889b0fb..06ce8df49 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,17 @@
+
+# [4.0.0-beta.17](https://github.com/documentationjs/documentation/compare/v4.0.0-beta16...v4.0.0-beta.17) (2016-12-23)
+
+This release also fixes a mistake I was making with semver: pre-v4 beta
+releases will be called `beta.17` and `beta.18` and so on, rather than
+non-standard `beta16` without the `.`.
+
+
+### Bug Fixes
+
+* **hierarchy:** collect events from static and instance members (#628) ([f1e0267](https://github.com/documentationjs/documentation/commit/f1e0267)), closes [#486](https://github.com/documentationjs/documentation/issues/486)
+
+
+
# [4.0.0-beta16](https://github.com/documentationjs/documentation/compare/v4.0.0-beta15...v4.0.0-beta16) (2016-12-07)
diff --git a/package.json b/package.json
index 6d6f0b958..20910ad16 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "documentation",
"description": "a documentation generator",
- "version": "4.0.0-beta16",
+ "version": "4.0.0-beta.17",
"author": "Tom MacWright",
"bin": {
"documentation": "./bin/documentation.js"
@@ -85,7 +85,7 @@
"scripts": {
"lint": "eslint bin lib index.js test",
"doc": "documentation build index.js -f md --access=public > docs/NODE_API.md",
- "changelog": "standard-changelog -i CHANGELOG.md -s",
+ "changelog": "standard-changelog -i CHANGELOG.md -w",
"self-lint": "node ./bin/documentation.js lint",
"test": "npm run lint && npm run self-lint && tap -t 120 --coverage --nyc-arg=--cache test/*.js test/lib test/streams"
},
From 7a66b3f5bbef4688cb83a743d2bc79fe4ac9dde3 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Fri, 23 Dec 2016 12:54:38 -0500
Subject: [PATCH 017/583] perf(dependencies): Move standard-changelog to
devDependencies (#636)
Saves install time and space.
Refs https://github.com/documentationjs/documentation/issues/622
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 20910ad16..9018e802c 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,6 @@
"remark-toc": "^3.0.0",
"remote-origin-url": "0.4.0",
"resolve": "^1.1.6",
- "standard-changelog": "0.0.1",
"stream-array": "^1.1.0",
"strip-json-comments": "^2.0.0",
"tiny-lr": "^1.0.3",
@@ -58,6 +57,7 @@
},
"devDependencies": {
"chdir": "0.0.0",
+ "standard-changelog": "0.0.1",
"cz-conventional-changelog": "1.2.0",
"documentation-schema": "0.0.1",
"eslint": "^3.1.0",
From cb8fdfa74fc01496102c593f2706ad10d3b7723f Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Mon, 26 Dec 2016 10:24:30 -0500
Subject: [PATCH 018/583] feat(bin): Support globs on windows and use smarter
recursion (#629)
This brings logic from eslint over to documentation: instead of readdirSync, we're using the glob
module. This also, I hope, will let us support globs on Windows without changing OSX/Linux behavior.
Fixes #607
---
LICENSE | 25 ++++++
docs/POLYGLOT.md | 39 ++++++++++
index.js | 12 +--
lib/commands/shared_options.js | 20 ++++-
lib/filter_js.js | 34 --------
lib/input/dependency.js | 48 +++++++-----
lib/input/expand_directories.js | 40 ----------
lib/input/shallow.js | 17 +++-
lib/smart_glob.js | 133 ++++++++++++++++++++++++++++++++
package.json | 5 +-
test/bin-readme.js | 5 +-
test/bin.js | 15 +++-
test/fixture/require-json.json | 2 +-
test/lib/input/shallow.js | 9 +++
test/lib/parsers/polyglot.js | 12 +--
15 files changed, 294 insertions(+), 122 deletions(-)
create mode 100644 docs/POLYGLOT.md
delete mode 100644 lib/filter_js.js
delete mode 100644 lib/input/expand_directories.js
create mode 100644 lib/smart_glob.js
diff --git a/LICENSE b/LICENSE
index 0604a1314..e9b9b142d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -13,3 +13,28 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+--------------------------------------------------------------------------------
+
+Contains sections of eslint
+
+ESLint
+Copyright JS Foundation and other contributors, https://js.foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/docs/POLYGLOT.md b/docs/POLYGLOT.md
new file mode 100644
index 000000000..c2c9373ce
--- /dev/null
+++ b/docs/POLYGLOT.md
@@ -0,0 +1,39 @@
+# About documentation.js, polyglot mode, and file extensions
+
+Base assumptions:
+
+* documentation.js subsists on a combination of _source comments_ and
+ _smart inferences from source code_.
+* The default mode of documentation.js is parsing JavaScript, but it has another
+ mode, called `--polyglot` mode, that doesn't include any inference at all
+ and lets you document other kinds of source code.
+* The default settings for everything should work for most projects, but
+ this is a guide for if you have a particular setup.
+
+## File extensions
+
+Let's talk about file extensions. We have two different flags for controlling
+file extensions: `requireExtension` and `parseExtension`.
+
+* requireExtension adds additional filetypes to the node.js `require()` method.
+ By default, you can call, for instance, `require('foo')`, and the require algorithm
+ will look for `foo.js`, `foo` the module, and `foo.json`. Adding another
+ extension in requireExtension lets it look for `foo.otherextension`.
+* parseExtension adds additional filetypes to the list of filetypes documentation.js
+ thinks it can parse, and it also adds those additional filetypes to the default
+ files it looks for when you specify a directory or glob as input.
+
+## Polyglot
+
+Polyglot mode switches documentation.js from running on babylon and [babel](https://babeljs.io/)
+as a JavaScript parser, to using [get-comments](https://github.com/tunnckocore/get-comments).
+This lets it grab comments formatted in the `/** Comment */` style from source
+code that _isn't_ JavaScript, like C++ or CSS code.
+
+Since documentation.js doesn't _parse_ C++ and lots of other languages (parsing JavaScript is complicated enough!),
+it can't make any of its smart inferences about their source code: it just
+takes documentation comments and shows them as-is.
+
+You _can_ use polyglot mode to turn off inference across the board, but I don't recommend
+it. See the 'too much inference' topic in [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
+for detail about that.
diff --git a/index.js b/index.js
index c962c0824..f79a7e30c 100644
--- a/index.js
+++ b/index.js
@@ -5,7 +5,6 @@ var fs = require('fs'),
sort = require('./lib/sort'),
nest = require('./lib/nest'),
filterAccess = require('./lib/filter_access'),
- filterJS = require('./lib/filter_js'),
dependency = require('./lib/input/dependency'),
shallow = require('./lib/input/shallow'),
parseJavaScript = require('./lib/parsers/javascript'),
@@ -27,6 +26,8 @@ var fs = require('fs'),
markdownAST = require('./lib/output/markdown_ast'),
loadConfig = require('./lib/load_config');
+var parseExtensions = ['js', 'jsx', 'es5', 'es6'];
+
/**
* Build a pipeline of comment handlers.
* @param {...Function|null} args - Pipeline elements. Each is a function that accepts
@@ -62,6 +63,8 @@ function expandInputs(indexes, options, callback) {
} else {
inputFn = dependency;
}
+ options.parseExtensions = parseExtensions
+ .concat(options.parseExtension || []);
inputFn(indexes, options, callback);
}
@@ -214,8 +217,6 @@ function buildSync(indexes, options) {
options.github && github,
garbageCollect);
- var jsFilterer = filterJS(options.extension, options.polyglot);
-
return filterAccess(options.access,
hierarchy(
sort(
@@ -231,10 +232,6 @@ function buildSync(indexes, options) {
indexObject = index;
}
- if (!jsFilterer(indexObject)) {
- return [];
- }
-
return parseFn(indexObject, options).map(buildPipeline);
})
.filter(Boolean), options)));
@@ -309,7 +306,6 @@ function lint(indexes, options, callback) {
callback(null,
formatLint(hierarchy(
inputs
- .filter(filterJS(options.extension, options.polyglot))
.reduce(function (memo, file) {
return memo.concat(parseFn(file, options).map(lintPipeline));
}, [])
diff --git a/lib/commands/shared_options.js b/lib/commands/shared_options.js
index 5550eb417..192757f27 100644
--- a/lib/commands/shared_options.js
+++ b/lib/commands/shared_options.js
@@ -24,10 +24,22 @@ module.exports.sharedInputOptions = {
'modules will be whitelisted and included in the generated documentation.',
default: null
},
- 'extension': {
- describe: 'only input source files matching this extension will be parsed, ' +
- 'this option can be used multiple times.',
- alias: 'e'
+ 'requireExtension': {
+ describe: 'additional extensions to include in require() and import\'s search algorithm.' +
+ 'For instance, adding .es5 would allow require("adder") to find "adder.es5"',
+ coerce: function (value) {
+ // Ensure that the value is an array
+ return [].concat(value);
+ },
+ alias: 're'
+ },
+ 'parseExtension': {
+ describe: 'additional extensions to parse as source code.',
+ coerce: function (value) {
+ // Ensure that the value is an array
+ return [].concat(value);
+ },
+ alias: 'pe'
},
'polyglot': {
type: 'boolean',
diff --git a/lib/filter_js.js b/lib/filter_js.js
deleted file mode 100644
index f824d0f61..000000000
--- a/lib/filter_js.js
+++ /dev/null
@@ -1,34 +0,0 @@
-'use strict';
-
-var path = require('path');
-
-/**
- * Node & browserify support requiring JSON files. JSON files can't be documented
- * with JSDoc or parsed with espree, so we filter them out before
- * they reach documentation's machinery.
- * This creates a filter function for use with Array.prototype.filter, which
- * expect as argument a file as an objectg with the 'file' property
- *
- * @private
- * @param {string|Array} extension to be filtered
- * @param {boolean} allowAll ignore the entire extension check and always
- * pass through files. This is used by the polglot mode.
- * @return {Function} a filter function, this function returns true if the input filename extension
- * is in the extension whitelist
- */
-function filterJS(extension, allowAll) {
-
- if (allowAll) {
- return function () {
- return true;
- };
- }
-
- var extensions = [].concat(extension || []).concat(['js', 'es6', 'jsx']);
-
- return function (data) {
- return extensions.indexOf(path.extname(data.file).substring(1)) !== -1;
- };
-}
-
-module.exports = filterJS;
diff --git a/lib/input/dependency.js b/lib/input/dependency.js
index 57f932534..e7b81433e 100644
--- a/lib/input/dependency.js
+++ b/lib/input/dependency.js
@@ -1,13 +1,12 @@
'use strict';
-var mdeps = require('module-deps-sortable'),
- fs = require('fs'),
- path = require('path'),
- babelify = require('babelify'),
- filterJS = require('../filter_js'),
- concat = require('concat-stream'),
- moduleFilters = require('../../lib/module_filters'),
- expandDirectories = require('./expand_directories');
+var mdeps = require('module-deps-sortable');
+var fs = require('fs');
+var path = require('path');
+var babelify = require('babelify');
+var concat = require('concat-stream');
+var moduleFilters = require('../../lib/module_filters');
+var smartGlob = require('../smart_glob.js');
/**
* Returns a readable stream of dependencies, given an array of entry
@@ -22,8 +21,6 @@ var mdeps = require('module-deps-sortable'),
* @returns {undefined} calls callback
*/
function dependencyStream(indexes, options, callback) {
- var filterer = filterJS(options.extension, options.polyglot);
-
var md = mdeps({
/**
* Determine whether a module should be included in documentation
@@ -33,11 +30,11 @@ function dependencyStream(indexes, options, callback) {
filter: function (id) {
return !!options.external || moduleFilters.internalOnly(id);
},
- extensions: [].concat(options.extension || [])
- .concat(['js', 'es6', 'jsx', 'json'])
+ extensions: [].concat(options.requireExtension || [])
.map(function (ext) {
- return '.' + ext;
- }),
+ return '.' + ext.replace(/^\./, '');
+ })
+ .concat(['.js', '.json', '.es6', '.jsx']),
transform: [babelify.configure({
sourceMap: false,
compact: false,
@@ -55,7 +52,7 @@ function dependencyStream(indexes, options, callback) {
})],
postFilter: moduleFilters.externals(indexes, options)
});
- expandDirectories(indexes, filterer).forEach(function (index) {
+ smartGlob(indexes, options.parseExtensions).forEach(function (index) {
md.write(path.resolve(index));
});
md.end();
@@ -63,11 +60,22 @@ function dependencyStream(indexes, options, callback) {
return callback(error);
});
md.pipe(concat(function (inputs) {
- callback(null, inputs.map(function (input) {
- // un-transform babelify transformed source
- input.source = fs.readFileSync(input.file, 'utf8');
- return input;
- }));
+ callback(null, inputs
+ .filter(function (input) {
+ // At this point, we may have allowed a JSON file to be caught by
+ // module-deps, or anything else allowed by requireExtension.
+ // otherwise module-deps would complain about
+ // it not being found. But Babel can't parse JSON, so we filter non-JavaScript
+ // files away.
+ return options.parseExtensions.indexOf(
+ path.extname(input.file).replace(/^\./, '')
+ ) > -1;
+ })
+ .map(function (input) {
+ // un-transform babelify transformed source
+ input.source = fs.readFileSync(input.file, 'utf8');
+ return input;
+ }));
}));
}
diff --git a/lib/input/expand_directories.js b/lib/input/expand_directories.js
deleted file mode 100644
index 5b366ec6d..000000000
--- a/lib/input/expand_directories.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var fs = require('fs');
-var path = require('path');
-var _ = require('lodash');
-
-/**
- * Given a list of indexes, expand those indexes that are paths
- * to directories into sub-lists of files. This does _not_ work
- * recursively and will throw an error if an index is not found
- *
- * @private
- * @throws {Error} if index is not found
- * @param {Array} indexes entry points given to documentatino
- * @param {Function} filterer method that avoids evaluating non-JavaScript files
- * @returns {Array} flattened array of file sources
- */
-function expandDirectories(indexes, filterer) {
- return _.flatMap(indexes, function (index) {
- if (typeof index !== 'string') {
- return index;
- }
- try {
- var stat = fs.statSync(index);
- if (stat.isFile()) {
- return index;
- } else if (stat.isDirectory()) {
- return fs.readdirSync(index)
- .filter(function (file) {
- return filterer({ file: file });
- })
- .map(function (file) {
- return path.join(index, file);
- });
- }
- } catch (e) {
- throw new Error('Input file ' + index + ' not found!');
- }
- });
-}
-
-module.exports = expandDirectories;
diff --git a/lib/input/shallow.js b/lib/input/shallow.js
index 532ef2d91..ec52d2239 100644
--- a/lib/input/shallow.js
+++ b/lib/input/shallow.js
@@ -1,7 +1,6 @@
'use strict';
-var filterJS = require('../filter_js');
-var expandDirectories = require('./expand_directories');
+var smartGlob = require('../smart_glob.js');
/**
* A readable source for content that doesn't do dependency resolution, but
@@ -21,6 +20,16 @@ var expandDirectories = require('./expand_directories');
* @return {undefined} calls callback
*/
module.exports = function (indexes, options, callback) {
- var filterer = filterJS(options.extension, options.polyglot);
- return callback(null, expandDirectories(indexes, filterer));
+ var objects = [];
+ var strings = [];
+ indexes.forEach(function (index) {
+ if (typeof index === 'string') {
+ strings.push(index);
+ } else if (typeof index === 'object') {
+ objects.push(index);
+ } else {
+ throw new Error('Indexes should be either strings or objects');
+ }
+ });
+ return callback(null, objects.concat(smartGlob(strings, options.parseExtensions)));
};
diff --git a/lib/smart_glob.js b/lib/smart_glob.js
new file mode 100644
index 000000000..72f81277f
--- /dev/null
+++ b/lib/smart_glob.js
@@ -0,0 +1,133 @@
+var fs = require('fs');
+var path = require('path');
+var glob = require('glob');
+var shell = require('shelljs');
+
+/**
+ * Replace Windows with posix style paths
+ *
+ * @param {string} filepath Path to convert
+ * @returns {string} Converted filepath
+ */
+function convertPathToPosix(filepath) {
+ var normalizedFilepath = path.normalize(filepath);
+ var posixFilepath = normalizedFilepath.replace(/\\/g, '/');
+
+ return posixFilepath;
+}
+
+/**
+ * Checks if a provided path is a directory and returns a glob string matching
+ * all files under that directory if so, the path itself otherwise.
+ *
+ * Reason for this is that `glob` needs `/**` to collect all the files under a
+ * directory where as our previous implementation without `glob` simply walked
+ * a directory that is passed. So this is to maintain backwards compatibility.
+ *
+ * Also makes sure all path separators are POSIX style for `glob` compatibility.
+ *
+ * @param {string[]} [extensions=['.js']] An array of accepted extensions
+ * @returns {Function} A function that takes a pathname and returns a glob that
+ * matches all files with the provided extensions if
+ * pathname is a directory.
+ */
+function processPath(extensions) {
+ var cwd = process.cwd();
+ extensions = extensions || ['.js'];
+
+ extensions = extensions.map(function (ext) {
+ return ext.replace(/^\./, '');
+ });
+
+ var suffix = '/**';
+
+ if (extensions.length === 1) {
+ suffix += '/*.' + extensions[0];
+ } else {
+ suffix += '/*.{' + extensions.join(',') + '}';
+ }
+
+ /**
+ * A function that converts a directory name to a glob pattern
+ *
+ * @param {string} pathname The directory path to be modified
+ * @returns {string} The glob path or the file path itself
+ * @private
+ */
+ return function (pathname) {
+ var newPath = pathname;
+ var resolvedPath = path.resolve(cwd, pathname);
+
+ if (shell.test('-d', resolvedPath)) {
+ newPath = pathname.replace(/[/\\]$/, '') + suffix;
+ }
+
+ return convertPathToPosix(newPath);
+ };
+}
+
+/**
+ * Resolves any directory patterns into glob-based patterns for easier handling.
+ * @param {string[]} patterns File patterns (such as passed on the command line).
+ * @param {Array} extensions A list of file extensions
+ * @returns {string[]} The equivalent glob patterns and filepath strings.
+ */
+function resolveFileGlobPatterns(patterns, extensions) {
+ var processPathExtensions = processPath(extensions);
+ return patterns.map(processPathExtensions);
+}
+
+/**
+ * Build a list of absolute filesnames on which ESLint will act.
+ * Ignored files are excluded from the results, as are duplicates.
+ *
+ * @param {string[]} globPatterns Glob patterns.
+ * @returns {string[]} Resolved absolute filenames.
+ */
+function listFilesToProcess(globPatterns) {
+ var files = [],
+ added = Object.create(null);
+
+ var cwd = process.cwd();
+
+ /**
+ * Executes the linter on a file defined by the `filename`. Skips
+ * unsupported file extensions and any files that are already linted.
+ * @param {string} filename The file to be processed
+ * @returns {void}
+ */
+ function addFile(filename) {
+ if (added[filename]) {
+ return;
+ }
+ files.push(filename);
+ added[filename] = true;
+ }
+
+ globPatterns.forEach(function (pattern) {
+ var file = path.resolve(cwd, pattern);
+ if (shell.test('-f', file)) {
+ addFile(fs.realpathSync(file), !shell.test('-d', file));
+ } else {
+ var globOptions = {
+ nodir: true,
+ dot: true,
+ cwd,
+ };
+
+ glob.sync(pattern, globOptions).forEach(function (globMatch) {
+ addFile(path.resolve(cwd, globMatch), false);
+ });
+ }
+ });
+
+ return files;
+}
+
+function smartGlob(indexes, extensions) {
+ return listFilesToProcess(
+ resolveFileGlobPatterns(indexes, extensions)
+ );
+}
+
+module.exports = smartGlob;
diff --git a/package.json b/package.json
index 9018e802c..ff4de303f 100644
--- a/package.json
+++ b/package.json
@@ -30,6 +30,7 @@
"git-url-parse": "^6.0.1",
"github-slugger": "1.1.1",
"globals-docs": "^2.3.0",
+ "glob": "^7.0.0",
"highlight.js": "^9.1.0",
"js-yaml": "^3.3.1",
"lodash": "^4.11.1",
@@ -43,6 +44,7 @@
"remark-toc": "^3.0.0",
"remote-origin-url": "0.4.0",
"resolve": "^1.1.6",
+ "shelljs": "^0.7.5",
"stream-array": "^1.1.0",
"strip-json-comments": "^2.0.0",
"tiny-lr": "^1.0.3",
@@ -60,9 +62,8 @@
"standard-changelog": "0.0.1",
"cz-conventional-changelog": "1.2.0",
"documentation-schema": "0.0.1",
- "eslint": "^3.1.0",
+ "eslint": "^3.12.2",
"fs-extra": "^1.0.0",
- "glob": "^7.0.0",
"json-schema": "0.2.3",
"mock-fs": "^3.5.0",
"tap": "^8.0.0",
diff --git a/test/bin-readme.js b/test/bin-readme.js
index 2337ac8c7..e930df13c 100644
--- a/test/bin-readme.js
+++ b/test/bin-readme.js
@@ -100,8 +100,9 @@ test('readme command', function (group) {
});
});
- group.test('errors if specified readme section is missing', function (t) {
- documentation(['readme index.js -s DUMMY'], {cwd: d}, function (err, stdout, stderr) {
+ var badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input.js');
+ group.test('errors on invalid syntax', function (t) {
+ documentation(['readme ' + badFixturePath + ' -s API'], {cwd: d}, function (err, stdout, stderr) {
t.ok(err);
t.ok(err.code !== 0, 'exit nonzero');
t.end();
diff --git a/test/bin.js b/test/bin.js
index fc10577f9..f2a9aa113 100644
--- a/test/bin.js
+++ b/test/bin.js
@@ -141,7 +141,20 @@ test('external modules option', function (t) {
test('extension option', function (t) {
documentation(['build fixture/extension/index.otherextension ' +
- '--extension=otherextension'], function (err, data) {
+ '--requireExtension=otherextension --parseExtension=otherextension'], function (err, data) {
+ t.ifError(err);
+ t.equal(data.length, 1, 'includes a file with an arbitrary extension');
+ t.end();
+ });
+});
+
+/*
+ * This tests that parseExtension adds extensions to smartGlob's
+ * look through directories.
+ */
+test('polyglot + parseExtension + smartGlob', function (t) {
+ documentation(['build fixture/polyglot ' +
+ '--polyglot --parseExtension=cpp'], function (err, data) {
t.ifError(err);
t.equal(data.length, 1, 'includes a file with an arbitrary extension');
t.end();
diff --git a/test/fixture/require-json.json b/test/fixture/require-json.json
index 0967ef424..2393cd01d 100644
--- a/test/fixture/require-json.json
+++ b/test/fixture/require-json.json
@@ -1 +1 @@
-{}
+{"foo":"bar"}
diff --git a/test/lib/input/shallow.js b/test/lib/input/shallow.js
index 6eb9fc491..2c0fef558 100644
--- a/test/lib/input/shallow.js
+++ b/test/lib/input/shallow.js
@@ -45,6 +45,15 @@ test('shallow deps not found', function (t) {
t.end();
});
+test('throws on non-string or object input', function (t) {
+ t.throws(function () {
+ shallow([
+ true
+ ], {});
+ }, 'indexes should be either strings or objects');
+ t.end();
+});
+
test('shallow deps literal', function (t) {
var obj = {
file: 'foo.js',
diff --git a/test/lib/parsers/polyglot.js b/test/lib/parsers/polyglot.js
index 028abd122..b9378271e 100644
--- a/test/lib/parsers/polyglot.js
+++ b/test/lib/parsers/polyglot.js
@@ -27,11 +27,11 @@ test('polyglot', function (t) {
description: remark().parse('color'),
type: { name: 'number', type: 'NameExpression' } } ],
tags: [ { description: null, lineNumber: 2, name: 'hexToUInt32Color', title: 'name' },
- { description: null, lineNumber: 3, name: 'hex', title: 'param', type: {
- name: 'string', type: 'NameExpression'
- } },
- { description: 'color', lineNumber: 4, title: 'returns', type: {
- name: 'number', type: 'NameExpression'
- } } ] } ], 'polyglot parser');
+ { description: null, lineNumber: 3, name: 'hex', title: 'param', type: {
+ name: 'string', type: 'NameExpression'
+ } },
+ { description: 'color', lineNumber: 4, title: 'returns', type: {
+ name: 'number', type: 'NameExpression'
+ } } ] } ], 'polyglot parser');
t.end();
});
From e8831e76c5ee0edd35b27edb105658c30fd73e90 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Mon, 26 Dec 2016 10:57:24 -0500
Subject: [PATCH 019/583] test(parse): Improve test coverage of glob and doc
parsing (#637)
---
test/bin.js | 8 ++++++++
test/lib/parse.js | 20 ++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/test/bin.js b/test/bin.js
index f2a9aa113..c63a73cd5 100644
--- a/test/bin.js
+++ b/test/bin.js
@@ -139,6 +139,14 @@ test('external modules option', function (t) {
});
});
+test('when a file is specified both in a glob and explicitly, it is only documented once', function (t) {
+ documentation(['build fixture/simple.input.js fixture/simple.input.*'], function (err, data) {
+ t.ifError(err);
+ t.equal(data.length, 1, 'File is documented only once');
+ t.end();
+ });
+});
+
test('extension option', function (t) {
documentation(['build fixture/extension/index.otherextension ' +
'--requireExtension=otherextension --parseExtension=otherextension'], function (err, data) {
diff --git a/test/lib/parse.js b/test/lib/parse.js
index 46c50bdbf..be1b7eda0 100644
--- a/test/lib/parse.js
+++ b/test/lib/parse.js
@@ -82,6 +82,26 @@ test('parse - @augments', function (t) {
t.end();
});
+/*
+ * Dossier-style augments tag
+ * https://github.com/google/closure-library/issues/746
+ */
+test('parse - @augments in dossier style', function (t) {
+ t.equal(evaluate(function () {
+ /** @augments {Foo} */
+ })[0].augments[0].name, 'Foo', 'augments');
+
+ t.end();
+});
+
+test('parse - @augments of complex passes through', function (t) {
+ t.deepEqual(evaluate(function () {
+ /** @augments {function()} */
+ })[0].augments, []);
+
+ t.end();
+});
+
test('parse - @author', function (t) {
t.end();
});
From 3b26b9c1695d735b55464ff2334bb9be186e9989 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Mon, 26 Dec 2016 11:08:07 -0500
Subject: [PATCH 020/583] ci(coverage): Switch back to coveralls for code
coverage (#639)
node-tap removed built-in codecov support, so back to coveralls we go
Fixes https://github.com/documentationjs/documentation/issues/638
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 62132b19e..59d8f9753 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
[](http://badge.fury.io/js/documentation)
[](https://gitter.im/documentationjs/documentation?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[](https://david-dm.org/documentationjs/documentation)
-[](https://codecov.io/github/documentationjs/documentation?branch=master)
+[](https://coveralls.io/github/documentationjs/documentation?branch=master)
[](http://inch-ci.org/github/documentationjs/documentation)
A **documentation generation system** that's
From 813dfbbc2994fba911c01fed150438baeed05967 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Wed, 28 Dec 2016 18:16:08 -0500
Subject: [PATCH 021/583] docs(nodeapi): Fix node API documentation: formatters
call (err, res) (#643)
Fixes https://github.com/documentationjs/documentation/issues/642
---
docs/NODE_API.md | 53 +++++++++++++++++++++---------------------
lib/output/html.js | 2 +-
lib/output/json.js | 2 +-
lib/output/markdown.js | 2 +-
4 files changed, 30 insertions(+), 29 deletions(-)
diff --git a/docs/NODE_API.md b/docs/NODE_API.md
index 7a3955ca3..88edce60b 100644
--- a/docs/NODE_API.md
+++ b/docs/NODE_API.md
@@ -12,23 +12,23 @@ comments, given a root file as a path.
- `options.external` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a string regex / glob match pattern
that defines what external modules will be whitelisted and included in the
generated documentation.
- - `options.polyglot` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** parse comments with a regex rather than
+ - `options.polyglot` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** parse comments with a regex rather than
a proper parser. This enables support of non-JavaScript languages but
reduces documentation's ability to infer structure of code. (optional, default `false`)
- - `options.shallow` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** whether to avoid dependency parsing
+ - `options.shallow` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** whether to avoid dependency parsing
even in JavaScript code. With the polyglot option set, this has no effect. (optional, default `false`)
- - `options.order` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))>]** optional array that
+ - `options.order` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))>?** optional array that
defines sorting order of documentation (optional, default `[]`)
- - `options.access` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>]** an array of access levels
+ - `options.access` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>?** an array of access levels
to output in documentation (optional, default `[]`)
- - `options.hljs` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** hljs optional options
- - `options.hljs.highlightAuto` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** hljs automatically detect language (optional, default `false`)
- - `options.hljs.languages` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** languages for hljs to choose from
- - `options.inferPrivate` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** a valid regular expression string
+ - `options.hljs` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** hljs optional options
+ - `options.hljs.highlightAuto` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** hljs automatically detect language (optional, default `false`)
+ - `options.hljs.languages` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** languages for hljs to choose from
+ - `options.inferPrivate` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** a valid regular expression string
to infer whether a code element should be private, given its naming structure.
For instance, you can specify `inferPrivate: '^_'` to automatically treat
methods named like `_myMethod` as private.
- - `options.extension` **\[([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)]** treat additional file extensions
+ - `options.extension` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** treat additional file extensions
as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** to be called when the documentation generation
is complete, with (err, result) argumentsj
@@ -67,24 +67,25 @@ synchronously, rather than by calling a callback.
- `options.external` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a string regex / glob match pattern
that defines what external modules will be whitelisted and included in the
generated documentation.
- - `options.polyglot` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** parse comments with a regex rather than
+ - `options.polyglot` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** parse comments with a regex rather than
a proper parser. This enables support of non-JavaScript languages but
reduces documentation's ability to infer structure of code. (optional, default `false`)
- - `options.shallow` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** whether to avoid dependency parsing
+ - `options.shallow` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** whether to avoid dependency parsing
even in JavaScript code. With the polyglot option set, this has no effect. (optional, default `false`)
- - `options.order` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))>]** optional array that
+ - `options.order` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))>?** optional array that
defines sorting order of documentation (optional, default `[]`)
- - `options.access` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>]** an array of access levels
+ - `options.access` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>?** an array of access levels
to output in documentation (optional, default `[]`)
- - `options.hljs` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** hljs optional options
- - `options.hljs.highlightAuto` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** hljs automatically detect language (optional, default `false`)
- - `options.hljs.languages` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** languages for hljs to choose from
- - `options.inferPrivate` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** a valid regular expression string
+ - `options.hljs` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** hljs optional options
+ - `options.hljs.highlightAuto` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** hljs automatically detect language (optional, default `false`)
+ - `options.hljs.languages` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** languages for hljs to choose from
+ - `options.inferPrivate` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** a valid regular expression string
to infer whether a code element should be private, given its naming structure.
For instance, you can specify `inferPrivate: '^_'` to automatically treat
methods named like `_myMethod` as private.
- - `options.extension` **\[([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)]** treat additional file extensions
+ - `options.extension` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** treat additional file extensions
as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
+- `config` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** path to configuration file to load
**Examples**
@@ -112,16 +113,16 @@ of lint information intended for human-readable output.
- `options.external` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a string regex / glob match pattern
that defines what external modules will be whitelisted and included in the
generated documentation.
- - `options.polyglot` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** parse comments with a regex rather than
+ - `options.polyglot` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** parse comments with a regex rather than
a proper parser. This enables support of non-JavaScript languages but
reduces documentation's ability to infer structure of code. (optional, default `false`)
- - `options.shallow` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** whether to avoid dependency parsing
+ - `options.shallow` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** whether to avoid dependency parsing
even in JavaScript code. With the polyglot option set, this has no effect. (optional, default `false`)
- - `options.inferPrivate` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** a valid regular expression string
+ - `options.inferPrivate` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** a valid regular expression string
to infer whether a code element should be private, given its naming structure.
For instance, you can specify `inferPrivate: '^_'` to automatically treat
methods named like `_myMethod` as private.
- - `options.extension` **\[([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)]** treat additional file extensions
+ - `options.extension` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** treat additional file extensions
as JavaScript, extending the default set of `js`, `es6`, and `jsx`.
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** to be called when the documentation generation
is complete, with (err, result) arguments
@@ -159,7 +160,7 @@ Formats documentation as HTML.
- `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** parsed comments
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output
- - `options.theme` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Name of a module used for an HTML theme. (optional, default `'default_theme'`)
+ - `options.theme` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Name of a module used for an HTML theme. (optional, default `'default_theme'`)
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Called with array of results as vinyl-fs objects.
**Examples**
@@ -170,7 +171,7 @@ var streamArray = require('stream-array');
var vfs = require('vinyl-fs');
documentation.build(['index.js'], {}, function (err, res) {
- documentation.formats.html(res, {}, function(output) {
+ documentation.formats.html(res, {}, function(err, output) {
streamArray(output).pipe(vfs.dest('./output-directory'));
});
});
@@ -196,7 +197,7 @@ var documentation = require('documentation');
var fs = require('fs');
documentation.build(['index.js'], {}, function (err, res) {
- documentation.formats.md(res, {}, function(output) {
+ documentation.formats.md(res, {}, function(err, output) {
// output is a string of JSON data
fs.writeFileSync('./output.md', output);
});
@@ -222,7 +223,7 @@ var documentation = require('documentation');
var fs = require('fs');
documentation.build(['index.js'], {}, function (err, res) {
- documentation.formats.json(res, {}, function(output) {
+ documentation.formats.json(res, {}, function(err, output) {
// output is a string of JSON data
fs.writeFileSync('./output.json', output);
});
diff --git a/lib/output/html.js b/lib/output/html.js
index dcd3a40dd..249b632d3 100644
--- a/lib/output/html.js
+++ b/lib/output/html.js
@@ -18,7 +18,7 @@ var path = require('path');
* var vfs = require('vinyl-fs');
*
* documentation.build(['index.js'], {}, function (err, res) {
- * documentation.formats.html(res, {}, function(output) {
+ * documentation.formats.html(res, {}, function(err, output) {
* streamArray(output).pipe(vfs.dest('./output-directory'));
* });
* });
diff --git a/lib/output/json.js b/lib/output/json.js
index 86f26b10f..c9f10c293 100644
--- a/lib/output/json.js
+++ b/lib/output/json.js
@@ -16,7 +16,7 @@ var walk = require('../walk');
* var fs = require('fs');
*
* documentation.build(['index.js'], {}, function (err, res) {
- * documentation.formats.json(res, {}, function(output) {
+ * documentation.formats.json(res, {}, function(err, output) {
* // output is a string of JSON data
* fs.writeFileSync('./output.json', output);
* });
diff --git a/lib/output/markdown.js b/lib/output/markdown.js
index ea0e3e545..cf890296a 100644
--- a/lib/output/markdown.js
+++ b/lib/output/markdown.js
@@ -19,7 +19,7 @@ var remark = require('remark'),
* var fs = require('fs');
*
* documentation.build(['index.js'], {}, function (err, res) {
- * documentation.formats.md(res, {}, function(output) {
+ * documentation.formats.md(res, {}, function(err, output) {
* // output is a string of JSON data
* fs.writeFileSync('./output.md', output);
* });
From 2ae5d8f30463a99e295de6486a04c8275dd368ed Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Wed, 28 Dec 2016 20:12:17 -0500
Subject: [PATCH 022/583] fix(markdown): Start headings in Markdown at h2
(#644)
Fixes https://github.com/documentationjs/documentation/issues/641
---
docs/NODE_API.md | 14 ++---
lib/output/markdown_ast.js | 2 +-
package.json | 2 +-
.../auto_lang_hljs/multilanguage.output.md | 2 +-
test/fixture/boolean-literal-type.output.md | 2 +-
.../boolean-literal-type.output.md.json | 2 +-
test/fixture/class.config.output.md | 8 +--
test/fixture/class.output.md | 6 +-
test/fixture/class.output.md.json | 6 +-
...t-exported-export-default-object.output.md | 4 +-
...orted-export-default-object.output.md.json | 4 +-
...nt-exported-export-default-value.output.md | 2 +-
...ported-export-default-value.output.md.json | 2 +-
test/fixture/document-exported.output.md | 60 +++++++++----------
test/fixture/document-exported.output.md.json | 60 +++++++++----------
test/fixture/es6-class.output.md | 8 +--
test/fixture/es6-class.output.md.json | 8 +--
test/fixture/es6-default2.output.md | 2 +-
test/fixture/es6-default2.output.md.json | 2 +-
test/fixture/es6-import.output.md | 6 +-
test/fixture/es6-import.output.md.json | 6 +-
test/fixture/es6.output.md | 40 ++++++-------
test/fixture/es6.output.md.json | 40 ++++++-------
test/fixture/event.output.md | 2 +-
test/fixture/event.output.md.json | 2 +-
test/fixture/example-caption.output.md | 2 +-
test/fixture/example-caption.output.md.json | 2 +-
test/fixture/external.output.md | 2 +-
test/fixture/external.output.md.json | 2 +-
test/fixture/factory.output.md | 6 +-
test/fixture/factory.output.md.json | 6 +-
test/fixture/infer-private.output.md | 4 +-
test/fixture/infer-private.output.md.json | 4 +-
test/fixture/inheritance.output.md | 4 +-
test/fixture/inheritance.output.md.json | 4 +-
test/fixture/inline-link.output.md | 4 +-
test/fixture/inline-link.output.md.json | 4 +-
test/fixture/internal.output.md | 2 +-
test/fixture/internal.output.md.json | 2 +-
test/fixture/literal_types.output.md | 4 +-
test/fixture/literal_types.output.md.json | 4 +-
test/fixture/memberedclass.output.md | 6 +-
test/fixture/memberedclass.output.md.json | 6 +-
test/fixture/merge-infered-type.output.md | 2 +-
.../fixture/merge-infered-type.output.md.json | 2 +-
test/fixture/multisignature.output.md | 4 +-
test/fixture/multisignature.output.md.json | 4 +-
test/fixture/nearby_params.output.md | 2 +-
test/fixture/nearby_params.output.md.json | 2 +-
test/fixture/nest_params.output.md | 4 +-
test/fixture/nest_params.output.md.json | 4 +-
test/fixture/newline-in-description.output.md | 2 +-
.../newline-in-description.output.md.json | 2 +-
test/fixture/no-name.output.md | 2 +-
test/fixture/no-name.output.md.json | 2 +-
.../optional-record-field-type.output.md | 2 +-
.../optional-record-field-type.output.md.json | 2 +-
test/fixture/params.output.md | 18 +++---
test/fixture/params.output.md.json | 18 +++---
test/fixture/react-jsx.output.md | 2 +-
test/fixture/react-jsx.output.md.json | 2 +-
test/fixture/simple-hashbang.output.md | 2 +-
test/fixture/simple-hashbang.output.md.json | 2 +-
test/fixture/simple-two.output.md | 2 +-
test/fixture/simple-two.output.md.json | 2 +-
test/fixture/simple.output.github.md | 2 +-
test/fixture/simple.output.md | 2 +-
test/fixture/simple.output.md.json | 2 +-
test/fixture/sort-order-alpha.output.md | 24 ++++----
test/fixture/sort-order-alpha.output.md.json | 24 ++++----
test/fixture/string-literal-key.output.md | 4 +-
.../fixture/string-literal-key.output.md.json | 4 +-
test/fixture/sync/alias.output.md | 2 +-
test/fixture/sync/alias.output.md.json | 2 +-
test/fixture/sync/empty-example.output.md | 2 +-
.../fixture/sync/empty-example.output.md.json | 2 +-
test/fixture/sync/flow-types.output.md | 20 +++----
test/fixture/sync/flow-types.output.md.json | 20 +++----
test/fixture/sync/lots-of-options.output.md | 2 +-
.../sync/lots-of-options.output.md.json | 2 +-
test/fixture/sync/meta.output.md | 2 +-
test/fixture/sync/meta.output.md.json | 2 +-
test/fixture/sync/multiexample.output.md | 2 +-
test/fixture/sync/multiexample.output.md.json | 2 +-
test/fixture/sync/rename.output.md | 2 +-
test/fixture/sync/rename.output.md.json | 2 +-
test/fixture/sync/throws.output.md | 2 +-
test/fixture/sync/throws.output.md.json | 2 +-
test/fixture/sync/trailing-only.output.md | 2 +-
.../fixture/sync/trailing-only.output.md.json | 2 +-
test/fixture/sync/trailing.output.md | 6 +-
test/fixture/sync/trailing.output.md.json | 6 +-
test/fixture/sync/typedef.output.md | 2 +-
test/fixture/sync/typedef.output.md.json | 2 +-
test/fixture/system-import.output.md | 2 +-
test/fixture/system-import.output.md.json | 2 +-
test/fixture/this-class.output.md | 10 ++--
test/fixture/this-class.output.md.json | 10 ++--
test/fixture/type_application.output.md | 2 +-
test/fixture/type_application.output.md.json | 2 +-
.../var-function-param-return.output.md | 2 +-
.../var-function-param-return.output.md.json | 2 +-
test/test.js | 7 ++-
103 files changed, 319 insertions(+), 314 deletions(-)
diff --git a/docs/NODE_API.md b/docs/NODE_API.md
index 88edce60b..96110e806 100644
--- a/docs/NODE_API.md
+++ b/docs/NODE_API.md
@@ -1,6 +1,6 @@
-# build
+## build
Generate JavaScript documentation as a list of parsed JSDoc
comments, given a root file as a path.
@@ -54,7 +54,7 @@ documentation.build(['index.js'], {
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback
-# buildSync
+## buildSync
Generate JavaScript documentation given a list of inputs. This internal
method does not support require-following and it returns its results
@@ -100,7 +100,7 @@ var results = documentation.buildSync(['index.js']);
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** list of results
-# lint
+## lint
Lint files for non-standard or incorrect documentation
information, returning a potentially-empty string
@@ -145,14 +145,14 @@ documentation.lint('file.js', {}, function (err, lintOutput) {
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback
-# formats
+## formats
Documentation's formats are modular methods that take comments
and options as input and call a callback with writable objects,
like stringified JSON, markdown strings, or Vinyl objects for HTML
output.
-# formats.html
+## formats.html
Formats documentation as HTML.
@@ -179,7 +179,7 @@ documentation.build(['index.js'], {}, function (err, res) {
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** Calls callback.
-# formats.markdown
+## formats.markdown
Formats documentation as
[Markdown](http://daringfireball.net/projects/markdown/).
@@ -206,7 +206,7 @@ documentation.build(['index.js'], {}, function (err, res) {
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback
-# formats.json
+## formats.json
Formats documentation as a JSON string.
diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js
index 76d0df055..10c202387 100644
--- a/lib/output/markdown_ast.js
+++ b/lib/output/markdown_ast.js
@@ -204,7 +204,7 @@ function commentsToAST(comments, options, callback) {
return callback(null, rerouteLinks(linkerStack.link,
u('root', generatorComment.concat(comments.reduce(function (memo, comment) {
- return memo.concat(generate(1, comment));
+ return memo.concat(generate(2, comment));
}, [])))));
}
diff --git a/package.json b/package.json
index ff4de303f..fe8c2d412 100644
--- a/package.json
+++ b/package.json
@@ -85,7 +85,7 @@
},
"scripts": {
"lint": "eslint bin lib index.js test",
- "doc": "documentation build index.js -f md --access=public > docs/NODE_API.md",
+ "doc": "./bin/documentation.js build index.js -f md --access=public > docs/NODE_API.md",
"changelog": "standard-changelog -i CHANGELOG.md -w",
"self-lint": "node ./bin/documentation.js lint",
"test": "npm run lint && npm run self-lint && tap -t 120 --coverage --nyc-arg=--cache test/*.js test/lib test/streams"
diff --git a/test/fixture/auto_lang_hljs/multilanguage.output.md b/test/fixture/auto_lang_hljs/multilanguage.output.md
index 45c2dd157..e648388cc 100644
--- a/test/fixture/auto_lang_hljs/multilanguage.output.md
+++ b/test/fixture/auto_lang_hljs/multilanguage.output.md
@@ -1,6 +1,6 @@
-# multilanguage.input
+## multilanguage.input
**Extends Foo, Bar**
diff --git a/test/fixture/boolean-literal-type.output.md b/test/fixture/boolean-literal-type.output.md
index a3dbe313e..08591845f 100644
--- a/test/fixture/boolean-literal-type.output.md
+++ b/test/fixture/boolean-literal-type.output.md
@@ -1,6 +1,6 @@
-# f
+## f
**Parameters**
diff --git a/test/fixture/boolean-literal-type.output.md.json b/test/fixture/boolean-literal-type.output.md.json
index 81739d92b..c6e85d7d4 100644
--- a/test/fixture/boolean-literal-type.output.md.json
+++ b/test/fixture/boolean-literal-type.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/class.config.output.md b/test/fixture/class.config.output.md
index 3f23e0ba3..5f0f252c7 100644
--- a/test/fixture/class.config.output.md
+++ b/test/fixture/class.config.output.md
@@ -1,6 +1,6 @@
-# MyClass
+## MyClass
This is my class, a demo thing.
@@ -8,7 +8,7 @@ This is my class, a demo thing.
- `howMany` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains
-## getFoo
+### getFoo
Get the number 42
@@ -18,12 +18,12 @@ Get the number 42
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two
-## getUndefined
+### getUndefined
Get undefined
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything.
-# Hello
+## Hello
World
diff --git a/test/fixture/class.output.md b/test/fixture/class.output.md
index 371b57287..df8a9e126 100644
--- a/test/fixture/class.output.md
+++ b/test/fixture/class.output.md
@@ -1,6 +1,6 @@
-# MyClass
+## MyClass
This is my class, a demo thing.
@@ -8,7 +8,7 @@ This is my class, a demo thing.
- `howMany` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains
-## getFoo
+### getFoo
Get the number 42
@@ -18,7 +18,7 @@ Get the number 42
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two
-## getUndefined
+### getUndefined
Get undefined
diff --git a/test/fixture/class.output.md.json b/test/fixture/class.output.md.json
index 1e7d5837a..4292255b6 100644
--- a/test/fixture/class.output.md.json
+++ b/test/fixture/class.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -139,7 +139,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -336,7 +336,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
diff --git a/test/fixture/document-exported-export-default-object.output.md b/test/fixture/document-exported-export-default-object.output.md
index 4162bb1aa..fa48d7363 100644
--- a/test/fixture/document-exported-export-default-object.output.md
+++ b/test/fixture/document-exported-export-default-object.output.md
@@ -1,5 +1,5 @@
-# document-exported-export-default-object.input
+## document-exported-export-default-object.input
-# x
+## x
diff --git a/test/fixture/document-exported-export-default-object.output.md.json b/test/fixture/document-exported-export-default-object.output.md.json
index c1f4ca589..c79cb8e64 100644
--- a/test/fixture/document-exported-export-default-object.output.md.json
+++ b/test/fixture/document-exported-export-default-object.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -16,7 +16,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/document-exported-export-default-value.output.md b/test/fixture/document-exported-export-default-value.output.md
index bf6fea702..e0d96cfbd 100644
--- a/test/fixture/document-exported-export-default-value.output.md
+++ b/test/fixture/document-exported-export-default-value.output.md
@@ -1,3 +1,3 @@
-# document-exported-export-default-value.input
+## document-exported-export-default-value.input
diff --git a/test/fixture/document-exported-export-default-value.output.md.json b/test/fixture/document-exported-export-default-value.output.md.json
index 22f2087f3..686f080df 100644
--- a/test/fixture/document-exported-export-default-value.output.md.json
+++ b/test/fixture/document-exported-export-default-value.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/document-exported.output.md b/test/fixture/document-exported.output.md
index e6743fe0c..5c032f9d1 100644
--- a/test/fixture/document-exported.output.md
+++ b/test/fixture/document-exported.output.md
@@ -1,44 +1,44 @@
-# z
+## z
-## zMethod
+### zMethod
-# x
+## x
**Parameters**
- `yparam`
-# Class
+## Class
-## classMethod
+### classMethod
-## classGetter
+### classGetter
-## classSetter
+### classSetter
**Parameters**
- `v`
-## staticMethod
+### staticMethod
-## staticGetter
+### staticGetter
-## staticSetter
+### staticSetter
**Parameters**
- `v`
-# T5
+## T5
Type: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
-# y2Default
+## y2Default
-# y4
+## y4
Description of y3
@@ -48,49 +48,49 @@ Description of y3
Returns **void**
-# object
+## object
-## prop
+### prop
-## func
+### func
-# method
+## method
-# getter
+## getter
-# setter
+## setter
**Parameters**
- `v`
-# f1
+## f1
-# f3
+## f3
-# T
+## T
Type: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
-# T2
+## T2
Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
-# T4
+## T4
Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
-# f4
+## f4
**Parameters**
- `x` **X**
-# o1
+## o1
-# om1
+## om1
-# f5
+## f5
f5 comment
@@ -98,6 +98,6 @@ f5 comment
- `y` **Y**
-# o2
+## o2
-# om2
+## om2
diff --git a/test/fixture/document-exported.output.md.json b/test/fixture/document-exported.output.md.json
index 4ccd7a6af..ad889a0a2 100644
--- a/test/fixture/document-exported.output.md.json
+++ b/test/fixture/document-exported.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -16,7 +16,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -26,7 +26,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -73,7 +73,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -83,7 +83,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -93,7 +93,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -103,7 +103,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -150,7 +150,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -160,7 +160,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -170,7 +170,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -217,7 +217,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -247,7 +247,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -257,7 +257,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -377,7 +377,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -387,7 +387,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -397,7 +397,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -407,7 +407,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -417,7 +417,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -427,7 +427,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -474,7 +474,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -484,7 +484,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -494,7 +494,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -524,7 +524,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -554,7 +554,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -584,7 +584,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -640,7 +640,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -650,7 +650,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -660,7 +660,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -751,7 +751,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -761,7 +761,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/es6-class.output.md b/test/fixture/es6-class.output.md
index 43266e7ba..720845afc 100644
--- a/test/fixture/es6-class.output.md
+++ b/test/fixture/es6-class.output.md
@@ -1,16 +1,16 @@
-# Foo
+## Foo
**Extends React.Component**
This is my component. This is from issue #458
-# Bar
+## Bar
Does nothing. This is from issue #556
-## constructor
+### constructor
Creates a new instance
@@ -18,6 +18,6 @@ Creates a new instance
- `str` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
-## bar
+### bar
A useless property
diff --git a/test/fixture/es6-class.output.md.json b/test/fixture/es6-class.output.md.json
index b05fc7990..be9e2c03f 100644
--- a/test/fixture/es6-class.output.md.json
+++ b/test/fixture/es6-class.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -69,7 +69,7 @@
}
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -114,7 +114,7 @@
}
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -212,7 +212,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
diff --git a/test/fixture/es6-default2.output.md b/test/fixture/es6-default2.output.md
index 946f20dba..45a08c991 100644
--- a/test/fixture/es6-default2.output.md
+++ b/test/fixture/es6-default2.output.md
@@ -1,6 +1,6 @@
-# es6-default2.input
+## es6-default2.input
**Parameters**
diff --git a/test/fixture/es6-default2.output.md.json b/test/fixture/es6-default2.output.md.json
index 764e3731a..3e6561ebd 100644
--- a/test/fixture/es6-default2.output.md.json
+++ b/test/fixture/es6-default2.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/es6-import.output.md b/test/fixture/es6-import.output.md
index bea585d89..1fd7d3985 100644
--- a/test/fixture/es6-import.output.md
+++ b/test/fixture/es6-import.output.md
@@ -1,6 +1,6 @@
-# multiplyTwice
+## multiplyTwice
This function returns the number one.
@@ -10,11 +10,11 @@ This function returns the number one.
Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
-# es6-ext
+## es6-ext
This is the default export frogs!
-# simple.input
+## simple.input
This function returns the number one.
diff --git a/test/fixture/es6-import.output.md.json b/test/fixture/es6-import.output.md.json
index eded2cef2..a07e50523 100644
--- a/test/fixture/es6-import.output.md.json
+++ b/test/fixture/es6-import.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -152,7 +152,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -197,7 +197,7 @@
}
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md
index 815570663..6a3d7ffa7 100644
--- a/test/fixture/es6.output.md
+++ b/test/fixture/es6.output.md
@@ -1,6 +1,6 @@
-# destructure
+## destructure
This function destructures with defaults. It should not
have any parameter descriptions.
@@ -12,7 +12,7 @@ have any parameter descriptions.
- `$0.emailAddresses` (optional, default `[]`)
- `$0.params` **...any**
-# destructure
+## destructure
Similar, but with an array
@@ -29,7 +29,7 @@ Similar, but with an array
destructure([1, 2, 3])
```
-# multiply
+## multiply
This function returns the number one.
@@ -40,48 +40,48 @@ This function returns the number one.
Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
-# Sink
+## Sink
This is a sink
-## staticProp
+### staticProp
This is a property of the sink.
-## empty
+### empty
Is it empty
-## aGetter
+### aGetter
This is a getter method: it should be documented
as a property.
-## constructor
+### constructor
**Parameters**
- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing
- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing
-## hello
+### hello
This method says hello
-# makeABasket
+## makeABasket
This method returns a basket. The type should not be linked.
Returns **Basket** a basket
-# makeASink
+## makeASink
This method returns a [sink](#sink). The type should be linked.
It takes a [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) which should also be linked.
Returns **[Sink](#sink)** a sink
-# functionWithRest
+## functionWithRest
This function takes rest params
@@ -89,7 +89,7 @@ This function takes rest params
- `someParams` **...any**
-# functionWithRestAndType
+## functionWithRestAndType
So does this one, with types
@@ -97,17 +97,17 @@ So does this one, with types
- `someParams` **...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-# foo
+## foo
This is an async method
-# es6.input
+## es6.input
This function returns the number one.
Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
-# veryImportantTransform
+## veryImportantTransform
This tests our support of optional parameters in ES6
@@ -115,19 +115,19 @@ This tests our support of optional parameters in ES6
- `foo` (optional, default `'bar'`)
-# iAmProtected
+## iAmProtected
A protected function
-# iAmPublic
+## iAmPublic
A public function
-# execute
+## execute
This is re-exported
-# isArrayEqualWith
+## isArrayEqualWith
Regression check for #498
diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json
index 512fd2610..0d8b336a2 100644
--- a/test/fixture/es6.output.md.json
+++ b/test/fixture/es6.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -244,7 +244,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -428,7 +428,7 @@
"value": "destructure([1, 2, 3])"
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -666,7 +666,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -711,7 +711,7 @@
}
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -756,7 +756,7 @@
}
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -801,7 +801,7 @@
}
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -850,7 +850,7 @@
}
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -1021,7 +1021,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -1066,7 +1066,7 @@
}
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1168,7 +1168,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1365,7 +1365,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1460,7 +1460,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1562,7 +1562,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1607,7 +1607,7 @@
}
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1716,7 +1716,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1815,7 +1815,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1860,7 +1860,7 @@
}
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1905,7 +1905,7 @@
}
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1950,7 +1950,7 @@
}
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/event.output.md b/test/fixture/event.output.md
index 7ef8b9ff9..60a2dcf3f 100644
--- a/test/fixture/event.output.md
+++ b/test/fixture/event.output.md
@@ -1,6 +1,6 @@
-# Map#mousemove
+## Map#mousemove
Mouse event
diff --git a/test/fixture/event.output.md.json b/test/fixture/event.output.md.json
index f4902ed49..4d7dc7416 100644
--- a/test/fixture/event.output.md.json
+++ b/test/fixture/event.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/example-caption.output.md b/test/fixture/example-caption.output.md
index ca436eccd..0bf5853b2 100644
--- a/test/fixture/example-caption.output.md
+++ b/test/fixture/example-caption.output.md
@@ -1,6 +1,6 @@
-# foo
+## foo
This function returns the number one.
diff --git a/test/fixture/example-caption.output.md.json b/test/fixture/example-caption.output.md.json
index 454136a7e..fa77489fc 100644
--- a/test/fixture/example-caption.output.md.json
+++ b/test/fixture/example-caption.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/external.output.md b/test/fixture/external.output.md
index 44bc64403..c0b4a06ef 100644
--- a/test/fixture/external.output.md
+++ b/test/fixture/external.output.md
@@ -1,5 +1,5 @@
-# foo
+## foo
I am in `external.input.js`.
diff --git a/test/fixture/external.output.md.json b/test/fixture/external.output.md.json
index f7b9d2962..fcd4812e8 100644
--- a/test/fixture/external.output.md.json
+++ b/test/fixture/external.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/factory.output.md b/test/fixture/factory.output.md
index 8447aea0e..5986399ca 100644
--- a/test/fixture/factory.output.md
+++ b/test/fixture/factory.output.md
@@ -1,18 +1,18 @@
-# area
+## area
an area chart generator
Returns **[area](#area)** chart
-# area
+## area
**Parameters**
- `selection`
-# data
+## data
Sets the chart data.
diff --git a/test/fixture/factory.output.md.json b/test/fixture/factory.output.md.json
index f0927c235..a4ac3c232 100644
--- a/test/fixture/factory.output.md.json
+++ b/test/fixture/factory.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -115,7 +115,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -162,7 +162,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/infer-private.output.md b/test/fixture/infer-private.output.md
index 7437d067b..463f6165f 100644
--- a/test/fixture/infer-private.output.md
+++ b/test/fixture/infer-private.output.md
@@ -1,9 +1,9 @@
-# C
+## C
C description
-## m
+### m
m description
diff --git a/test/fixture/infer-private.output.md.json b/test/fixture/infer-private.output.md.json
index 61222fd70..38cfecf2a 100644
--- a/test/fixture/infer-private.output.md.json
+++ b/test/fixture/infer-private.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -51,7 +51,7 @@
}
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
diff --git a/test/fixture/inheritance.output.md b/test/fixture/inheritance.output.md
index ced286130..80af4fa7e 100644
--- a/test/fixture/inheritance.output.md
+++ b/test/fixture/inheritance.output.md
@@ -1,11 +1,11 @@
-# SpecialArray
+## SpecialArray
**Extends Array**
With ES6, built-in types are extensible!
-# Foo
+## Foo
**Extends Bar**
diff --git a/test/fixture/inheritance.output.md.json b/test/fixture/inheritance.output.md.json
index 14563e2e8..944577a5f 100644
--- a/test/fixture/inheritance.output.md.json
+++ b/test/fixture/inheritance.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -69,7 +69,7 @@
}
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/inline-link.output.md b/test/fixture/inline-link.output.md
index 0e6f105f1..ca214404b 100644
--- a/test/fixture/inline-link.output.md
+++ b/test/fixture/inline-link.output.md
@@ -1,6 +1,6 @@
-# addOne
+## addOne
Adds one to a number
@@ -10,7 +10,7 @@ Adds one to a number
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the output
-# inline-link.input
+## inline-link.input
This function returns the number one. Internally, this uses
[addOne](#addone) to do the math. This demonstrates
diff --git a/test/fixture/inline-link.output.md.json b/test/fixture/inline-link.output.md.json
index 22cf26b50..4d2f11ca5 100644
--- a/test/fixture/inline-link.output.md.json
+++ b/test/fixture/inline-link.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -203,7 +203,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/internal.output.md b/test/fixture/internal.output.md
index 44bc64403..c0b4a06ef 100644
--- a/test/fixture/internal.output.md
+++ b/test/fixture/internal.output.md
@@ -1,5 +1,5 @@
-# foo
+## foo
I am in `external.input.js`.
diff --git a/test/fixture/internal.output.md.json b/test/fixture/internal.output.md.json
index f7b9d2962..fcd4812e8 100644
--- a/test/fixture/internal.output.md.json
+++ b/test/fixture/internal.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/literal_types.output.md b/test/fixture/literal_types.output.md
index 74753d495..335decc09 100644
--- a/test/fixture/literal_types.output.md
+++ b/test/fixture/literal_types.output.md
@@ -1,12 +1,12 @@
-# f
+## f
**Parameters**
- `x` **(`"a"` \| `"b"` \| `""` \| `0` \| `-42` \| `3.14`)**
-# g
+## g
**Parameters**
diff --git a/test/fixture/literal_types.output.md.json b/test/fixture/literal_types.output.md.json
index 73c1d7f7d..623c139b3 100644
--- a/test/fixture/literal_types.output.md.json
+++ b/test/fixture/literal_types.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -110,7 +110,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/memberedclass.output.md b/test/fixture/memberedclass.output.md
index 9eb73392d..b52e48e44 100644
--- a/test/fixture/memberedclass.output.md
+++ b/test/fixture/memberedclass.output.md
@@ -1,10 +1,10 @@
-# MyClass
+## MyClass
This is my class, a demo thing.
-## getFoo
+### getFoo
Get the number 42
@@ -14,7 +14,7 @@ Get the number 42
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two
-## getUndefined
+### getUndefined
Get undefined
diff --git a/test/fixture/memberedclass.output.md.json b/test/fixture/memberedclass.output.md.json
index 418fc5ab1..6f4748b88 100644
--- a/test/fixture/memberedclass.output.md.json
+++ b/test/fixture/memberedclass.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -51,7 +51,7 @@
}
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -248,7 +248,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
diff --git a/test/fixture/merge-infered-type.output.md b/test/fixture/merge-infered-type.output.md
index c64aef0e9..15973c29c 100644
--- a/test/fixture/merge-infered-type.output.md
+++ b/test/fixture/merge-infered-type.output.md
@@ -1,6 +1,6 @@
-# addFive
+## addFive
Add five to `x`.
diff --git a/test/fixture/merge-infered-type.output.md.json b/test/fixture/merge-infered-type.output.md.json
index 45d45042d..ae3c81fa8 100644
--- a/test/fixture/merge-infered-type.output.md.json
+++ b/test/fixture/merge-infered-type.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/multisignature.output.md b/test/fixture/multisignature.output.md
index 35fdd1d86..d476577a1 100644
--- a/test/fixture/multisignature.output.md
+++ b/test/fixture/multisignature.output.md
@@ -1,6 +1,6 @@
-# getTheTime
+## getTheTime
Get the time
@@ -10,7 +10,7 @@ Get the time
Returns **[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** the current date
-# getTheTime
+## getTheTime
Set the time
diff --git a/test/fixture/multisignature.output.md.json b/test/fixture/multisignature.output.md.json
index d3b1f7b4d..a6c7ccbc2 100644
--- a/test/fixture/multisignature.output.md.json
+++ b/test/fixture/multisignature.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -152,7 +152,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/nearby_params.output.md b/test/fixture/nearby_params.output.md
index 46a8965a8..ef7144c86 100644
--- a/test/fixture/nearby_params.output.md
+++ b/test/fixture/nearby_params.output.md
@@ -1,6 +1,6 @@
-# sessions.create
+## sessions.create
Attempt to establish a cookie-based session in exchange for credentials.
diff --git a/test/fixture/nearby_params.output.md.json b/test/fixture/nearby_params.output.md.json
index 42df8b139..72fa32537 100644
--- a/test/fixture/nearby_params.output.md.json
+++ b/test/fixture/nearby_params.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/nest_params.output.md b/test/fixture/nest_params.output.md
index e0e27edc6..b282e6f7a 100644
--- a/test/fixture/nest_params.output.md
+++ b/test/fixture/nest_params.output.md
@@ -1,6 +1,6 @@
-# foo
+## foo
**Parameters**
@@ -9,7 +9,7 @@
- `employees[].department` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The employee's department.
- `type` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The employee's type. (optional, default `minion`)
-# foo
+## foo
**Parameters**
diff --git a/test/fixture/nest_params.output.md.json b/test/fixture/nest_params.output.md.json
index 43901c6ce..56ea626be 100644
--- a/test/fixture/nest_params.output.md.json
+++ b/test/fixture/nest_params.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -369,7 +369,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/newline-in-description.output.md b/test/fixture/newline-in-description.output.md
index 21fab0d89..ca0ae75f9 100644
--- a/test/fixture/newline-in-description.output.md
+++ b/test/fixture/newline-in-description.output.md
@@ -1,6 +1,6 @@
-#
+##
A function.
diff --git a/test/fixture/newline-in-description.output.md.json b/test/fixture/newline-in-description.output.md.json
index 4489a6504..8d79efda6 100644
--- a/test/fixture/newline-in-description.output.md.json
+++ b/test/fixture/newline-in-description.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/no-name.output.md b/test/fixture/no-name.output.md
index b210b1461..e6cda5c60 100644
--- a/test/fixture/no-name.output.md
+++ b/test/fixture/no-name.output.md
@@ -1,6 +1,6 @@
-#
+##
Set the time
diff --git a/test/fixture/no-name.output.md.json b/test/fixture/no-name.output.md.json
index 7bd427cde..fb1772a02 100644
--- a/test/fixture/no-name.output.md.json
+++ b/test/fixture/no-name.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/optional-record-field-type.output.md b/test/fixture/optional-record-field-type.output.md
index 706f9df9c..295779b18 100644
--- a/test/fixture/optional-record-field-type.output.md
+++ b/test/fixture/optional-record-field-type.output.md
@@ -1,6 +1,6 @@
-# Record
+## Record
Type: {opt: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?, req: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)}
diff --git a/test/fixture/optional-record-field-type.output.md.json b/test/fixture/optional-record-field-type.output.md.json
index c224bf65d..bb20925b8 100644
--- a/test/fixture/optional-record-field-type.output.md.json
+++ b/test/fixture/optional-record-field-type.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/params.output.md b/test/fixture/params.output.md
index 384ca453c..b3e8c8e95 100644
--- a/test/fixture/params.output.md
+++ b/test/fixture/params.output.md
@@ -1,6 +1,6 @@
-# addThem
+## addThem
This function returns the number one.
@@ -14,7 +14,7 @@ This function returns the number one.
- `$3.e`
- `$3.f`
-# fishesAndFoxes
+## fishesAndFoxes
This method has partially inferred params
@@ -24,7 +24,7 @@ This method has partially inferred params
- `$0.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish
- `$0.foxes`
-# withDefault
+## withDefault
This method has a type in the description and a default in the code
@@ -32,11 +32,11 @@ This method has a type in the description and a default in the code
- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?= 2**
-# Foo
+## Foo
This is foo's documentation
-## method
+### method
The method
@@ -44,7 +44,7 @@ The method
- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Param to method
-# Address6
+## Address6
Represents an IPv6 address
@@ -63,7 +63,7 @@ This tests our support of optional parameters
var address = new Address6('2001::/32');
```
-# GeoJSONSource
+## GeoJSONSource
Create a GeoJSON data source instance given an options object
@@ -78,7 +78,7 @@ This tests our support of nested parameters
- `options.buffer` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Tile buffer on each side.
- `options.tolerance` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Simplification tolerance (higher means simpler).
-# myfunc
+## myfunc
This tests our support for parameters with explicit types but with default
values specified in code.
@@ -89,7 +89,7 @@ values specified in code.
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** some
-# foo
+## foo
This tests our support of JSDoc param tags without type information,
or any type information we could infer from annotations.
diff --git a/test/fixture/params.output.md.json b/test/fixture/params.output.md.json
index be4bc42a4..1e135e54a 100644
--- a/test/fixture/params.output.md.json
+++ b/test/fixture/params.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -293,7 +293,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -492,7 +492,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -598,7 +598,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -643,7 +643,7 @@
}
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -776,7 +776,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1223,7 +1223,7 @@
"value": "var address = new Address6('2001::/32');"
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1749,7 +1749,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1958,7 +1958,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/react-jsx.output.md b/test/fixture/react-jsx.output.md
index f93d2550d..4f10678a2 100644
--- a/test/fixture/react-jsx.output.md
+++ b/test/fixture/react-jsx.output.md
@@ -1,5 +1,5 @@
-# apples
+## apples
apples
diff --git a/test/fixture/react-jsx.output.md.json b/test/fixture/react-jsx.output.md.json
index 826fc6201..7ebe87a39 100644
--- a/test/fixture/react-jsx.output.md.json
+++ b/test/fixture/react-jsx.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/simple-hashbang.output.md b/test/fixture/simple-hashbang.output.md
index a13e7f4a3..d4aab1e9e 100644
--- a/test/fixture/simple-hashbang.output.md
+++ b/test/fixture/simple-hashbang.output.md
@@ -1,6 +1,6 @@
-# simple-hashbang.input
+## simple-hashbang.input
This function returns the number one.
diff --git a/test/fixture/simple-hashbang.output.md.json b/test/fixture/simple-hashbang.output.md.json
index ff6b6f17f..eea85db79 100644
--- a/test/fixture/simple-hashbang.output.md.json
+++ b/test/fixture/simple-hashbang.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/simple-two.output.md b/test/fixture/simple-two.output.md
index c19dd2ab7..c37103e4b 100644
--- a/test/fixture/simple-two.output.md
+++ b/test/fixture/simple-two.output.md
@@ -1,6 +1,6 @@
-# returnTwo
+## returnTwo
This function returns the number plus two.
diff --git a/test/fixture/simple-two.output.md.json b/test/fixture/simple-two.output.md.json
index 63e64f430..87999cf26 100644
--- a/test/fixture/simple-two.output.md.json
+++ b/test/fixture/simple-two.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/simple.output.github.md b/test/fixture/simple.output.github.md
index 69a6336a1..43aadcbc9 100644
--- a/test/fixture/simple.output.github.md
+++ b/test/fixture/simple.output.github.md
@@ -1,6 +1,6 @@
-# simple.input
+## simple.input
[test/fixture/simple.input.js:5-8]([github] "Source code on GitHub")
diff --git a/test/fixture/simple.output.md b/test/fixture/simple.output.md
index 55ce13e20..f428519d0 100644
--- a/test/fixture/simple.output.md
+++ b/test/fixture/simple.output.md
@@ -1,6 +1,6 @@
-# simple.input
+## simple.input
This function returns the number one.
diff --git a/test/fixture/simple.output.md.json b/test/fixture/simple.output.md.json
index 6f30c7d2d..6ef343f9a 100644
--- a/test/fixture/simple.output.md.json
+++ b/test/fixture/simple.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sort-order-alpha.output.md b/test/fixture/sort-order-alpha.output.md
index 52350ab59..79a56a960 100644
--- a/test/fixture/sort-order-alpha.output.md
+++ b/test/fixture/sort-order-alpha.output.md
@@ -1,25 +1,25 @@
-# a
+## a
-# b
+## b
-# C
+## C
-## A
+### A
-## a
+### a
-## B
+### B
-## b
+### b
-# D
+## D
-## A
+### A
-## a
+### a
-## B
+### B
-## b
+### b
diff --git a/test/fixture/sort-order-alpha.output.md.json b/test/fixture/sort-order-alpha.output.md.json
index fe0781da4..68823dd25 100644
--- a/test/fixture/sort-order-alpha.output.md.json
+++ b/test/fixture/sort-order-alpha.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -16,7 +16,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -26,7 +26,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -36,7 +36,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -46,7 +46,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -56,7 +56,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -66,7 +66,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -76,7 +76,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -86,7 +86,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -96,7 +96,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -106,7 +106,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -116,7 +116,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
diff --git a/test/fixture/string-literal-key.output.md b/test/fixture/string-literal-key.output.md
index cbd81f9fb..ca0924384 100644
--- a/test/fixture/string-literal-key.output.md
+++ b/test/fixture/string-literal-key.output.md
@@ -1,7 +1,7 @@
-# MyContainerObject
+## MyContainerObject
-# foo
+## foo
The foo property
diff --git a/test/fixture/string-literal-key.output.md.json b/test/fixture/string-literal-key.output.md.json
index 17d559b4b..c0bd30afe 100644
--- a/test/fixture/string-literal-key.output.md.json
+++ b/test/fixture/string-literal-key.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -16,7 +16,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/alias.output.md b/test/fixture/sync/alias.output.md
index 1aabd86f5..e4be23d9b 100644
--- a/test/fixture/sync/alias.output.md
+++ b/test/fixture/sync/alias.output.md
@@ -1,6 +1,6 @@
-# nixon
+## nixon
This is a method that has an alias tag: so it should
be referred to as nixon, but should still have inference.
diff --git a/test/fixture/sync/alias.output.md.json b/test/fixture/sync/alias.output.md.json
index 1e92a953d..e66cb90d7 100644
--- a/test/fixture/sync/alias.output.md.json
+++ b/test/fixture/sync/alias.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/empty-example.output.md b/test/fixture/sync/empty-example.output.md
index de994437e..59418f38f 100644
--- a/test/fixture/sync/empty-example.output.md
+++ b/test/fixture/sync/empty-example.output.md
@@ -1,5 +1,5 @@
-# returnTwo
+## returnTwo
This function returns the number plus two.
diff --git a/test/fixture/sync/empty-example.output.md.json b/test/fixture/sync/empty-example.output.md.json
index 6cb4a8eb6..f83249dbf 100644
--- a/test/fixture/sync/empty-example.output.md.json
+++ b/test/fixture/sync/empty-example.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/flow-types.output.md b/test/fixture/sync/flow-types.output.md
index 14d68bd2b..470e0e501 100644
--- a/test/fixture/sync/flow-types.output.md
+++ b/test/fixture/sync/flow-types.output.md
@@ -1,6 +1,6 @@
-# addThem
+## addThem
This function returns the number one.
@@ -15,7 +15,7 @@ This function returns the number one.
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-# Point
+## Point
A 2D point.
@@ -31,7 +31,7 @@ Type: {x: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
- `props.radius` **{x: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}**
- `props.radius.x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
-# Two
+## Two
A type with entirely derived properties
@@ -43,19 +43,19 @@ Type: {x: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
- `y` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
- `z` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?**
-# T
+## T
Just an alias for an array of strings
Type: [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>
-# T
+## T
My type
Type: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
-# veryImportantTransform
+## veryImportantTransform
Very Important Transform
@@ -66,7 +66,7 @@ Very Important Transform
Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
-# optionalFunc
+## optionalFunc
Function with optional parameter.
@@ -74,7 +74,7 @@ Function with optional parameter.
- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** (optional, default `42`)
-# objectParamFn
+## objectParamFn
Function with object parameter.
@@ -82,7 +82,7 @@ Function with object parameter.
- `x` **{a: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}**
-# objectParamFn
+## objectParamFn
hi
@@ -90,7 +90,7 @@ hi
- `x` **function (y: Foo): Bar**
-# SomeObjectAPI
+## SomeObjectAPI
Define my object API
diff --git a/test/fixture/sync/flow-types.output.md.json b/test/fixture/sync/flow-types.output.md.json
index 283ad8ae5..ab82f46ce 100644
--- a/test/fixture/sync/flow-types.output.md.json
+++ b/test/fixture/sync/flow-types.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -339,7 +339,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -891,7 +891,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1143,7 +1143,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1227,7 +1227,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1292,7 +1292,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1497,7 +1497,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1616,7 +1616,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1726,7 +1726,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -1837,7 +1837,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/lots-of-options.output.md b/test/fixture/sync/lots-of-options.output.md
index 55321bdcb..014f72bda 100644
--- a/test/fixture/sync/lots-of-options.output.md
+++ b/test/fixture/sync/lots-of-options.output.md
@@ -1,6 +1,6 @@
-# gsd
+## gsd
Global spectra deconvolution
diff --git a/test/fixture/sync/lots-of-options.output.md.json b/test/fixture/sync/lots-of-options.output.md.json
index 0be407f12..3548d2ca9 100644
--- a/test/fixture/sync/lots-of-options.output.md.json
+++ b/test/fixture/sync/lots-of-options.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/meta.output.md b/test/fixture/sync/meta.output.md
index 97c676fbf..1845faf0f 100644
--- a/test/fixture/sync/meta.output.md
+++ b/test/fixture/sync/meta.output.md
@@ -1,6 +1,6 @@
-# dewey
+## dewey
This function has a lot of metadata
diff --git a/test/fixture/sync/meta.output.md.json b/test/fixture/sync/meta.output.md.json
index d2fb3424a..c7ce42220 100644
--- a/test/fixture/sync/meta.output.md.json
+++ b/test/fixture/sync/meta.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/multiexample.output.md b/test/fixture/sync/multiexample.output.md
index 9090b94d4..caff6189a 100644
--- a/test/fixture/sync/multiexample.output.md
+++ b/test/fixture/sync/multiexample.output.md
@@ -1,6 +1,6 @@
-# multiexample.input
+## multiexample.input
**Extends Foo, Bar**
diff --git a/test/fixture/sync/multiexample.output.md.json b/test/fixture/sync/multiexample.output.md.json
index b08c2dc91..eed8b0606 100644
--- a/test/fixture/sync/multiexample.output.md.json
+++ b/test/fixture/sync/multiexample.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/rename.output.md b/test/fixture/sync/rename.output.md
index 87c9ed441..2da5756bf 100644
--- a/test/fixture/sync/rename.output.md
+++ b/test/fixture/sync/rename.output.md
@@ -1,5 +1,5 @@
-# cheese
+## cheese
Cheesoid!
diff --git a/test/fixture/sync/rename.output.md.json b/test/fixture/sync/rename.output.md.json
index bec4f3a8d..b43c1b194 100644
--- a/test/fixture/sync/rename.output.md.json
+++ b/test/fixture/sync/rename.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/throws.output.md b/test/fixture/sync/throws.output.md
index fda184f61..18a960f06 100644
--- a/test/fixture/sync/throws.output.md
+++ b/test/fixture/sync/throws.output.md
@@ -1,6 +1,6 @@
-# returnTwo
+## returnTwo
This function returns the number plus two.
diff --git a/test/fixture/sync/throws.output.md.json b/test/fixture/sync/throws.output.md.json
index a89bee28b..bd52a315a 100644
--- a/test/fixture/sync/throws.output.md.json
+++ b/test/fixture/sync/throws.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/trailing-only.output.md b/test/fixture/sync/trailing-only.output.md
index 1997477f4..a464834b2 100644
--- a/test/fixture/sync/trailing-only.output.md
+++ b/test/fixture/sync/trailing-only.output.md
@@ -1,6 +1,6 @@
-#
+##
this is a type
diff --git a/test/fixture/sync/trailing-only.output.md.json b/test/fixture/sync/trailing-only.output.md.json
index ba50618be..7dc0f561f 100644
--- a/test/fixture/sync/trailing-only.output.md.json
+++ b/test/fixture/sync/trailing-only.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/trailing.output.md b/test/fixture/sync/trailing.output.md
index fbd87c100..33d39203b 100644
--- a/test/fixture/sync/trailing.output.md
+++ b/test/fixture/sync/trailing.output.md
@@ -1,17 +1,17 @@
-# fooBar
+## fooBar
ONE
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** something
-# fooBaz
+## fooBaz
TWO
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** something
-# Something
+## Something
this is a type
diff --git a/test/fixture/sync/trailing.output.md.json b/test/fixture/sync/trailing.output.md.json
index 4858cb671..655ed545a 100644
--- a/test/fixture/sync/trailing.output.md.json
+++ b/test/fixture/sync/trailing.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -115,7 +115,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -224,7 +224,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/sync/typedef.output.md b/test/fixture/sync/typedef.output.md
index 35d1486f9..90a5d5c5d 100644
--- a/test/fixture/sync/typedef.output.md
+++ b/test/fixture/sync/typedef.output.md
@@ -1,6 +1,6 @@
-# MyType
+## MyType
A type definition.
diff --git a/test/fixture/sync/typedef.output.md.json b/test/fixture/sync/typedef.output.md.json
index 46571272d..8fc8da623 100644
--- a/test/fixture/sync/typedef.output.md.json
+++ b/test/fixture/sync/typedef.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/system-import.output.md b/test/fixture/system-import.output.md
index 55ce13e20..f428519d0 100644
--- a/test/fixture/system-import.output.md
+++ b/test/fixture/system-import.output.md
@@ -1,6 +1,6 @@
-# simple.input
+## simple.input
This function returns the number one.
diff --git a/test/fixture/system-import.output.md.json b/test/fixture/system-import.output.md.json
index 6f30c7d2d..6ef343f9a 100644
--- a/test/fixture/system-import.output.md.json
+++ b/test/fixture/system-import.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/this-class.output.md b/test/fixture/this-class.output.md
index 58972fd9b..68e637245 100644
--- a/test/fixture/this-class.output.md
+++ b/test/fixture/this-class.output.md
@@ -1,27 +1,27 @@
-# bookshelf
+## bookshelf
**Parameters**
- `title`
-# Book
+## Book
**Parameters**
- `title`
-## title
+### title
The title of the book.
-# BookShelf
+## BookShelf
**Parameters**
- `title`
-## title
+### title
The title of the bookshelf.
diff --git a/test/fixture/this-class.output.md.json b/test/fixture/this-class.output.md.json
index 0af859a69..e7b15ff40 100644
--- a/test/fixture/this-class.output.md.json
+++ b/test/fixture/this-class.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -53,7 +53,7 @@
]
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -100,7 +100,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
@@ -145,7 +145,7 @@
}
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
@@ -192,7 +192,7 @@
]
},
{
- "depth": 2,
+ "depth": 3,
"type": "heading",
"children": [
{
diff --git a/test/fixture/type_application.output.md b/test/fixture/type_application.output.md
index d0a37c275..b2568c017 100644
--- a/test/fixture/type_application.output.md
+++ b/test/fixture/type_application.output.md
@@ -1,6 +1,6 @@
-# Address6
+## Address6
Represents an IPv6 address
diff --git a/test/fixture/type_application.output.md.json b/test/fixture/type_application.output.md.json
index 278ea5479..a77cd28e9 100644
--- a/test/fixture/type_application.output.md.json
+++ b/test/fixture/type_application.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/fixture/var-function-param-return.output.md b/test/fixture/var-function-param-return.output.md
index dc2fd69e0..bfbf02a26 100644
--- a/test/fixture/var-function-param-return.output.md
+++ b/test/fixture/var-function-param-return.output.md
@@ -1,6 +1,6 @@
-# f
+## f
**Parameters**
diff --git a/test/fixture/var-function-param-return.output.md.json b/test/fixture/var-function-param-return.output.md.json
index ac9fb9874..cc30bcd50 100644
--- a/test/fixture/var-function-param-return.output.md.json
+++ b/test/fixture/var-function-param-return.output.md.json
@@ -6,7 +6,7 @@
"value": ""
},
{
- "depth": 1,
+ "depth": 2,
"type": "heading",
"children": [
{
diff --git a/test/test.js b/test/test.js
index 74412f9bb..a31667f81 100644
--- a/test/test.js
+++ b/test/test.js
@@ -252,7 +252,7 @@ test('highlightAuto md output', function (t) {
test('config', function (t) {
var file = path.join(__dirname, 'fixture', 'class.input.js');
- var result = fs.readFileSync(path.join(__dirname, 'fixture', 'class.config.output.md')).toString();
+ var outputfile = path.join(__dirname, 'fixture', 'class.config.output.md');
documentation.build([file], {
config: path.join(__dirname, 'fixture', 'simple.config.yml')
}, function (err, out) {
@@ -260,6 +260,11 @@ test('config', function (t) {
outputMarkdown(out, {}, function (err, md) {
t.ifError(err);
+ if (UPDATE) {
+ fs.writeFileSync(outputfile, md);
+ }
+ var result = fs.readFileSync(outputfile, 'utf8');
+
t.equal(md, result, 'rendered markdown is equal');
t.end();
});
From 4c66fb14c7b62e8142a1ed8a8337764a3599949a Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Wed, 28 Dec 2016 21:12:33 -0500
Subject: [PATCH 023/583] feat(markdown): Add table of contents support for
Markdown mode (#645)
Adds a new option, `--no-markdown-toc`, to turn off Table of Contents generation. Table of contents are now generated by default with markdown output, including through the `readme` command.
Fixes https://github.com/documentationjs/documentation/issues/220
---
docs/NODE_API.md | 10 +
lib/commands/build.js | 6 +
lib/commands/readme.js | 5 +-
lib/output/markdown.js | 5 +-
lib/output/markdown_ast.js | 28 +-
.../auto_lang_hljs/multilanguage.output.md | 4 +
test/fixture/boolean-literal-type.output.md | 4 +
.../boolean-literal-type.output.md.json | 58 +-
test/fixture/class.config.output.md | 7 +
test/fixture/class.output.md | 6 +
test/fixture/class.output.md.json | 130 ++-
...t-exported-export-default-object.output.md | 5 +
...orted-export-default-object.output.md.json | 91 +-
...nt-exported-export-default-value.output.md | 4 +
...ported-export-default-value.output.md.json | 58 +-
test/fixture/document-exported.output.md | 33 +
test/fixture/document-exported.output.md.json | 1033 ++++++++++++++++-
test/fixture/es6-class.output.md | 7 +
test/fixture/es6-class.output.md.json | 163 ++-
test/fixture/es6-default2.output.md | 4 +
test/fixture/es6-default2.output.md.json | 58 +-
test/fixture/es6-import.output.md | 6 +
test/fixture/es6-import.output.md.json | 124 +-
test/fixture/es6.output-toc.md | 140 +++
test/fixture/es6.output.md | 23 +
test/fixture/es6.output.md.json | 691 ++++++++++-
test/fixture/event.output.md | 4 +
test/fixture/event.output.md.json | 58 +-
test/fixture/example-caption.output.md | 4 +
test/fixture/example-caption.output.md.json | 58 +-
test/fixture/external.output.md | 4 +
test/fixture/external.output.md.json | 58 +-
test/fixture/factory.output.md | 6 +
test/fixture/factory.output.md.json | 124 +-
test/fixture/infer-private.output.md | 5 +
test/fixture/infer-private.output.md.json | 97 +-
test/fixture/inheritance.output.md | 5 +
test/fixture/inheritance.output.md.json | 91 +-
test/fixture/inline-link.output.md | 5 +
test/fixture/inline-link.output.md.json | 91 +-
test/fixture/internal.output.md | 4 +
test/fixture/internal.output.md.json | 58 +-
test/fixture/literal_types.output.md | 5 +
test/fixture/literal_types.output.md.json | 91 +-
test/fixture/memberedclass.output.md | 6 +
test/fixture/memberedclass.output.md.json | 130 ++-
test/fixture/merge-infered-type.output.md | 4 +
.../fixture/merge-infered-type.output.md.json | 58 +-
test/fixture/multisignature.output.md | 5 +
test/fixture/multisignature.output.md.json | 91 +-
test/fixture/nearby_params.output.md | 4 +
test/fixture/nearby_params.output.md.json | 58 +-
test/fixture/nest_params.output.md | 5 +
test/fixture/nest_params.output.md.json | 91 +-
test/fixture/newline-in-description.output.md | 2 +
.../newline-in-description.output.md.json | 30 +-
test/fixture/no-name.output.md | 2 +
test/fixture/no-name.output.md.json | 30 +-
.../optional-record-field-type.output.md | 4 +
.../optional-record-field-type.output.md.json | 58 +-
test/fixture/params.output.md | 12 +
test/fixture/params.output.md.json | 328 +++++-
test/fixture/react-jsx.output.md | 4 +
test/fixture/react-jsx.output.md.json | 58 +-
test/fixture/readme/README.output.md | 5 +
.../require-json-no-extension.output.md | 2 +
.../require-json-no-extension.output.md.json | 19 +
test/fixture/require-json.output.md | 2 +
test/fixture/require-json.output.md.json | 19 +
test/fixture/simple-hashbang.output.md | 4 +
test/fixture/simple-hashbang.output.md.json | 58 +-
test/fixture/simple-private.output.md | 2 +
test/fixture/simple-private.output.md.json | 19 +
test/fixture/simple-singlestar.output.md | 2 +
test/fixture/simple-singlestar.output.md.json | 19 +
test/fixture/simple-triplestar.output.md | 2 +
test/fixture/simple-triplestar.output.md.json | 19 +
test/fixture/simple-two.output.md | 4 +
test/fixture/simple-two.output.md.json | 58 +-
test/fixture/simple.output.github.md | 4 +
test/fixture/simple.output.md | 4 +
test/fixture/simple.output.md.json | 58 +-
test/fixture/sort-order-alpha.output.md | 15 +
test/fixture/sort-order-alpha.output.md.json | 433 ++++++-
test/fixture/string-literal-key.output.md | 5 +
.../fixture/string-literal-key.output.md.json | 91 +-
test/fixture/sync/alias.output.md | 4 +
test/fixture/sync/alias.output.md.json | 58 +-
test/fixture/sync/empty-example.output.md | 4 +
.../fixture/sync/empty-example.output.md.json | 58 +-
test/fixture/sync/flow-types.output.md | 13 +
test/fixture/sync/flow-types.output.md.json | 355 +++++-
test/fixture/sync/lots-of-options.output.md | 4 +
.../sync/lots-of-options.output.md.json | 58 +-
test/fixture/sync/meta.output.md | 4 +
test/fixture/sync/meta.output.md.json | 58 +-
test/fixture/sync/multiexample.output.md | 4 +
test/fixture/sync/multiexample.output.md.json | 58 +-
test/fixture/sync/rename.output.md | 4 +
test/fixture/sync/rename.output.md.json | 58 +-
test/fixture/sync/throws.output.md | 4 +
test/fixture/sync/throws.output.md.json | 58 +-
test/fixture/sync/trailing-only.output.md | 2 +
.../fixture/sync/trailing-only.output.md.json | 30 +-
test/fixture/sync/trailing.output.md | 6 +
test/fixture/sync/trailing.output.md.json | 124 +-
test/fixture/sync/typedef.output.md | 4 +
test/fixture/sync/typedef.output.md.json | 58 +-
test/fixture/system-import.output.md | 4 +
test/fixture/system-import.output.md.json | 58 +-
test/fixture/this-class.output.md | 8 +
test/fixture/this-class.output.md.json | 202 +++-
test/fixture/type_application.output.md | 4 +
test/fixture/type_application.output.md.json | 58 +-
.../var-function-param-return.output.md | 4 +
.../var-function-param-return.output.md.json | 58 +-
test/test.js | 15 +
117 files changed, 6571 insertions(+), 161 deletions(-)
create mode 100644 test/fixture/es6.output-toc.md
diff --git a/docs/NODE_API.md b/docs/NODE_API.md
index 96110e806..e509a838c 100644
--- a/docs/NODE_API.md
+++ b/docs/NODE_API.md
@@ -1,5 +1,15 @@
+### Table of Contents
+
+- [build](#build)
+- [buildSync](#buildsync)
+- [lint](#lint)
+- [formats](#formats)
+- [formats.html](#formatshtml)
+- [formats.markdown](#formatsmarkdown)
+- [formats.json](#formatsjson)
+
## build
Generate JavaScript documentation as a list of parsed JSDoc
diff --git a/lib/commands/build.js b/lib/commands/build.js
index 4fd6fe74c..c7757a4b3 100644
--- a/lib/commands/build.js
+++ b/lib/commands/build.js
@@ -26,6 +26,11 @@ module.exports.builder = extend({},
default: 'json',
choices: ['json', 'md', 'remark', 'html']
},
+ 'no-markdown-toc': {
+ describe: 'include a table of contents in markdown output',
+ default: 'stdout',
+ type: 'boolean'
+ },
output: {
describe: 'output location. omit for stdout, otherwise is a filename ' +
'for single-file outputs and a directory name for multi-file outputs like html',
@@ -66,6 +71,7 @@ module.exports.handler = function build(argv, callback) {
version: argv['project-version'] || (argv.package || {}).version,
theme: argv.theme,
paths: argv.paths,
+ 'no-markdown-toc': argv['no-markdown-toc'],
hljs: argv.hljs || {}
};
diff --git a/lib/commands/readme.js b/lib/commands/readme.js
index 32bd80326..7c4986709 100644
--- a/lib/commands/readme.js
+++ b/lib/commands/readme.js
@@ -42,6 +42,8 @@ module.exports.builder = {
example: 'documentation readme index.js -s "API Docs" --github'
};
+function noop() {}
+
/**
* Insert API documentation into a Markdown readme
* @private
@@ -53,8 +55,7 @@ module.exports.handler = function readme(argv) {
argv = sharedOptions.expandInputs(argv);
argv.format = 'remark';
/* eslint no-console: 0 */
- var log = argv.q ? function () {}
- : console.log.bind(console, '[documentation-readme] ');
+ var log = argv.q ? noop : console.log.bind(console, '[documentation-readme] ');
var readmeFile = argv['readme-file'];
build.handler(argv, onAst);
diff --git a/lib/output/markdown.js b/lib/output/markdown.js
index cf890296a..b2b29bf10 100644
--- a/lib/output/markdown.js
+++ b/lib/output/markdown.js
@@ -1,7 +1,6 @@
'use strict';
var remark = require('remark'),
- toc = require('remark-toc'),
markdownAST = require('./markdown_ast');
/**
@@ -26,9 +25,7 @@ var remark = require('remark'),
* });
*/
module.exports = function (comments, options, callback) {
- var processor = remark().use(toc);
markdownAST(comments, options, function (err, ast) {
- var processedAST = processor.run(ast);
- return callback(null, processor.stringify(processedAST));
+ return callback(null, remark().stringify(ast));
});
};
diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js
index 10c202387..2b37c80a0 100644
--- a/lib/output/markdown_ast.js
+++ b/lib/output/markdown_ast.js
@@ -1,4 +1,6 @@
var u = require('unist-builder'),
+ remark = require('remark'),
+ toc = require('remark-toc'),
hljs = require('highlight.js'),
GithubSlugger = require('github-slugger'),
createLinkerStack = require('./util/linker_stack'),
@@ -14,7 +16,7 @@ var u = require('unist-builder'),
* @param {Function} callback called with AST
* @returns {undefined} calls callback
*/
-function commentsToAST(comments, options, callback) {
+function markdownAST(comments, options, callback) {
// Configure code highlighting
var hljsOptions = (options || {}).hljs || {},
@@ -33,6 +35,10 @@ function commentsToAST(comments, options, callback) {
u('html', '')
];
+ var tableOfContentsHeading = [
+ u('heading', { depth: 3 }, [u('text', 'Table of Contents')])
+ ];
+
/**
* Generate an AST chunk for a comment at a given depth: this is
* split from the main function to handle hierarchially nested comments
@@ -202,10 +208,20 @@ function commentsToAST(comments, options, callback) {
.filter(Boolean);
}
- return callback(null, rerouteLinks(linkerStack.link,
- u('root', generatorComment.concat(comments.reduce(function (memo, comment) {
- return memo.concat(generate(2, comment));
- }, [])))));
+ var root = rerouteLinks(linkerStack.link,
+ u('root', generatorComment
+ .concat(options['no-markdown-toc'] ? [] : tableOfContentsHeading)
+ .concat(comments.reduce(function (memo, comment) {
+ return memo.concat(generate(2, comment));
+ }, []))));
+
+ if (!options['no-markdown-toc']) {
+ return remark().use(toc, {
+ tight: true
+ }).run(root, callback);
+ }
+
+ return callback(null, root);
}
-module.exports = commentsToAST;
+module.exports = markdownAST;
diff --git a/test/fixture/auto_lang_hljs/multilanguage.output.md b/test/fixture/auto_lang_hljs/multilanguage.output.md
index e648388cc..c7c1fe56c 100644
--- a/test/fixture/auto_lang_hljs/multilanguage.output.md
+++ b/test/fixture/auto_lang_hljs/multilanguage.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [multilanguage.input](#multilanguageinput)
+
## multilanguage.input
**Extends Foo, Bar**
diff --git a/test/fixture/boolean-literal-type.output.md b/test/fixture/boolean-literal-type.output.md
index 08591845f..da400ec81 100644
--- a/test/fixture/boolean-literal-type.output.md
+++ b/test/fixture/boolean-literal-type.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [f](#f)
+
## f
**Parameters**
diff --git a/test/fixture/boolean-literal-type.output.md.json b/test/fixture/boolean-literal-type.output.md.json
index c6e85d7d4..c59ae7bb8 100644
--- a/test/fixture/boolean-literal-type.output.md.json
+++ b/test/fixture/boolean-literal-type.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#f",
+ "children": [
+ {
+ "type": "text",
+ "value": "f"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "f"
}
- ]
+ ],
+ "data": {
+ "id": "f",
+ "htmlAttributes": {
+ "id": "f"
+ },
+ "hProperties": {
+ "id": "f"
+ }
+ }
},
{
"type": "strong",
diff --git a/test/fixture/class.config.output.md b/test/fixture/class.config.output.md
index 5f0f252c7..ed2aaa9e1 100644
--- a/test/fixture/class.config.output.md
+++ b/test/fixture/class.config.output.md
@@ -1,5 +1,12 @@
+### Table of Contents
+
+- [MyClass](#myclass)
+ - [getFoo](#getfoo)
+ - [getUndefined](#getundefined)
+- [Hello](#hello)
+
## MyClass
This is my class, a demo thing.
diff --git a/test/fixture/class.output.md b/test/fixture/class.output.md
index df8a9e126..0c88fe44d 100644
--- a/test/fixture/class.output.md
+++ b/test/fixture/class.output.md
@@ -1,5 +1,11 @@
+### Table of Contents
+
+- [MyClass](#myclass)
+ - [getFoo](#getfoo)
+ - [getUndefined](#getundefined)
+
## MyClass
This is my class, a demo thing.
diff --git a/test/fixture/class.output.md.json b/test/fixture/class.output.md.json
index 4292255b6..8efdb7a4f 100644
--- a/test/fixture/class.output.md.json
+++ b/test/fixture/class.output.md.json
@@ -5,6 +5,103 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#myclass",
+ "children": [
+ {
+ "type": "text",
+ "value": "MyClass"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#getfoo",
+ "children": [
+ {
+ "type": "text",
+ "value": "getFoo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#getundefined",
+ "children": [
+ {
+ "type": "text",
+ "value": "getUndefined"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +110,16 @@
"type": "text",
"value": "MyClass"
}
- ]
+ ],
+ "data": {
+ "id": "myclass",
+ "htmlAttributes": {
+ "id": "myclass"
+ },
+ "hProperties": {
+ "id": "myclass"
+ }
+ }
},
{
"type": "paragraph",
@@ -146,7 +252,16 @@
"type": "text",
"value": "getFoo"
}
- ]
+ ],
+ "data": {
+ "id": "getfoo",
+ "htmlAttributes": {
+ "id": "getfoo"
+ },
+ "hProperties": {
+ "id": "getfoo"
+ }
+ }
},
{
"type": "paragraph",
@@ -343,7 +458,16 @@
"type": "text",
"value": "getUndefined"
}
- ]
+ ],
+ "data": {
+ "id": "getundefined",
+ "htmlAttributes": {
+ "id": "getundefined"
+ },
+ "hProperties": {
+ "id": "getundefined"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/document-exported-export-default-object.output.md b/test/fixture/document-exported-export-default-object.output.md
index fa48d7363..b2ffbf9a7 100644
--- a/test/fixture/document-exported-export-default-object.output.md
+++ b/test/fixture/document-exported-export-default-object.output.md
@@ -1,5 +1,10 @@
+### Table of Contents
+
+- [document-exported-export-default-object.input](#document-exported-export-default-objectinput)
+- [x](#x)
+
## document-exported-export-default-object.input
## x
diff --git a/test/fixture/document-exported-export-default-object.output.md.json b/test/fixture/document-exported-export-default-object.output.md.json
index c79cb8e64..1bb59256b 100644
--- a/test/fixture/document-exported-export-default-object.output.md.json
+++ b/test/fixture/document-exported-export-default-object.output.md.json
@@ -5,6 +5,75 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#document-exported-export-default-objectinput",
+ "children": [
+ {
+ "type": "text",
+ "value": "document-exported-export-default-object.input"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#x",
+ "children": [
+ {
+ "type": "text",
+ "value": "x"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +82,16 @@
"type": "text",
"value": "document-exported-export-default-object.input"
}
- ]
+ ],
+ "data": {
+ "id": "document-exported-export-default-objectinput",
+ "htmlAttributes": {
+ "id": "document-exported-export-default-objectinput"
+ },
+ "hProperties": {
+ "id": "document-exported-export-default-objectinput"
+ }
+ }
},
{
"depth": 2,
@@ -23,7 +101,16 @@
"type": "text",
"value": "x"
}
- ]
+ ],
+ "data": {
+ "id": "x",
+ "htmlAttributes": {
+ "id": "x"
+ },
+ "hProperties": {
+ "id": "x"
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/document-exported-export-default-value.output.md b/test/fixture/document-exported-export-default-value.output.md
index e0d96cfbd..f003118a1 100644
--- a/test/fixture/document-exported-export-default-value.output.md
+++ b/test/fixture/document-exported-export-default-value.output.md
@@ -1,3 +1,7 @@
+### Table of Contents
+
+- [document-exported-export-default-value.input](#document-exported-export-default-valueinput)
+
## document-exported-export-default-value.input
diff --git a/test/fixture/document-exported-export-default-value.output.md.json b/test/fixture/document-exported-export-default-value.output.md.json
index 686f080df..fb2e8877e 100644
--- a/test/fixture/document-exported-export-default-value.output.md.json
+++ b/test/fixture/document-exported-export-default-value.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#document-exported-export-default-valueinput",
+ "children": [
+ {
+ "type": "text",
+ "value": "document-exported-export-default-value.input"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "document-exported-export-default-value.input"
}
- ]
+ ],
+ "data": {
+ "id": "document-exported-export-default-valueinput",
+ "htmlAttributes": {
+ "id": "document-exported-export-default-valueinput"
+ },
+ "hProperties": {
+ "id": "document-exported-export-default-valueinput"
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/document-exported.output.md b/test/fixture/document-exported.output.md
index 5c032f9d1..c87825624 100644
--- a/test/fixture/document-exported.output.md
+++ b/test/fixture/document-exported.output.md
@@ -1,5 +1,38 @@
+### Table of Contents
+
+- [z](#z)
+ - [zMethod](#zmethod)
+- [x](#x)
+- [Class](#class)
+ - [classMethod](#classmethod)
+ - [classGetter](#classgetter)
+ - [classSetter](#classsetter)
+ - [staticMethod](#staticmethod)
+ - [staticGetter](#staticgetter)
+ - [staticSetter](#staticsetter)
+- [T5](#t5)
+- [y2Default](#y2default)
+- [y4](#y4)
+- [object](#object)
+ - [prop](#prop)
+ - [func](#func)
+- [method](#method)
+- [getter](#getter)
+- [setter](#setter)
+- [f1](#f1)
+- [f3](#f3)
+- [T](#t)
+- [T2](#t2)
+- [T4](#t4)
+- [f4](#f4)
+- [o1](#o1)
+- [om1](#om1)
+- [f5](#f5)
+- [o2](#o2)
+- [om2](#om2)
+
## z
### zMethod
diff --git a/test/fixture/document-exported.output.md.json b/test/fixture/document-exported.output.md.json
index ad889a0a2..7a602f739 100644
--- a/test/fixture/document-exported.output.md.json
+++ b/test/fixture/document-exported.output.md.json
@@ -5,6 +5,709 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#z",
+ "children": [
+ {
+ "type": "text",
+ "value": "z"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#zmethod",
+ "children": [
+ {
+ "type": "text",
+ "value": "zMethod"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#x",
+ "children": [
+ {
+ "type": "text",
+ "value": "x"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#class",
+ "children": [
+ {
+ "type": "text",
+ "value": "Class"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#classmethod",
+ "children": [
+ {
+ "type": "text",
+ "value": "classMethod"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#classgetter",
+ "children": [
+ {
+ "type": "text",
+ "value": "classGetter"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#classsetter",
+ "children": [
+ {
+ "type": "text",
+ "value": "classSetter"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#staticmethod",
+ "children": [
+ {
+ "type": "text",
+ "value": "staticMethod"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#staticgetter",
+ "children": [
+ {
+ "type": "text",
+ "value": "staticGetter"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#staticsetter",
+ "children": [
+ {
+ "type": "text",
+ "value": "staticSetter"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#t5",
+ "children": [
+ {
+ "type": "text",
+ "value": "T5"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#y2default",
+ "children": [
+ {
+ "type": "text",
+ "value": "y2Default"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#y4",
+ "children": [
+ {
+ "type": "text",
+ "value": "y4"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#object",
+ "children": [
+ {
+ "type": "text",
+ "value": "object"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#prop",
+ "children": [
+ {
+ "type": "text",
+ "value": "prop"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#func",
+ "children": [
+ {
+ "type": "text",
+ "value": "func"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#method",
+ "children": [
+ {
+ "type": "text",
+ "value": "method"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#getter",
+ "children": [
+ {
+ "type": "text",
+ "value": "getter"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#setter",
+ "children": [
+ {
+ "type": "text",
+ "value": "setter"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#f1",
+ "children": [
+ {
+ "type": "text",
+ "value": "f1"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#f3",
+ "children": [
+ {
+ "type": "text",
+ "value": "f3"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#t",
+ "children": [
+ {
+ "type": "text",
+ "value": "T"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#t2",
+ "children": [
+ {
+ "type": "text",
+ "value": "T2"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#t4",
+ "children": [
+ {
+ "type": "text",
+ "value": "T4"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#f4",
+ "children": [
+ {
+ "type": "text",
+ "value": "f4"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#o1",
+ "children": [
+ {
+ "type": "text",
+ "value": "o1"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#om1",
+ "children": [
+ {
+ "type": "text",
+ "value": "om1"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#f5",
+ "children": [
+ {
+ "type": "text",
+ "value": "f5"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#o2",
+ "children": [
+ {
+ "type": "text",
+ "value": "o2"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#om2",
+ "children": [
+ {
+ "type": "text",
+ "value": "om2"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +716,16 @@
"type": "text",
"value": "z"
}
- ]
+ ],
+ "data": {
+ "id": "z",
+ "htmlAttributes": {
+ "id": "z"
+ },
+ "hProperties": {
+ "id": "z"
+ }
+ }
},
{
"depth": 3,
@@ -23,7 +735,16 @@
"type": "text",
"value": "zMethod"
}
- ]
+ ],
+ "data": {
+ "id": "zmethod",
+ "htmlAttributes": {
+ "id": "zmethod"
+ },
+ "hProperties": {
+ "id": "zmethod"
+ }
+ }
},
{
"depth": 2,
@@ -33,7 +754,16 @@
"type": "text",
"value": "x"
}
- ]
+ ],
+ "data": {
+ "id": "x",
+ "htmlAttributes": {
+ "id": "x"
+ },
+ "hProperties": {
+ "id": "x"
+ }
+ }
},
{
"type": "strong",
@@ -80,7 +810,16 @@
"type": "text",
"value": "Class"
}
- ]
+ ],
+ "data": {
+ "id": "class",
+ "htmlAttributes": {
+ "id": "class"
+ },
+ "hProperties": {
+ "id": "class"
+ }
+ }
},
{
"depth": 3,
@@ -90,7 +829,16 @@
"type": "text",
"value": "classMethod"
}
- ]
+ ],
+ "data": {
+ "id": "classmethod",
+ "htmlAttributes": {
+ "id": "classmethod"
+ },
+ "hProperties": {
+ "id": "classmethod"
+ }
+ }
},
{
"depth": 3,
@@ -100,7 +848,16 @@
"type": "text",
"value": "classGetter"
}
- ]
+ ],
+ "data": {
+ "id": "classgetter",
+ "htmlAttributes": {
+ "id": "classgetter"
+ },
+ "hProperties": {
+ "id": "classgetter"
+ }
+ }
},
{
"depth": 3,
@@ -110,7 +867,16 @@
"type": "text",
"value": "classSetter"
}
- ]
+ ],
+ "data": {
+ "id": "classsetter",
+ "htmlAttributes": {
+ "id": "classsetter"
+ },
+ "hProperties": {
+ "id": "classsetter"
+ }
+ }
},
{
"type": "strong",
@@ -157,7 +923,16 @@
"type": "text",
"value": "staticMethod"
}
- ]
+ ],
+ "data": {
+ "id": "staticmethod",
+ "htmlAttributes": {
+ "id": "staticmethod"
+ },
+ "hProperties": {
+ "id": "staticmethod"
+ }
+ }
},
{
"depth": 3,
@@ -167,7 +942,16 @@
"type": "text",
"value": "staticGetter"
}
- ]
+ ],
+ "data": {
+ "id": "staticgetter",
+ "htmlAttributes": {
+ "id": "staticgetter"
+ },
+ "hProperties": {
+ "id": "staticgetter"
+ }
+ }
},
{
"depth": 3,
@@ -177,7 +961,16 @@
"type": "text",
"value": "staticSetter"
}
- ]
+ ],
+ "data": {
+ "id": "staticsetter",
+ "htmlAttributes": {
+ "id": "staticsetter"
+ },
+ "hProperties": {
+ "id": "staticsetter"
+ }
+ }
},
{
"type": "strong",
@@ -224,7 +1017,16 @@
"type": "text",
"value": "T5"
}
- ]
+ ],
+ "data": {
+ "id": "t5",
+ "htmlAttributes": {
+ "id": "t5"
+ },
+ "hProperties": {
+ "id": "t5"
+ }
+ }
},
{
"type": "paragraph",
@@ -254,7 +1056,16 @@
"type": "text",
"value": "y2Default"
}
- ]
+ ],
+ "data": {
+ "id": "y2default",
+ "htmlAttributes": {
+ "id": "y2default"
+ },
+ "hProperties": {
+ "id": "y2default"
+ }
+ }
},
{
"depth": 2,
@@ -264,7 +1075,16 @@
"type": "text",
"value": "y4"
}
- ]
+ ],
+ "data": {
+ "id": "y4",
+ "htmlAttributes": {
+ "id": "y4"
+ },
+ "hProperties": {
+ "id": "y4"
+ }
+ }
},
{
"type": "paragraph",
@@ -384,7 +1204,16 @@
"type": "text",
"value": "object"
}
- ]
+ ],
+ "data": {
+ "id": "object",
+ "htmlAttributes": {
+ "id": "object"
+ },
+ "hProperties": {
+ "id": "object"
+ }
+ }
},
{
"depth": 3,
@@ -394,7 +1223,16 @@
"type": "text",
"value": "prop"
}
- ]
+ ],
+ "data": {
+ "id": "prop",
+ "htmlAttributes": {
+ "id": "prop"
+ },
+ "hProperties": {
+ "id": "prop"
+ }
+ }
},
{
"depth": 3,
@@ -404,7 +1242,16 @@
"type": "text",
"value": "func"
}
- ]
+ ],
+ "data": {
+ "id": "func",
+ "htmlAttributes": {
+ "id": "func"
+ },
+ "hProperties": {
+ "id": "func"
+ }
+ }
},
{
"depth": 2,
@@ -414,7 +1261,16 @@
"type": "text",
"value": "method"
}
- ]
+ ],
+ "data": {
+ "id": "method",
+ "htmlAttributes": {
+ "id": "method"
+ },
+ "hProperties": {
+ "id": "method"
+ }
+ }
},
{
"depth": 2,
@@ -424,7 +1280,16 @@
"type": "text",
"value": "getter"
}
- ]
+ ],
+ "data": {
+ "id": "getter",
+ "htmlAttributes": {
+ "id": "getter"
+ },
+ "hProperties": {
+ "id": "getter"
+ }
+ }
},
{
"depth": 2,
@@ -434,7 +1299,16 @@
"type": "text",
"value": "setter"
}
- ]
+ ],
+ "data": {
+ "id": "setter",
+ "htmlAttributes": {
+ "id": "setter"
+ },
+ "hProperties": {
+ "id": "setter"
+ }
+ }
},
{
"type": "strong",
@@ -481,7 +1355,16 @@
"type": "text",
"value": "f1"
}
- ]
+ ],
+ "data": {
+ "id": "f1",
+ "htmlAttributes": {
+ "id": "f1"
+ },
+ "hProperties": {
+ "id": "f1"
+ }
+ }
},
{
"depth": 2,
@@ -491,7 +1374,16 @@
"type": "text",
"value": "f3"
}
- ]
+ ],
+ "data": {
+ "id": "f3",
+ "htmlAttributes": {
+ "id": "f3"
+ },
+ "hProperties": {
+ "id": "f3"
+ }
+ }
},
{
"depth": 2,
@@ -501,7 +1393,16 @@
"type": "text",
"value": "T"
}
- ]
+ ],
+ "data": {
+ "id": "t",
+ "htmlAttributes": {
+ "id": "t"
+ },
+ "hProperties": {
+ "id": "t"
+ }
+ }
},
{
"type": "paragraph",
@@ -531,7 +1432,16 @@
"type": "text",
"value": "T2"
}
- ]
+ ],
+ "data": {
+ "id": "t2",
+ "htmlAttributes": {
+ "id": "t2"
+ },
+ "hProperties": {
+ "id": "t2"
+ }
+ }
},
{
"type": "paragraph",
@@ -561,7 +1471,16 @@
"type": "text",
"value": "T4"
}
- ]
+ ],
+ "data": {
+ "id": "t4",
+ "htmlAttributes": {
+ "id": "t4"
+ },
+ "hProperties": {
+ "id": "t4"
+ }
+ }
},
{
"type": "paragraph",
@@ -591,7 +1510,16 @@
"type": "text",
"value": "f4"
}
- ]
+ ],
+ "data": {
+ "id": "f4",
+ "htmlAttributes": {
+ "id": "f4"
+ },
+ "hProperties": {
+ "id": "f4"
+ }
+ }
},
{
"type": "strong",
@@ -647,7 +1575,16 @@
"type": "text",
"value": "o1"
}
- ]
+ ],
+ "data": {
+ "id": "o1",
+ "htmlAttributes": {
+ "id": "o1"
+ },
+ "hProperties": {
+ "id": "o1"
+ }
+ }
},
{
"depth": 2,
@@ -657,7 +1594,16 @@
"type": "text",
"value": "om1"
}
- ]
+ ],
+ "data": {
+ "id": "om1",
+ "htmlAttributes": {
+ "id": "om1"
+ },
+ "hProperties": {
+ "id": "om1"
+ }
+ }
},
{
"depth": 2,
@@ -667,7 +1613,16 @@
"type": "text",
"value": "f5"
}
- ]
+ ],
+ "data": {
+ "id": "f5",
+ "htmlAttributes": {
+ "id": "f5"
+ },
+ "hProperties": {
+ "id": "f5"
+ }
+ }
},
{
"type": "paragraph",
@@ -758,7 +1713,16 @@
"type": "text",
"value": "o2"
}
- ]
+ ],
+ "data": {
+ "id": "o2",
+ "htmlAttributes": {
+ "id": "o2"
+ },
+ "hProperties": {
+ "id": "o2"
+ }
+ }
},
{
"depth": 2,
@@ -768,7 +1732,16 @@
"type": "text",
"value": "om2"
}
- ]
+ ],
+ "data": {
+ "id": "om2",
+ "htmlAttributes": {
+ "id": "om2"
+ },
+ "hProperties": {
+ "id": "om2"
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/es6-class.output.md b/test/fixture/es6-class.output.md
index 720845afc..e19e05243 100644
--- a/test/fixture/es6-class.output.md
+++ b/test/fixture/es6-class.output.md
@@ -1,5 +1,12 @@
+### Table of Contents
+
+- [Foo](#foo)
+- [Bar](#bar)
+ - [constructor](#constructor)
+ - [bar](#bar-1)
+
## Foo
**Extends React.Component**
diff --git a/test/fixture/es6-class.output.md.json b/test/fixture/es6-class.output.md.json
index be9e2c03f..30e48a47d 100644
--- a/test/fixture/es6-class.output.md.json
+++ b/test/fixture/es6-class.output.md.json
@@ -5,6 +5,125 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo",
+ "children": [
+ {
+ "type": "text",
+ "value": "Foo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#bar",
+ "children": [
+ {
+ "type": "text",
+ "value": "Bar"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#constructor",
+ "children": [
+ {
+ "type": "text",
+ "value": "constructor"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#bar-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "bar"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +132,16 @@
"type": "text",
"value": "Foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo",
+ "htmlAttributes": {
+ "id": "foo"
+ },
+ "hProperties": {
+ "id": "foo"
+ }
+ }
},
{
"type": "paragraph",
@@ -76,7 +204,16 @@
"type": "text",
"value": "Bar"
}
- ]
+ ],
+ "data": {
+ "id": "bar",
+ "htmlAttributes": {
+ "id": "bar"
+ },
+ "hProperties": {
+ "id": "bar"
+ }
+ }
},
{
"type": "paragraph",
@@ -121,7 +258,16 @@
"type": "text",
"value": "constructor"
}
- ]
+ ],
+ "data": {
+ "id": "constructor",
+ "htmlAttributes": {
+ "id": "constructor"
+ },
+ "hProperties": {
+ "id": "constructor"
+ }
+ }
},
{
"type": "paragraph",
@@ -219,7 +365,16 @@
"type": "text",
"value": "bar"
}
- ]
+ ],
+ "data": {
+ "id": "bar-1",
+ "htmlAttributes": {
+ "id": "bar-1"
+ },
+ "hProperties": {
+ "id": "bar-1"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/es6-default2.output.md b/test/fixture/es6-default2.output.md
index 45a08c991..9cb89de6e 100644
--- a/test/fixture/es6-default2.output.md
+++ b/test/fixture/es6-default2.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [es6-default2.input](#es6-default2input)
+
## es6-default2.input
**Parameters**
diff --git a/test/fixture/es6-default2.output.md.json b/test/fixture/es6-default2.output.md.json
index 3e6561ebd..5b20bb0bc 100644
--- a/test/fixture/es6-default2.output.md.json
+++ b/test/fixture/es6-default2.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#es6-default2input",
+ "children": [
+ {
+ "type": "text",
+ "value": "es6-default2.input"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "es6-default2.input"
}
- ]
+ ],
+ "data": {
+ "id": "es6-default2input",
+ "htmlAttributes": {
+ "id": "es6-default2input"
+ },
+ "hProperties": {
+ "id": "es6-default2input"
+ }
+ }
},
{
"type": "strong",
diff --git a/test/fixture/es6-import.output.md b/test/fixture/es6-import.output.md
index 1fd7d3985..9ca299da6 100644
--- a/test/fixture/es6-import.output.md
+++ b/test/fixture/es6-import.output.md
@@ -1,5 +1,11 @@
+### Table of Contents
+
+- [multiplyTwice](#multiplytwice)
+- [es6-ext](#es6-ext)
+- [simple.input](#simpleinput)
+
## multiplyTwice
This function returns the number one.
diff --git a/test/fixture/es6-import.output.md.json b/test/fixture/es6-import.output.md.json
index a07e50523..b4142afb6 100644
--- a/test/fixture/es6-import.output.md.json
+++ b/test/fixture/es6-import.output.md.json
@@ -5,6 +5,97 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#multiplytwice",
+ "children": [
+ {
+ "type": "text",
+ "value": "multiplyTwice"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#es6-ext",
+ "children": [
+ {
+ "type": "text",
+ "value": "es6-ext"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#simpleinput",
+ "children": [
+ {
+ "type": "text",
+ "value": "simple.input"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +104,16 @@
"type": "text",
"value": "multiplyTwice"
}
- ]
+ ],
+ "data": {
+ "id": "multiplytwice",
+ "htmlAttributes": {
+ "id": "multiplytwice"
+ },
+ "hProperties": {
+ "id": "multiplytwice"
+ }
+ }
},
{
"type": "paragraph",
@@ -159,7 +259,16 @@
"type": "text",
"value": "es6-ext"
}
- ]
+ ],
+ "data": {
+ "id": "es6-ext",
+ "htmlAttributes": {
+ "id": "es6-ext"
+ },
+ "hProperties": {
+ "id": "es6-ext"
+ }
+ }
},
{
"type": "paragraph",
@@ -204,7 +313,16 @@
"type": "text",
"value": "simple.input"
}
- ]
+ ],
+ "data": {
+ "id": "simpleinput",
+ "htmlAttributes": {
+ "id": "simpleinput"
+ },
+ "hProperties": {
+ "id": "simpleinput"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/es6.output-toc.md b/test/fixture/es6.output-toc.md
new file mode 100644
index 000000000..6a3d7ffa7
--- /dev/null
+++ b/test/fixture/es6.output-toc.md
@@ -0,0 +1,140 @@
+
+
+## destructure
+
+This function destructures with defaults. It should not
+have any parameter descriptions.
+
+**Parameters**
+
+- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
+ - `$0.phoneNumbers` (optional, default `[]`)
+ - `$0.emailAddresses` (optional, default `[]`)
+ - `$0.params` **...any**
+
+## destructure
+
+Similar, but with an array
+
+**Parameters**
+
+- `$0` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)**
+ - `$0.a`
+ - `$0.b`
+ - `$0.c`
+
+**Examples**
+
+```javascript
+destructure([1, 2, 3])
+```
+
+## multiply
+
+This function returns the number one.
+
+**Parameters**
+
+- `a` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of numbers
+- `b`
+
+Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
+
+## Sink
+
+This is a sink
+
+### staticProp
+
+This is a property of the sink.
+
+### empty
+
+Is it empty
+
+### aGetter
+
+This is a getter method: it should be documented
+as a property.
+
+### constructor
+
+**Parameters**
+
+- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing
+- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing
+
+### hello
+
+This method says hello
+
+## makeABasket
+
+This method returns a basket. The type should not be linked.
+
+Returns **Basket** a basket
+
+## makeASink
+
+This method returns a [sink](#sink). The type should be linked.
+It takes a [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) which should also be linked.
+
+Returns **[Sink](#sink)** a sink
+
+## functionWithRest
+
+This function takes rest params
+
+**Parameters**
+
+- `someParams` **...any**
+
+## functionWithRestAndType
+
+So does this one, with types
+
+**Parameters**
+
+- `someParams` **...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
+
+## foo
+
+This is an async method
+
+## es6.input
+
+This function returns the number one.
+
+Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
+
+## veryImportantTransform
+
+This tests our support of optional parameters in ES6
+
+**Parameters**
+
+- `foo` (optional, default `'bar'`)
+
+## iAmProtected
+
+A protected function
+
+## iAmPublic
+
+A public function
+
+## execute
+
+This is re-exported
+
+## isArrayEqualWith
+
+Regression check for #498
+
+**Parameters**
+
+- `array1` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>**
+- `array2` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>**
+- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a: T, b: T): boolean => a === b`)
+
+Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md
index 6a3d7ffa7..3aeec16ce 100644
--- a/test/fixture/es6.output.md
+++ b/test/fixture/es6.output.md
@@ -1,5 +1,28 @@
+### Table of Contents
+
+- [destructure](#destructure)
+- [destructure](#destructure-1)
+- [multiply](#multiply)
+- [Sink](#sink)
+ - [staticProp](#staticprop)
+ - [empty](#empty)
+ - [aGetter](#agetter)
+ - [constructor](#constructor)
+ - [hello](#hello)
+- [makeABasket](#makeabasket)
+- [makeASink](#makeasink)
+- [functionWithRest](#functionwithrest)
+- [functionWithRestAndType](#functionwithrestandtype)
+- [foo](#foo)
+- [es6.input](#es6input)
+- [veryImportantTransform](#veryimportanttransform)
+- [iAmProtected](#iamprotected)
+- [iAmPublic](#iampublic)
+- [execute](#execute)
+- [isArrayEqualWith](#isarrayequalwith)
+
## destructure
This function destructures with defaults. It should not
diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json
index 0d8b336a2..3a7a26f49 100644
--- a/test/fixture/es6.output.md.json
+++ b/test/fixture/es6.output.md.json
@@ -5,6 +5,477 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#destructure",
+ "children": [
+ {
+ "type": "text",
+ "value": "destructure"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#destructure-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "destructure"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#multiply",
+ "children": [
+ {
+ "type": "text",
+ "value": "multiply"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#sink",
+ "children": [
+ {
+ "type": "text",
+ "value": "Sink"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#staticprop",
+ "children": [
+ {
+ "type": "text",
+ "value": "staticProp"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#empty",
+ "children": [
+ {
+ "type": "text",
+ "value": "empty"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#agetter",
+ "children": [
+ {
+ "type": "text",
+ "value": "aGetter"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#constructor",
+ "children": [
+ {
+ "type": "text",
+ "value": "constructor"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#hello",
+ "children": [
+ {
+ "type": "text",
+ "value": "hello"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#makeabasket",
+ "children": [
+ {
+ "type": "text",
+ "value": "makeABasket"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#makeasink",
+ "children": [
+ {
+ "type": "text",
+ "value": "makeASink"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#functionwithrest",
+ "children": [
+ {
+ "type": "text",
+ "value": "functionWithRest"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#functionwithrestandtype",
+ "children": [
+ {
+ "type": "text",
+ "value": "functionWithRestAndType"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo",
+ "children": [
+ {
+ "type": "text",
+ "value": "foo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#es6input",
+ "children": [
+ {
+ "type": "text",
+ "value": "es6.input"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#veryimportanttransform",
+ "children": [
+ {
+ "type": "text",
+ "value": "veryImportantTransform"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#iamprotected",
+ "children": [
+ {
+ "type": "text",
+ "value": "iAmProtected"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#iampublic",
+ "children": [
+ {
+ "type": "text",
+ "value": "iAmPublic"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#execute",
+ "children": [
+ {
+ "type": "text",
+ "value": "execute"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#isarrayequalwith",
+ "children": [
+ {
+ "type": "text",
+ "value": "isArrayEqualWith"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +484,16 @@
"type": "text",
"value": "destructure"
}
- ]
+ ],
+ "data": {
+ "id": "destructure",
+ "htmlAttributes": {
+ "id": "destructure"
+ },
+ "hProperties": {
+ "id": "destructure"
+ }
+ }
},
{
"type": "paragraph",
@@ -251,7 +731,16 @@
"type": "text",
"value": "destructure"
}
- ]
+ ],
+ "data": {
+ "id": "destructure-1",
+ "htmlAttributes": {
+ "id": "destructure-1"
+ },
+ "hProperties": {
+ "id": "destructure-1"
+ }
+ }
},
{
"type": "paragraph",
@@ -435,7 +924,16 @@
"type": "text",
"value": "multiply"
}
- ]
+ ],
+ "data": {
+ "id": "multiply",
+ "htmlAttributes": {
+ "id": "multiply"
+ },
+ "hProperties": {
+ "id": "multiply"
+ }
+ }
},
{
"type": "paragraph",
@@ -673,7 +1171,16 @@
"type": "text",
"value": "Sink"
}
- ]
+ ],
+ "data": {
+ "id": "sink",
+ "htmlAttributes": {
+ "id": "sink"
+ },
+ "hProperties": {
+ "id": "sink"
+ }
+ }
},
{
"type": "paragraph",
@@ -718,7 +1225,16 @@
"type": "text",
"value": "staticProp"
}
- ]
+ ],
+ "data": {
+ "id": "staticprop",
+ "htmlAttributes": {
+ "id": "staticprop"
+ },
+ "hProperties": {
+ "id": "staticprop"
+ }
+ }
},
{
"type": "paragraph",
@@ -763,7 +1279,16 @@
"type": "text",
"value": "empty"
}
- ]
+ ],
+ "data": {
+ "id": "empty",
+ "htmlAttributes": {
+ "id": "empty"
+ },
+ "hProperties": {
+ "id": "empty"
+ }
+ }
},
{
"type": "paragraph",
@@ -808,7 +1333,16 @@
"type": "text",
"value": "aGetter"
}
- ]
+ ],
+ "data": {
+ "id": "agetter",
+ "htmlAttributes": {
+ "id": "agetter"
+ },
+ "hProperties": {
+ "id": "agetter"
+ }
+ }
},
{
"type": "paragraph",
@@ -857,7 +1391,16 @@
"type": "text",
"value": "constructor"
}
- ]
+ ],
+ "data": {
+ "id": "constructor",
+ "htmlAttributes": {
+ "id": "constructor"
+ },
+ "hProperties": {
+ "id": "constructor"
+ }
+ }
},
{
"type": "strong",
@@ -1028,7 +1571,16 @@
"type": "text",
"value": "hello"
}
- ]
+ ],
+ "data": {
+ "id": "hello",
+ "htmlAttributes": {
+ "id": "hello"
+ },
+ "hProperties": {
+ "id": "hello"
+ }
+ }
},
{
"type": "paragraph",
@@ -1073,7 +1625,16 @@
"type": "text",
"value": "makeABasket"
}
- ]
+ ],
+ "data": {
+ "id": "makeabasket",
+ "htmlAttributes": {
+ "id": "makeabasket"
+ },
+ "hProperties": {
+ "id": "makeabasket"
+ }
+ }
},
{
"type": "paragraph",
@@ -1175,7 +1736,16 @@
"type": "text",
"value": "makeASink"
}
- ]
+ ],
+ "data": {
+ "id": "makeasink",
+ "htmlAttributes": {
+ "id": "makeasink"
+ },
+ "hProperties": {
+ "id": "makeasink"
+ }
+ }
},
{
"type": "paragraph",
@@ -1372,7 +1942,16 @@
"type": "text",
"value": "functionWithRest"
}
- ]
+ ],
+ "data": {
+ "id": "functionwithrest",
+ "htmlAttributes": {
+ "id": "functionwithrest"
+ },
+ "hProperties": {
+ "id": "functionwithrest"
+ }
+ }
},
{
"type": "paragraph",
@@ -1467,7 +2046,16 @@
"type": "text",
"value": "functionWithRestAndType"
}
- ]
+ ],
+ "data": {
+ "id": "functionwithrestandtype",
+ "htmlAttributes": {
+ "id": "functionwithrestandtype"
+ },
+ "hProperties": {
+ "id": "functionwithrestandtype"
+ }
+ }
},
{
"type": "paragraph",
@@ -1569,7 +2157,16 @@
"type": "text",
"value": "foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo",
+ "htmlAttributes": {
+ "id": "foo"
+ },
+ "hProperties": {
+ "id": "foo"
+ }
+ }
},
{
"type": "paragraph",
@@ -1614,7 +2211,16 @@
"type": "text",
"value": "es6.input"
}
- ]
+ ],
+ "data": {
+ "id": "es6input",
+ "htmlAttributes": {
+ "id": "es6input"
+ },
+ "hProperties": {
+ "id": "es6input"
+ }
+ }
},
{
"type": "paragraph",
@@ -1723,7 +2329,16 @@
"type": "text",
"value": "veryImportantTransform"
}
- ]
+ ],
+ "data": {
+ "id": "veryimportanttransform",
+ "htmlAttributes": {
+ "id": "veryimportanttransform"
+ },
+ "hProperties": {
+ "id": "veryimportanttransform"
+ }
+ }
},
{
"type": "paragraph",
@@ -1822,7 +2437,16 @@
"type": "text",
"value": "iAmProtected"
}
- ]
+ ],
+ "data": {
+ "id": "iamprotected",
+ "htmlAttributes": {
+ "id": "iamprotected"
+ },
+ "hProperties": {
+ "id": "iamprotected"
+ }
+ }
},
{
"type": "paragraph",
@@ -1867,7 +2491,16 @@
"type": "text",
"value": "iAmPublic"
}
- ]
+ ],
+ "data": {
+ "id": "iampublic",
+ "htmlAttributes": {
+ "id": "iampublic"
+ },
+ "hProperties": {
+ "id": "iampublic"
+ }
+ }
},
{
"type": "paragraph",
@@ -1912,7 +2545,16 @@
"type": "text",
"value": "execute"
}
- ]
+ ],
+ "data": {
+ "id": "execute",
+ "htmlAttributes": {
+ "id": "execute"
+ },
+ "hProperties": {
+ "id": "execute"
+ }
+ }
},
{
"type": "paragraph",
@@ -1957,7 +2599,16 @@
"type": "text",
"value": "isArrayEqualWith"
}
- ]
+ ],
+ "data": {
+ "id": "isarrayequalwith",
+ "htmlAttributes": {
+ "id": "isarrayequalwith"
+ },
+ "hProperties": {
+ "id": "isarrayequalwith"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/event.output.md b/test/fixture/event.output.md
index 60a2dcf3f..5ce6a3127 100644
--- a/test/fixture/event.output.md
+++ b/test/fixture/event.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [Map#mousemove](#mapmousemove)
+
## Map#mousemove
Mouse event
diff --git a/test/fixture/event.output.md.json b/test/fixture/event.output.md.json
index 4d7dc7416..c64707a0c 100644
--- a/test/fixture/event.output.md.json
+++ b/test/fixture/event.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#mapmousemove",
+ "children": [
+ {
+ "type": "text",
+ "value": "Map#mousemove"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "Map#mousemove"
}
- ]
+ ],
+ "data": {
+ "id": "mapmousemove",
+ "htmlAttributes": {
+ "id": "mapmousemove"
+ },
+ "hProperties": {
+ "id": "mapmousemove"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/example-caption.output.md b/test/fixture/example-caption.output.md
index 0bf5853b2..6d7d56769 100644
--- a/test/fixture/example-caption.output.md
+++ b/test/fixture/example-caption.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [foo](#foo)
+
## foo
This function returns the number one.
diff --git a/test/fixture/example-caption.output.md.json b/test/fixture/example-caption.output.md.json
index fa77489fc..2f174b755 100644
--- a/test/fixture/example-caption.output.md.json
+++ b/test/fixture/example-caption.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo",
+ "children": [
+ {
+ "type": "text",
+ "value": "foo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo",
+ "htmlAttributes": {
+ "id": "foo"
+ },
+ "hProperties": {
+ "id": "foo"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/external.output.md b/test/fixture/external.output.md
index c0b4a06ef..d037ab42c 100644
--- a/test/fixture/external.output.md
+++ b/test/fixture/external.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [foo](#foo)
+
## foo
I am in `external.input.js`.
diff --git a/test/fixture/external.output.md.json b/test/fixture/external.output.md.json
index fcd4812e8..908a79f52 100644
--- a/test/fixture/external.output.md.json
+++ b/test/fixture/external.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo",
+ "children": [
+ {
+ "type": "text",
+ "value": "foo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo",
+ "htmlAttributes": {
+ "id": "foo"
+ },
+ "hProperties": {
+ "id": "foo"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/factory.output.md b/test/fixture/factory.output.md
index 5986399ca..b403983f3 100644
--- a/test/fixture/factory.output.md
+++ b/test/fixture/factory.output.md
@@ -1,5 +1,11 @@
+### Table of Contents
+
+- [area](#area)
+- [area](#area-1)
+- [data](#data)
+
## area
an area chart generator
diff --git a/test/fixture/factory.output.md.json b/test/fixture/factory.output.md.json
index a4ac3c232..30277976a 100644
--- a/test/fixture/factory.output.md.json
+++ b/test/fixture/factory.output.md.json
@@ -5,6 +5,97 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#area",
+ "children": [
+ {
+ "type": "text",
+ "value": "area"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#area-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "area"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#data",
+ "children": [
+ {
+ "type": "text",
+ "value": "data"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +104,16 @@
"type": "text",
"value": "area"
}
- ]
+ ],
+ "data": {
+ "id": "area",
+ "htmlAttributes": {
+ "id": "area"
+ },
+ "hProperties": {
+ "id": "area"
+ }
+ }
},
{
"type": "paragraph",
@@ -122,7 +222,16 @@
"type": "text",
"value": "area"
}
- ]
+ ],
+ "data": {
+ "id": "area-1",
+ "htmlAttributes": {
+ "id": "area-1"
+ },
+ "hProperties": {
+ "id": "area-1"
+ }
+ }
},
{
"type": "strong",
@@ -169,7 +278,16 @@
"type": "text",
"value": "data"
}
- ]
+ ],
+ "data": {
+ "id": "data",
+ "htmlAttributes": {
+ "id": "data"
+ },
+ "hProperties": {
+ "id": "data"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/infer-private.output.md b/test/fixture/infer-private.output.md
index 463f6165f..be8571cd7 100644
--- a/test/fixture/infer-private.output.md
+++ b/test/fixture/infer-private.output.md
@@ -1,5 +1,10 @@
+### Table of Contents
+
+- [C](#c)
+ - [m](#m)
+
## C
C description
diff --git a/test/fixture/infer-private.output.md.json b/test/fixture/infer-private.output.md.json
index 38cfecf2a..2ec83e5be 100644
--- a/test/fixture/infer-private.output.md.json
+++ b/test/fixture/infer-private.output.md.json
@@ -5,6 +5,81 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#c",
+ "children": [
+ {
+ "type": "text",
+ "value": "C"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#m",
+ "children": [
+ {
+ "type": "text",
+ "value": "m"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +88,16 @@
"type": "text",
"value": "C"
}
- ]
+ ],
+ "data": {
+ "id": "c",
+ "htmlAttributes": {
+ "id": "c"
+ },
+ "hProperties": {
+ "id": "c"
+ }
+ }
},
{
"type": "paragraph",
@@ -58,7 +142,16 @@
"type": "text",
"value": "m"
}
- ]
+ ],
+ "data": {
+ "id": "m",
+ "htmlAttributes": {
+ "id": "m"
+ },
+ "hProperties": {
+ "id": "m"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/inheritance.output.md b/test/fixture/inheritance.output.md
index 80af4fa7e..897dad182 100644
--- a/test/fixture/inheritance.output.md
+++ b/test/fixture/inheritance.output.md
@@ -1,5 +1,10 @@
+### Table of Contents
+
+- [SpecialArray](#specialarray)
+- [Foo](#foo)
+
## SpecialArray
**Extends Array**
diff --git a/test/fixture/inheritance.output.md.json b/test/fixture/inheritance.output.md.json
index 944577a5f..f3f66f27b 100644
--- a/test/fixture/inheritance.output.md.json
+++ b/test/fixture/inheritance.output.md.json
@@ -5,6 +5,75 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#specialarray",
+ "children": [
+ {
+ "type": "text",
+ "value": "SpecialArray"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo",
+ "children": [
+ {
+ "type": "text",
+ "value": "Foo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +82,16 @@
"type": "text",
"value": "SpecialArray"
}
- ]
+ ],
+ "data": {
+ "id": "specialarray",
+ "htmlAttributes": {
+ "id": "specialarray"
+ },
+ "hProperties": {
+ "id": "specialarray"
+ }
+ }
},
{
"type": "paragraph",
@@ -76,7 +154,16 @@
"type": "text",
"value": "Foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo",
+ "htmlAttributes": {
+ "id": "foo"
+ },
+ "hProperties": {
+ "id": "foo"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/inline-link.output.md b/test/fixture/inline-link.output.md
index ca214404b..86d415599 100644
--- a/test/fixture/inline-link.output.md
+++ b/test/fixture/inline-link.output.md
@@ -1,5 +1,10 @@
+### Table of Contents
+
+- [addOne](#addone)
+- [inline-link.input](#inline-linkinput)
+
## addOne
Adds one to a number
diff --git a/test/fixture/inline-link.output.md.json b/test/fixture/inline-link.output.md.json
index 4d2f11ca5..5556d69d7 100644
--- a/test/fixture/inline-link.output.md.json
+++ b/test/fixture/inline-link.output.md.json
@@ -5,6 +5,75 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#addone",
+ "children": [
+ {
+ "type": "text",
+ "value": "addOne"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#inline-linkinput",
+ "children": [
+ {
+ "type": "text",
+ "value": "inline-link.input"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +82,16 @@
"type": "text",
"value": "addOne"
}
- ]
+ ],
+ "data": {
+ "id": "addone",
+ "htmlAttributes": {
+ "id": "addone"
+ },
+ "hProperties": {
+ "id": "addone"
+ }
+ }
},
{
"type": "paragraph",
@@ -210,7 +288,16 @@
"type": "text",
"value": "inline-link.input"
}
- ]
+ ],
+ "data": {
+ "id": "inline-linkinput",
+ "htmlAttributes": {
+ "id": "inline-linkinput"
+ },
+ "hProperties": {
+ "id": "inline-linkinput"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/internal.output.md b/test/fixture/internal.output.md
index c0b4a06ef..d037ab42c 100644
--- a/test/fixture/internal.output.md
+++ b/test/fixture/internal.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [foo](#foo)
+
## foo
I am in `external.input.js`.
diff --git a/test/fixture/internal.output.md.json b/test/fixture/internal.output.md.json
index fcd4812e8..908a79f52 100644
--- a/test/fixture/internal.output.md.json
+++ b/test/fixture/internal.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo",
+ "children": [
+ {
+ "type": "text",
+ "value": "foo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo",
+ "htmlAttributes": {
+ "id": "foo"
+ },
+ "hProperties": {
+ "id": "foo"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/literal_types.output.md b/test/fixture/literal_types.output.md
index 335decc09..57190ea7f 100644
--- a/test/fixture/literal_types.output.md
+++ b/test/fixture/literal_types.output.md
@@ -1,5 +1,10 @@
+### Table of Contents
+
+- [f](#f)
+- [g](#g)
+
## f
**Parameters**
diff --git a/test/fixture/literal_types.output.md.json b/test/fixture/literal_types.output.md.json
index 623c139b3..5c37008f5 100644
--- a/test/fixture/literal_types.output.md.json
+++ b/test/fixture/literal_types.output.md.json
@@ -5,6 +5,75 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#f",
+ "children": [
+ {
+ "type": "text",
+ "value": "f"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#g",
+ "children": [
+ {
+ "type": "text",
+ "value": "g"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +82,16 @@
"type": "text",
"value": "f"
}
- ]
+ ],
+ "data": {
+ "id": "f",
+ "htmlAttributes": {
+ "id": "f"
+ },
+ "hProperties": {
+ "id": "f"
+ }
+ }
},
{
"type": "strong",
@@ -117,7 +195,16 @@
"type": "text",
"value": "g"
}
- ]
+ ],
+ "data": {
+ "id": "g",
+ "htmlAttributes": {
+ "id": "g"
+ },
+ "hProperties": {
+ "id": "g"
+ }
+ }
},
{
"type": "strong",
diff --git a/test/fixture/memberedclass.output.md b/test/fixture/memberedclass.output.md
index b52e48e44..1b0ad3188 100644
--- a/test/fixture/memberedclass.output.md
+++ b/test/fixture/memberedclass.output.md
@@ -1,5 +1,11 @@
+### Table of Contents
+
+- [MyClass](#myclass)
+ - [getFoo](#getfoo)
+ - [getUndefined](#getundefined)
+
## MyClass
This is my class, a demo thing.
diff --git a/test/fixture/memberedclass.output.md.json b/test/fixture/memberedclass.output.md.json
index 6f4748b88..af39eb75c 100644
--- a/test/fixture/memberedclass.output.md.json
+++ b/test/fixture/memberedclass.output.md.json
@@ -5,6 +5,103 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#myclass",
+ "children": [
+ {
+ "type": "text",
+ "value": "MyClass"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#getfoo",
+ "children": [
+ {
+ "type": "text",
+ "value": "getFoo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#getundefined",
+ "children": [
+ {
+ "type": "text",
+ "value": "getUndefined"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +110,16 @@
"type": "text",
"value": "MyClass"
}
- ]
+ ],
+ "data": {
+ "id": "myclass",
+ "htmlAttributes": {
+ "id": "myclass"
+ },
+ "hProperties": {
+ "id": "myclass"
+ }
+ }
},
{
"type": "paragraph",
@@ -58,7 +164,16 @@
"type": "text",
"value": "getFoo"
}
- ]
+ ],
+ "data": {
+ "id": "getfoo",
+ "htmlAttributes": {
+ "id": "getfoo"
+ },
+ "hProperties": {
+ "id": "getfoo"
+ }
+ }
},
{
"type": "paragraph",
@@ -255,7 +370,16 @@
"type": "text",
"value": "getUndefined"
}
- ]
+ ],
+ "data": {
+ "id": "getundefined",
+ "htmlAttributes": {
+ "id": "getundefined"
+ },
+ "hProperties": {
+ "id": "getundefined"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/merge-infered-type.output.md b/test/fixture/merge-infered-type.output.md
index 15973c29c..1a497d63a 100644
--- a/test/fixture/merge-infered-type.output.md
+++ b/test/fixture/merge-infered-type.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [addFive](#addfive)
+
## addFive
Add five to `x`.
diff --git a/test/fixture/merge-infered-type.output.md.json b/test/fixture/merge-infered-type.output.md.json
index ae3c81fa8..8915db6f7 100644
--- a/test/fixture/merge-infered-type.output.md.json
+++ b/test/fixture/merge-infered-type.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#addfive",
+ "children": [
+ {
+ "type": "text",
+ "value": "addFive"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "addFive"
}
- ]
+ ],
+ "data": {
+ "id": "addfive",
+ "htmlAttributes": {
+ "id": "addfive"
+ },
+ "hProperties": {
+ "id": "addfive"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/multisignature.output.md b/test/fixture/multisignature.output.md
index d476577a1..70cc5c797 100644
--- a/test/fixture/multisignature.output.md
+++ b/test/fixture/multisignature.output.md
@@ -1,5 +1,10 @@
+### Table of Contents
+
+- [getTheTime](#getthetime)
+- [getTheTime](#getthetime-1)
+
## getTheTime
Get the time
diff --git a/test/fixture/multisignature.output.md.json b/test/fixture/multisignature.output.md.json
index a6c7ccbc2..09f8f0f14 100644
--- a/test/fixture/multisignature.output.md.json
+++ b/test/fixture/multisignature.output.md.json
@@ -5,6 +5,75 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#getthetime",
+ "children": [
+ {
+ "type": "text",
+ "value": "getTheTime"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#getthetime-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "getTheTime"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +82,16 @@
"type": "text",
"value": "getTheTime"
}
- ]
+ ],
+ "data": {
+ "id": "getthetime",
+ "htmlAttributes": {
+ "id": "getthetime"
+ },
+ "hProperties": {
+ "id": "getthetime"
+ }
+ }
},
{
"type": "paragraph",
@@ -159,7 +237,16 @@
"type": "text",
"value": "getTheTime"
}
- ]
+ ],
+ "data": {
+ "id": "getthetime-1",
+ "htmlAttributes": {
+ "id": "getthetime-1"
+ },
+ "hProperties": {
+ "id": "getthetime-1"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/nearby_params.output.md b/test/fixture/nearby_params.output.md
index ef7144c86..2b01f3bab 100644
--- a/test/fixture/nearby_params.output.md
+++ b/test/fixture/nearby_params.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [sessions.create](#sessionscreate)
+
## sessions.create
Attempt to establish a cookie-based session in exchange for credentials.
diff --git a/test/fixture/nearby_params.output.md.json b/test/fixture/nearby_params.output.md.json
index 72fa32537..e8c53bed5 100644
--- a/test/fixture/nearby_params.output.md.json
+++ b/test/fixture/nearby_params.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#sessionscreate",
+ "children": [
+ {
+ "type": "text",
+ "value": "sessions.create"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "sessions.create"
}
- ]
+ ],
+ "data": {
+ "id": "sessionscreate",
+ "htmlAttributes": {
+ "id": "sessionscreate"
+ },
+ "hProperties": {
+ "id": "sessionscreate"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/nest_params.output.md b/test/fixture/nest_params.output.md
index b282e6f7a..d1cacd1ed 100644
--- a/test/fixture/nest_params.output.md
+++ b/test/fixture/nest_params.output.md
@@ -1,5 +1,10 @@
+### Table of Contents
+
+- [foo](#foo)
+- [foo](#foo-1)
+
## foo
**Parameters**
diff --git a/test/fixture/nest_params.output.md.json b/test/fixture/nest_params.output.md.json
index 56ea626be..58ed827d6 100644
--- a/test/fixture/nest_params.output.md.json
+++ b/test/fixture/nest_params.output.md.json
@@ -5,6 +5,75 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo",
+ "children": [
+ {
+ "type": "text",
+ "value": "foo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "foo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +82,16 @@
"type": "text",
"value": "foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo",
+ "htmlAttributes": {
+ "id": "foo"
+ },
+ "hProperties": {
+ "id": "foo"
+ }
+ }
},
{
"type": "strong",
@@ -376,7 +454,16 @@
"type": "text",
"value": "foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo-1",
+ "htmlAttributes": {
+ "id": "foo-1"
+ },
+ "hProperties": {
+ "id": "foo-1"
+ }
+ }
},
{
"type": "strong",
diff --git a/test/fixture/newline-in-description.output.md b/test/fixture/newline-in-description.output.md
index ca0ae75f9..6b7dc0a64 100644
--- a/test/fixture/newline-in-description.output.md
+++ b/test/fixture/newline-in-description.output.md
@@ -1,5 +1,7 @@
+### Table of Contents
+
##
A function.
diff --git a/test/fixture/newline-in-description.output.md.json b/test/fixture/newline-in-description.output.md.json
index 8d79efda6..bd94fd323 100644
--- a/test/fixture/newline-in-description.output.md.json
+++ b/test/fixture/newline-in-description.output.md.json
@@ -5,6 +5,25 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +32,16 @@
"type": "text",
"value": ""
}
- ]
+ ],
+ "data": {
+ "id": "",
+ "htmlAttributes": {
+ "id": ""
+ },
+ "hProperties": {
+ "id": ""
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/no-name.output.md b/test/fixture/no-name.output.md
index e6cda5c60..6bfd3fb28 100644
--- a/test/fixture/no-name.output.md
+++ b/test/fixture/no-name.output.md
@@ -1,5 +1,7 @@
+### Table of Contents
+
##
Set the time
diff --git a/test/fixture/no-name.output.md.json b/test/fixture/no-name.output.md.json
index fb1772a02..d706040de 100644
--- a/test/fixture/no-name.output.md.json
+++ b/test/fixture/no-name.output.md.json
@@ -5,6 +5,25 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +32,16 @@
"type": "text",
"value": ""
}
- ]
+ ],
+ "data": {
+ "id": "",
+ "htmlAttributes": {
+ "id": ""
+ },
+ "hProperties": {
+ "id": ""
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/optional-record-field-type.output.md b/test/fixture/optional-record-field-type.output.md
index 295779b18..b3a410e63 100644
--- a/test/fixture/optional-record-field-type.output.md
+++ b/test/fixture/optional-record-field-type.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [Record](#record)
+
## Record
Type: {opt: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?, req: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)}
diff --git a/test/fixture/optional-record-field-type.output.md.json b/test/fixture/optional-record-field-type.output.md.json
index bb20925b8..e51b7ad5c 100644
--- a/test/fixture/optional-record-field-type.output.md.json
+++ b/test/fixture/optional-record-field-type.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#record",
+ "children": [
+ {
+ "type": "text",
+ "value": "Record"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "Record"
}
- ]
+ ],
+ "data": {
+ "id": "record",
+ "htmlAttributes": {
+ "id": "record"
+ },
+ "hProperties": {
+ "id": "record"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/params.output.md b/test/fixture/params.output.md
index b3e8c8e95..eb13ec7c8 100644
--- a/test/fixture/params.output.md
+++ b/test/fixture/params.output.md
@@ -1,5 +1,17 @@
+### Table of Contents
+
+- [addThem](#addthem)
+- [fishesAndFoxes](#fishesandfoxes)
+- [withDefault](#withdefault)
+- [Foo](#foo)
+ - [method](#method)
+- [Address6](#address6)
+- [GeoJSONSource](#geojsonsource)
+- [myfunc](#myfunc)
+- [foo](#foo-1)
+
## addThem
This function returns the number one.
diff --git a/test/fixture/params.output.md.json b/test/fixture/params.output.md.json
index 1e135e54a..dd2461e77 100644
--- a/test/fixture/params.output.md.json
+++ b/test/fixture/params.output.md.json
@@ -5,6 +5,235 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#addthem",
+ "children": [
+ {
+ "type": "text",
+ "value": "addThem"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#fishesandfoxes",
+ "children": [
+ {
+ "type": "text",
+ "value": "fishesAndFoxes"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#withdefault",
+ "children": [
+ {
+ "type": "text",
+ "value": "withDefault"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo",
+ "children": [
+ {
+ "type": "text",
+ "value": "Foo"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#method",
+ "children": [
+ {
+ "type": "text",
+ "value": "method"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#address6",
+ "children": [
+ {
+ "type": "text",
+ "value": "Address6"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#geojsonsource",
+ "children": [
+ {
+ "type": "text",
+ "value": "GeoJSONSource"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#myfunc",
+ "children": [
+ {
+ "type": "text",
+ "value": "myfunc"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "foo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +242,16 @@
"type": "text",
"value": "addThem"
}
- ]
+ ],
+ "data": {
+ "id": "addthem",
+ "htmlAttributes": {
+ "id": "addthem"
+ },
+ "hProperties": {
+ "id": "addthem"
+ }
+ }
},
{
"type": "paragraph",
@@ -300,7 +538,16 @@
"type": "text",
"value": "fishesAndFoxes"
}
- ]
+ ],
+ "data": {
+ "id": "fishesandfoxes",
+ "htmlAttributes": {
+ "id": "fishesandfoxes"
+ },
+ "hProperties": {
+ "id": "fishesandfoxes"
+ }
+ }
},
{
"type": "paragraph",
@@ -499,7 +746,16 @@
"type": "text",
"value": "withDefault"
}
- ]
+ ],
+ "data": {
+ "id": "withdefault",
+ "htmlAttributes": {
+ "id": "withdefault"
+ },
+ "hProperties": {
+ "id": "withdefault"
+ }
+ }
},
{
"type": "paragraph",
@@ -605,7 +861,16 @@
"type": "text",
"value": "Foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo",
+ "htmlAttributes": {
+ "id": "foo"
+ },
+ "hProperties": {
+ "id": "foo"
+ }
+ }
},
{
"type": "paragraph",
@@ -650,7 +915,16 @@
"type": "text",
"value": "method"
}
- ]
+ ],
+ "data": {
+ "id": "method",
+ "htmlAttributes": {
+ "id": "method"
+ },
+ "hProperties": {
+ "id": "method"
+ }
+ }
},
{
"type": "paragraph",
@@ -783,7 +1057,16 @@
"type": "text",
"value": "Address6"
}
- ]
+ ],
+ "data": {
+ "id": "address6",
+ "htmlAttributes": {
+ "id": "address6"
+ },
+ "hProperties": {
+ "id": "address6"
+ }
+ }
},
{
"type": "paragraph",
@@ -1230,7 +1513,16 @@
"type": "text",
"value": "GeoJSONSource"
}
- ]
+ ],
+ "data": {
+ "id": "geojsonsource",
+ "htmlAttributes": {
+ "id": "geojsonsource"
+ },
+ "hProperties": {
+ "id": "geojsonsource"
+ }
+ }
},
{
"type": "paragraph",
@@ -1756,7 +2048,16 @@
"type": "text",
"value": "myfunc"
}
- ]
+ ],
+ "data": {
+ "id": "myfunc",
+ "htmlAttributes": {
+ "id": "myfunc"
+ },
+ "hProperties": {
+ "id": "myfunc"
+ }
+ }
},
{
"type": "paragraph",
@@ -1965,7 +2266,16 @@
"type": "text",
"value": "foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo-1",
+ "htmlAttributes": {
+ "id": "foo-1"
+ },
+ "hProperties": {
+ "id": "foo-1"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/react-jsx.output.md b/test/fixture/react-jsx.output.md
index 4f10678a2..96878014b 100644
--- a/test/fixture/react-jsx.output.md
+++ b/test/fixture/react-jsx.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [apples](#apples)
+
## apples
apples
diff --git a/test/fixture/react-jsx.output.md.json b/test/fixture/react-jsx.output.md.json
index 7ebe87a39..aa13aef9d 100644
--- a/test/fixture/react-jsx.output.md.json
+++ b/test/fixture/react-jsx.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#apples",
+ "children": [
+ {
+ "type": "text",
+ "value": "apples"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "apples"
}
- ]
+ ],
+ "data": {
+ "id": "apples",
+ "htmlAttributes": {
+ "id": "apples"
+ },
+ "hProperties": {
+ "id": "apples"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/readme/README.output.md b/test/fixture/readme/README.output.md
index 54991d56e..88b395ed1 100644
--- a/test/fixture/readme/README.output.md
+++ b/test/fixture/readme/README.output.md
@@ -4,6 +4,11 @@
+### Table of Contents
+
+- [foo](#foo)
+- [bar](#bar)
+
## foo
A function with documentation.
diff --git a/test/fixture/require-json-no-extension.output.md b/test/fixture/require-json-no-extension.output.md
index 1fcb902bc..aedd5447d 100644
--- a/test/fixture/require-json-no-extension.output.md
+++ b/test/fixture/require-json-no-extension.output.md
@@ -1 +1,3 @@
+
+### Table of Contents
diff --git a/test/fixture/require-json-no-extension.output.md.json b/test/fixture/require-json-no-extension.output.md.json
index c4109240d..558078620 100644
--- a/test/fixture/require-json-no-extension.output.md.json
+++ b/test/fixture/require-json-no-extension.output.md.json
@@ -4,6 +4,25 @@
{
"type": "html",
"value": ""
+ },
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/require-json.output.md b/test/fixture/require-json.output.md
index 1fcb902bc..aedd5447d 100644
--- a/test/fixture/require-json.output.md
+++ b/test/fixture/require-json.output.md
@@ -1 +1,3 @@
+
+### Table of Contents
diff --git a/test/fixture/require-json.output.md.json b/test/fixture/require-json.output.md.json
index c4109240d..558078620 100644
--- a/test/fixture/require-json.output.md.json
+++ b/test/fixture/require-json.output.md.json
@@ -4,6 +4,25 @@
{
"type": "html",
"value": ""
+ },
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/simple-hashbang.output.md b/test/fixture/simple-hashbang.output.md
index d4aab1e9e..362645dc1 100644
--- a/test/fixture/simple-hashbang.output.md
+++ b/test/fixture/simple-hashbang.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [simple-hashbang.input](#simple-hashbanginput)
+
## simple-hashbang.input
This function returns the number one.
diff --git a/test/fixture/simple-hashbang.output.md.json b/test/fixture/simple-hashbang.output.md.json
index eea85db79..1a68a45e4 100644
--- a/test/fixture/simple-hashbang.output.md.json
+++ b/test/fixture/simple-hashbang.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#simple-hashbanginput",
+ "children": [
+ {
+ "type": "text",
+ "value": "simple-hashbang.input"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "simple-hashbang.input"
}
- ]
+ ],
+ "data": {
+ "id": "simple-hashbanginput",
+ "htmlAttributes": {
+ "id": "simple-hashbanginput"
+ },
+ "hProperties": {
+ "id": "simple-hashbanginput"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/simple-private.output.md b/test/fixture/simple-private.output.md
index 1fcb902bc..aedd5447d 100644
--- a/test/fixture/simple-private.output.md
+++ b/test/fixture/simple-private.output.md
@@ -1 +1,3 @@
+
+### Table of Contents
diff --git a/test/fixture/simple-private.output.md.json b/test/fixture/simple-private.output.md.json
index c4109240d..558078620 100644
--- a/test/fixture/simple-private.output.md.json
+++ b/test/fixture/simple-private.output.md.json
@@ -4,6 +4,25 @@
{
"type": "html",
"value": ""
+ },
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/simple-singlestar.output.md b/test/fixture/simple-singlestar.output.md
index 1fcb902bc..aedd5447d 100644
--- a/test/fixture/simple-singlestar.output.md
+++ b/test/fixture/simple-singlestar.output.md
@@ -1 +1,3 @@
+
+### Table of Contents
diff --git a/test/fixture/simple-singlestar.output.md.json b/test/fixture/simple-singlestar.output.md.json
index c4109240d..558078620 100644
--- a/test/fixture/simple-singlestar.output.md.json
+++ b/test/fixture/simple-singlestar.output.md.json
@@ -4,6 +4,25 @@
{
"type": "html",
"value": ""
+ },
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/simple-triplestar.output.md b/test/fixture/simple-triplestar.output.md
index 1fcb902bc..aedd5447d 100644
--- a/test/fixture/simple-triplestar.output.md
+++ b/test/fixture/simple-triplestar.output.md
@@ -1 +1,3 @@
+
+### Table of Contents
diff --git a/test/fixture/simple-triplestar.output.md.json b/test/fixture/simple-triplestar.output.md.json
index c4109240d..558078620 100644
--- a/test/fixture/simple-triplestar.output.md.json
+++ b/test/fixture/simple-triplestar.output.md.json
@@ -4,6 +4,25 @@
{
"type": "html",
"value": ""
+ },
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/simple-two.output.md b/test/fixture/simple-two.output.md
index c37103e4b..31f744ae3 100644
--- a/test/fixture/simple-two.output.md
+++ b/test/fixture/simple-two.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [returnTwo](#returntwo)
+
## returnTwo
This function returns the number plus two.
diff --git a/test/fixture/simple-two.output.md.json b/test/fixture/simple-two.output.md.json
index 87999cf26..998d6d4be 100644
--- a/test/fixture/simple-two.output.md.json
+++ b/test/fixture/simple-two.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#returntwo",
+ "children": [
+ {
+ "type": "text",
+ "value": "returnTwo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "returnTwo"
}
- ]
+ ],
+ "data": {
+ "id": "returntwo",
+ "htmlAttributes": {
+ "id": "returntwo"
+ },
+ "hProperties": {
+ "id": "returntwo"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/simple.output.github.md b/test/fixture/simple.output.github.md
index 43aadcbc9..7dfae4d52 100644
--- a/test/fixture/simple.output.github.md
+++ b/test/fixture/simple.output.github.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [simple.input](#simpleinput)
+
## simple.input
[test/fixture/simple.input.js:5-8]([github] "Source code on GitHub")
diff --git a/test/fixture/simple.output.md b/test/fixture/simple.output.md
index f428519d0..c2c8c1ec9 100644
--- a/test/fixture/simple.output.md
+++ b/test/fixture/simple.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [simple.input](#simpleinput)
+
## simple.input
This function returns the number one.
diff --git a/test/fixture/simple.output.md.json b/test/fixture/simple.output.md.json
index 6ef343f9a..fe341876a 100644
--- a/test/fixture/simple.output.md.json
+++ b/test/fixture/simple.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#simpleinput",
+ "children": [
+ {
+ "type": "text",
+ "value": "simple.input"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "simple.input"
}
- ]
+ ],
+ "data": {
+ "id": "simpleinput",
+ "htmlAttributes": {
+ "id": "simpleinput"
+ },
+ "hProperties": {
+ "id": "simpleinput"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sort-order-alpha.output.md b/test/fixture/sort-order-alpha.output.md
index 79a56a960..e89a98eb7 100644
--- a/test/fixture/sort-order-alpha.output.md
+++ b/test/fixture/sort-order-alpha.output.md
@@ -1,5 +1,20 @@
+### Table of Contents
+
+- [a](#a)
+- [b](#b)
+- [C](#c)
+ - [A](#a-1)
+ - [a](#a-2)
+ - [B](#b-1)
+ - [b](#b-2)
+- [D](#d)
+ - [A](#a-3)
+ - [a](#a-4)
+ - [B](#b-3)
+ - [b](#b-4)
+
## a
## b
diff --git a/test/fixture/sort-order-alpha.output.md.json b/test/fixture/sort-order-alpha.output.md.json
index 68823dd25..b7157fd48 100644
--- a/test/fixture/sort-order-alpha.output.md.json
+++ b/test/fixture/sort-order-alpha.output.md.json
@@ -5,6 +5,307 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#a",
+ "children": [
+ {
+ "type": "text",
+ "value": "a"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#b",
+ "children": [
+ {
+ "type": "text",
+ "value": "b"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#c",
+ "children": [
+ {
+ "type": "text",
+ "value": "C"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#a-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "A"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#a-2",
+ "children": [
+ {
+ "type": "text",
+ "value": "a"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#b-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "B"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#b-2",
+ "children": [
+ {
+ "type": "text",
+ "value": "b"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#d",
+ "children": [
+ {
+ "type": "text",
+ "value": "D"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#a-3",
+ "children": [
+ {
+ "type": "text",
+ "value": "A"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#a-4",
+ "children": [
+ {
+ "type": "text",
+ "value": "a"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#b-3",
+ "children": [
+ {
+ "type": "text",
+ "value": "B"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#b-4",
+ "children": [
+ {
+ "type": "text",
+ "value": "b"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +314,16 @@
"type": "text",
"value": "a"
}
- ]
+ ],
+ "data": {
+ "id": "a",
+ "htmlAttributes": {
+ "id": "a"
+ },
+ "hProperties": {
+ "id": "a"
+ }
+ }
},
{
"depth": 2,
@@ -23,7 +333,16 @@
"type": "text",
"value": "b"
}
- ]
+ ],
+ "data": {
+ "id": "b",
+ "htmlAttributes": {
+ "id": "b"
+ },
+ "hProperties": {
+ "id": "b"
+ }
+ }
},
{
"depth": 2,
@@ -33,7 +352,16 @@
"type": "text",
"value": "C"
}
- ]
+ ],
+ "data": {
+ "id": "c",
+ "htmlAttributes": {
+ "id": "c"
+ },
+ "hProperties": {
+ "id": "c"
+ }
+ }
},
{
"depth": 3,
@@ -43,7 +371,16 @@
"type": "text",
"value": "A"
}
- ]
+ ],
+ "data": {
+ "id": "a-1",
+ "htmlAttributes": {
+ "id": "a-1"
+ },
+ "hProperties": {
+ "id": "a-1"
+ }
+ }
},
{
"depth": 3,
@@ -53,7 +390,16 @@
"type": "text",
"value": "a"
}
- ]
+ ],
+ "data": {
+ "id": "a-2",
+ "htmlAttributes": {
+ "id": "a-2"
+ },
+ "hProperties": {
+ "id": "a-2"
+ }
+ }
},
{
"depth": 3,
@@ -63,7 +409,16 @@
"type": "text",
"value": "B"
}
- ]
+ ],
+ "data": {
+ "id": "b-1",
+ "htmlAttributes": {
+ "id": "b-1"
+ },
+ "hProperties": {
+ "id": "b-1"
+ }
+ }
},
{
"depth": 3,
@@ -73,7 +428,16 @@
"type": "text",
"value": "b"
}
- ]
+ ],
+ "data": {
+ "id": "b-2",
+ "htmlAttributes": {
+ "id": "b-2"
+ },
+ "hProperties": {
+ "id": "b-2"
+ }
+ }
},
{
"depth": 2,
@@ -83,7 +447,16 @@
"type": "text",
"value": "D"
}
- ]
+ ],
+ "data": {
+ "id": "d",
+ "htmlAttributes": {
+ "id": "d"
+ },
+ "hProperties": {
+ "id": "d"
+ }
+ }
},
{
"depth": 3,
@@ -93,7 +466,16 @@
"type": "text",
"value": "A"
}
- ]
+ ],
+ "data": {
+ "id": "a-3",
+ "htmlAttributes": {
+ "id": "a-3"
+ },
+ "hProperties": {
+ "id": "a-3"
+ }
+ }
},
{
"depth": 3,
@@ -103,7 +485,16 @@
"type": "text",
"value": "a"
}
- ]
+ ],
+ "data": {
+ "id": "a-4",
+ "htmlAttributes": {
+ "id": "a-4"
+ },
+ "hProperties": {
+ "id": "a-4"
+ }
+ }
},
{
"depth": 3,
@@ -113,7 +504,16 @@
"type": "text",
"value": "B"
}
- ]
+ ],
+ "data": {
+ "id": "b-3",
+ "htmlAttributes": {
+ "id": "b-3"
+ },
+ "hProperties": {
+ "id": "b-3"
+ }
+ }
},
{
"depth": 3,
@@ -123,7 +523,16 @@
"type": "text",
"value": "b"
}
- ]
+ ],
+ "data": {
+ "id": "b-4",
+ "htmlAttributes": {
+ "id": "b-4"
+ },
+ "hProperties": {
+ "id": "b-4"
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/string-literal-key.output.md b/test/fixture/string-literal-key.output.md
index ca0924384..a704fb0f8 100644
--- a/test/fixture/string-literal-key.output.md
+++ b/test/fixture/string-literal-key.output.md
@@ -1,5 +1,10 @@
+### Table of Contents
+
+- [MyContainerObject](#mycontainerobject)
+- [foo](#foo)
+
## MyContainerObject
## foo
diff --git a/test/fixture/string-literal-key.output.md.json b/test/fixture/string-literal-key.output.md.json
index c0bd30afe..c202a7cb5 100644
--- a/test/fixture/string-literal-key.output.md.json
+++ b/test/fixture/string-literal-key.output.md.json
@@ -5,6 +5,75 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#mycontainerobject",
+ "children": [
+ {
+ "type": "text",
+ "value": "MyContainerObject"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foo",
+ "children": [
+ {
+ "type": "text",
+ "value": "foo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +82,16 @@
"type": "text",
"value": "MyContainerObject"
}
- ]
+ ],
+ "data": {
+ "id": "mycontainerobject",
+ "htmlAttributes": {
+ "id": "mycontainerobject"
+ },
+ "hProperties": {
+ "id": "mycontainerobject"
+ }
+ }
},
{
"depth": 2,
@@ -23,7 +101,16 @@
"type": "text",
"value": "foo"
}
- ]
+ ],
+ "data": {
+ "id": "foo",
+ "htmlAttributes": {
+ "id": "foo"
+ },
+ "hProperties": {
+ "id": "foo"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/alias.output.md b/test/fixture/sync/alias.output.md
index e4be23d9b..a79e8dd2a 100644
--- a/test/fixture/sync/alias.output.md
+++ b/test/fixture/sync/alias.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [nixon](#nixon)
+
## nixon
This is a method that has an alias tag: so it should
diff --git a/test/fixture/sync/alias.output.md.json b/test/fixture/sync/alias.output.md.json
index e66cb90d7..c3a231df3 100644
--- a/test/fixture/sync/alias.output.md.json
+++ b/test/fixture/sync/alias.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#nixon",
+ "children": [
+ {
+ "type": "text",
+ "value": "nixon"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "nixon"
}
- ]
+ ],
+ "data": {
+ "id": "nixon",
+ "htmlAttributes": {
+ "id": "nixon"
+ },
+ "hProperties": {
+ "id": "nixon"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/empty-example.output.md b/test/fixture/sync/empty-example.output.md
index 59418f38f..c5495a091 100644
--- a/test/fixture/sync/empty-example.output.md
+++ b/test/fixture/sync/empty-example.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [returnTwo](#returntwo)
+
## returnTwo
This function returns the number plus two.
diff --git a/test/fixture/sync/empty-example.output.md.json b/test/fixture/sync/empty-example.output.md.json
index f83249dbf..648bab584 100644
--- a/test/fixture/sync/empty-example.output.md.json
+++ b/test/fixture/sync/empty-example.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#returntwo",
+ "children": [
+ {
+ "type": "text",
+ "value": "returnTwo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "returnTwo"
}
- ]
+ ],
+ "data": {
+ "id": "returntwo",
+ "htmlAttributes": {
+ "id": "returntwo"
+ },
+ "hProperties": {
+ "id": "returntwo"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/flow-types.output.md b/test/fixture/sync/flow-types.output.md
index 470e0e501..3bd1e27db 100644
--- a/test/fixture/sync/flow-types.output.md
+++ b/test/fixture/sync/flow-types.output.md
@@ -1,5 +1,18 @@
+### Table of Contents
+
+- [addThem](#addthem)
+- [Point](#point)
+- [Two](#two)
+- [T](#t)
+- [T](#t-1)
+- [veryImportantTransform](#veryimportanttransform)
+- [optionalFunc](#optionalfunc)
+- [objectParamFn](#objectparamfn)
+- [objectParamFn](#objectparamfn-1)
+- [SomeObjectAPI](#someobjectapi)
+
## addThem
This function returns the number one.
diff --git a/test/fixture/sync/flow-types.output.md.json b/test/fixture/sync/flow-types.output.md.json
index ab82f46ce..88f1517bd 100644
--- a/test/fixture/sync/flow-types.output.md.json
+++ b/test/fixture/sync/flow-types.output.md.json
@@ -5,6 +5,251 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#addthem",
+ "children": [
+ {
+ "type": "text",
+ "value": "addThem"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#point",
+ "children": [
+ {
+ "type": "text",
+ "value": "Point"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#two",
+ "children": [
+ {
+ "type": "text",
+ "value": "Two"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#t",
+ "children": [
+ {
+ "type": "text",
+ "value": "T"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#t-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "T"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#veryimportanttransform",
+ "children": [
+ {
+ "type": "text",
+ "value": "veryImportantTransform"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#optionalfunc",
+ "children": [
+ {
+ "type": "text",
+ "value": "optionalFunc"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#objectparamfn",
+ "children": [
+ {
+ "type": "text",
+ "value": "objectParamFn"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#objectparamfn-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "objectParamFn"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#someobjectapi",
+ "children": [
+ {
+ "type": "text",
+ "value": "SomeObjectAPI"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +258,16 @@
"type": "text",
"value": "addThem"
}
- ]
+ ],
+ "data": {
+ "id": "addthem",
+ "htmlAttributes": {
+ "id": "addthem"
+ },
+ "hProperties": {
+ "id": "addthem"
+ }
+ }
},
{
"type": "paragraph",
@@ -346,7 +600,16 @@
"type": "text",
"value": "Point"
}
- ]
+ ],
+ "data": {
+ "id": "point",
+ "htmlAttributes": {
+ "id": "point"
+ },
+ "hProperties": {
+ "id": "point"
+ }
+ }
},
{
"type": "paragraph",
@@ -898,7 +1161,16 @@
"type": "text",
"value": "Two"
}
- ]
+ ],
+ "data": {
+ "id": "two",
+ "htmlAttributes": {
+ "id": "two"
+ },
+ "hProperties": {
+ "id": "two"
+ }
+ }
},
{
"type": "paragraph",
@@ -1150,7 +1422,16 @@
"type": "text",
"value": "T"
}
- ]
+ ],
+ "data": {
+ "id": "t",
+ "htmlAttributes": {
+ "id": "t"
+ },
+ "hProperties": {
+ "id": "t"
+ }
+ }
},
{
"type": "paragraph",
@@ -1234,7 +1515,16 @@
"type": "text",
"value": "T"
}
- ]
+ ],
+ "data": {
+ "id": "t-1",
+ "htmlAttributes": {
+ "id": "t-1"
+ },
+ "hProperties": {
+ "id": "t-1"
+ }
+ }
},
{
"type": "paragraph",
@@ -1299,7 +1589,16 @@
"type": "text",
"value": "veryImportantTransform"
}
- ]
+ ],
+ "data": {
+ "id": "veryimportanttransform",
+ "htmlAttributes": {
+ "id": "veryimportanttransform"
+ },
+ "hProperties": {
+ "id": "veryimportanttransform"
+ }
+ }
},
{
"type": "paragraph",
@@ -1504,7 +1803,16 @@
"type": "text",
"value": "optionalFunc"
}
- ]
+ ],
+ "data": {
+ "id": "optionalfunc",
+ "htmlAttributes": {
+ "id": "optionalfunc"
+ },
+ "hProperties": {
+ "id": "optionalfunc"
+ }
+ }
},
{
"type": "paragraph",
@@ -1623,7 +1931,16 @@
"type": "text",
"value": "objectParamFn"
}
- ]
+ ],
+ "data": {
+ "id": "objectparamfn",
+ "htmlAttributes": {
+ "id": "objectparamfn"
+ },
+ "hProperties": {
+ "id": "objectparamfn"
+ }
+ }
},
{
"type": "paragraph",
@@ -1733,7 +2050,16 @@
"type": "text",
"value": "objectParamFn"
}
- ]
+ ],
+ "data": {
+ "id": "objectparamfn-1",
+ "htmlAttributes": {
+ "id": "objectparamfn-1"
+ },
+ "hProperties": {
+ "id": "objectparamfn-1"
+ }
+ }
},
{
"type": "paragraph",
@@ -1844,7 +2170,16 @@
"type": "text",
"value": "SomeObjectAPI"
}
- ]
+ ],
+ "data": {
+ "id": "someobjectapi",
+ "htmlAttributes": {
+ "id": "someobjectapi"
+ },
+ "hProperties": {
+ "id": "someobjectapi"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/lots-of-options.output.md b/test/fixture/sync/lots-of-options.output.md
index 014f72bda..11594ccc3 100644
--- a/test/fixture/sync/lots-of-options.output.md
+++ b/test/fixture/sync/lots-of-options.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [gsd](#gsd)
+
## gsd
Global spectra deconvolution
diff --git a/test/fixture/sync/lots-of-options.output.md.json b/test/fixture/sync/lots-of-options.output.md.json
index 3548d2ca9..9b821762f 100644
--- a/test/fixture/sync/lots-of-options.output.md.json
+++ b/test/fixture/sync/lots-of-options.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#gsd",
+ "children": [
+ {
+ "type": "text",
+ "value": "gsd"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "gsd"
}
- ]
+ ],
+ "data": {
+ "id": "gsd",
+ "htmlAttributes": {
+ "id": "gsd"
+ },
+ "hProperties": {
+ "id": "gsd"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/meta.output.md b/test/fixture/sync/meta.output.md
index 1845faf0f..817bb6a52 100644
--- a/test/fixture/sync/meta.output.md
+++ b/test/fixture/sync/meta.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [dewey](#dewey)
+
## dewey
This function has a lot of metadata
diff --git a/test/fixture/sync/meta.output.md.json b/test/fixture/sync/meta.output.md.json
index c7ce42220..ff65e9111 100644
--- a/test/fixture/sync/meta.output.md.json
+++ b/test/fixture/sync/meta.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#dewey",
+ "children": [
+ {
+ "type": "text",
+ "value": "dewey"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "dewey"
}
- ]
+ ],
+ "data": {
+ "id": "dewey",
+ "htmlAttributes": {
+ "id": "dewey"
+ },
+ "hProperties": {
+ "id": "dewey"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/multiexample.output.md b/test/fixture/sync/multiexample.output.md
index caff6189a..01a6fe6db 100644
--- a/test/fixture/sync/multiexample.output.md
+++ b/test/fixture/sync/multiexample.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [multiexample.input](#multiexampleinput)
+
## multiexample.input
**Extends Foo, Bar**
diff --git a/test/fixture/sync/multiexample.output.md.json b/test/fixture/sync/multiexample.output.md.json
index eed8b0606..a59b2610a 100644
--- a/test/fixture/sync/multiexample.output.md.json
+++ b/test/fixture/sync/multiexample.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#multiexampleinput",
+ "children": [
+ {
+ "type": "text",
+ "value": "multiexample.input"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "multiexample.input"
}
- ]
+ ],
+ "data": {
+ "id": "multiexampleinput",
+ "htmlAttributes": {
+ "id": "multiexampleinput"
+ },
+ "hProperties": {
+ "id": "multiexampleinput"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/rename.output.md b/test/fixture/sync/rename.output.md
index 2da5756bf..9e9ce7fc2 100644
--- a/test/fixture/sync/rename.output.md
+++ b/test/fixture/sync/rename.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [cheese](#cheese)
+
## cheese
Cheesoid!
diff --git a/test/fixture/sync/rename.output.md.json b/test/fixture/sync/rename.output.md.json
index b43c1b194..1c39e40c0 100644
--- a/test/fixture/sync/rename.output.md.json
+++ b/test/fixture/sync/rename.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#cheese",
+ "children": [
+ {
+ "type": "text",
+ "value": "cheese"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "cheese"
}
- ]
+ ],
+ "data": {
+ "id": "cheese",
+ "htmlAttributes": {
+ "id": "cheese"
+ },
+ "hProperties": {
+ "id": "cheese"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/throws.output.md b/test/fixture/sync/throws.output.md
index 18a960f06..379677656 100644
--- a/test/fixture/sync/throws.output.md
+++ b/test/fixture/sync/throws.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [returnTwo](#returntwo)
+
## returnTwo
This function returns the number plus two.
diff --git a/test/fixture/sync/throws.output.md.json b/test/fixture/sync/throws.output.md.json
index bd52a315a..c272dd736 100644
--- a/test/fixture/sync/throws.output.md.json
+++ b/test/fixture/sync/throws.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#returntwo",
+ "children": [
+ {
+ "type": "text",
+ "value": "returnTwo"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "returnTwo"
}
- ]
+ ],
+ "data": {
+ "id": "returntwo",
+ "htmlAttributes": {
+ "id": "returntwo"
+ },
+ "hProperties": {
+ "id": "returntwo"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/trailing-only.output.md b/test/fixture/sync/trailing-only.output.md
index a464834b2..63511b984 100644
--- a/test/fixture/sync/trailing-only.output.md
+++ b/test/fixture/sync/trailing-only.output.md
@@ -1,5 +1,7 @@
+### Table of Contents
+
##
this is a type
diff --git a/test/fixture/sync/trailing-only.output.md.json b/test/fixture/sync/trailing-only.output.md.json
index 7dc0f561f..d92da51a1 100644
--- a/test/fixture/sync/trailing-only.output.md.json
+++ b/test/fixture/sync/trailing-only.output.md.json
@@ -5,6 +5,25 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +32,16 @@
"type": "text",
"value": ""
}
- ]
+ ],
+ "data": {
+ "id": "",
+ "htmlAttributes": {
+ "id": ""
+ },
+ "hProperties": {
+ "id": ""
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/trailing.output.md b/test/fixture/sync/trailing.output.md
index 33d39203b..1848b96a3 100644
--- a/test/fixture/sync/trailing.output.md
+++ b/test/fixture/sync/trailing.output.md
@@ -1,5 +1,11 @@
+### Table of Contents
+
+- [fooBar](#foobar)
+- [fooBaz](#foobaz)
+- [Something](#something)
+
## fooBar
ONE
diff --git a/test/fixture/sync/trailing.output.md.json b/test/fixture/sync/trailing.output.md.json
index 655ed545a..749cbe98d 100644
--- a/test/fixture/sync/trailing.output.md.json
+++ b/test/fixture/sync/trailing.output.md.json
@@ -5,6 +5,97 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foobar",
+ "children": [
+ {
+ "type": "text",
+ "value": "fooBar"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#foobaz",
+ "children": [
+ {
+ "type": "text",
+ "value": "fooBaz"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#something",
+ "children": [
+ {
+ "type": "text",
+ "value": "Something"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +104,16 @@
"type": "text",
"value": "fooBar"
}
- ]
+ ],
+ "data": {
+ "id": "foobar",
+ "htmlAttributes": {
+ "id": "foobar"
+ },
+ "hProperties": {
+ "id": "foobar"
+ }
+ }
},
{
"type": "paragraph",
@@ -122,7 +222,16 @@
"type": "text",
"value": "fooBaz"
}
- ]
+ ],
+ "data": {
+ "id": "foobaz",
+ "htmlAttributes": {
+ "id": "foobaz"
+ },
+ "hProperties": {
+ "id": "foobaz"
+ }
+ }
},
{
"type": "paragraph",
@@ -231,7 +340,16 @@
"type": "text",
"value": "Something"
}
- ]
+ ],
+ "data": {
+ "id": "something",
+ "htmlAttributes": {
+ "id": "something"
+ },
+ "hProperties": {
+ "id": "something"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/sync/typedef.output.md b/test/fixture/sync/typedef.output.md
index 90a5d5c5d..01f5eede6 100644
--- a/test/fixture/sync/typedef.output.md
+++ b/test/fixture/sync/typedef.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [MyType](#mytype)
+
## MyType
A type definition.
diff --git a/test/fixture/sync/typedef.output.md.json b/test/fixture/sync/typedef.output.md.json
index 8fc8da623..b900c6215 100644
--- a/test/fixture/sync/typedef.output.md.json
+++ b/test/fixture/sync/typedef.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#mytype",
+ "children": [
+ {
+ "type": "text",
+ "value": "MyType"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "MyType"
}
- ]
+ ],
+ "data": {
+ "id": "mytype",
+ "htmlAttributes": {
+ "id": "mytype"
+ },
+ "hProperties": {
+ "id": "mytype"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/system-import.output.md b/test/fixture/system-import.output.md
index f428519d0..c2c8c1ec9 100644
--- a/test/fixture/system-import.output.md
+++ b/test/fixture/system-import.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [simple.input](#simpleinput)
+
## simple.input
This function returns the number one.
diff --git a/test/fixture/system-import.output.md.json b/test/fixture/system-import.output.md.json
index 6ef343f9a..fe341876a 100644
--- a/test/fixture/system-import.output.md.json
+++ b/test/fixture/system-import.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#simpleinput",
+ "children": [
+ {
+ "type": "text",
+ "value": "simple.input"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "simple.input"
}
- ]
+ ],
+ "data": {
+ "id": "simpleinput",
+ "htmlAttributes": {
+ "id": "simpleinput"
+ },
+ "hProperties": {
+ "id": "simpleinput"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/this-class.output.md b/test/fixture/this-class.output.md
index 68e637245..ea20b2510 100644
--- a/test/fixture/this-class.output.md
+++ b/test/fixture/this-class.output.md
@@ -1,5 +1,13 @@
+### Table of Contents
+
+- [bookshelf](#bookshelf)
+- [Book](#book)
+ - [title](#title)
+- [BookShelf](#bookshelf-1)
+ - [title](#title-1)
+
## bookshelf
**Parameters**
diff --git a/test/fixture/this-class.output.md.json b/test/fixture/this-class.output.md.json
index e7b15ff40..d8f4d6bc9 100644
--- a/test/fixture/this-class.output.md.json
+++ b/test/fixture/this-class.output.md.json
@@ -5,6 +5,153 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#bookshelf",
+ "children": [
+ {
+ "type": "text",
+ "value": "bookshelf"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#book",
+ "children": [
+ {
+ "type": "text",
+ "value": "Book"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#title",
+ "children": [
+ {
+ "type": "text",
+ "value": "title"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#bookshelf-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "BookShelf"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#title-1",
+ "children": [
+ {
+ "type": "text",
+ "value": "title"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +160,16 @@
"type": "text",
"value": "bookshelf"
}
- ]
+ ],
+ "data": {
+ "id": "bookshelf",
+ "htmlAttributes": {
+ "id": "bookshelf"
+ },
+ "hProperties": {
+ "id": "bookshelf"
+ }
+ }
},
{
"type": "strong",
@@ -60,7 +216,16 @@
"type": "text",
"value": "Book"
}
- ]
+ ],
+ "data": {
+ "id": "book",
+ "htmlAttributes": {
+ "id": "book"
+ },
+ "hProperties": {
+ "id": "book"
+ }
+ }
},
{
"type": "strong",
@@ -107,7 +272,16 @@
"type": "text",
"value": "title"
}
- ]
+ ],
+ "data": {
+ "id": "title",
+ "htmlAttributes": {
+ "id": "title"
+ },
+ "hProperties": {
+ "id": "title"
+ }
+ }
},
{
"type": "paragraph",
@@ -152,7 +326,16 @@
"type": "text",
"value": "BookShelf"
}
- ]
+ ],
+ "data": {
+ "id": "bookshelf-1",
+ "htmlAttributes": {
+ "id": "bookshelf-1"
+ },
+ "hProperties": {
+ "id": "bookshelf-1"
+ }
+ }
},
{
"type": "strong",
@@ -199,7 +382,16 @@
"type": "text",
"value": "title"
}
- ]
+ ],
+ "data": {
+ "id": "title-1",
+ "htmlAttributes": {
+ "id": "title-1"
+ },
+ "hProperties": {
+ "id": "title-1"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/type_application.output.md b/test/fixture/type_application.output.md
index b2568c017..15b47e757 100644
--- a/test/fixture/type_application.output.md
+++ b/test/fixture/type_application.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [Address6](#address6)
+
## Address6
Represents an IPv6 address
diff --git a/test/fixture/type_application.output.md.json b/test/fixture/type_application.output.md.json
index a77cd28e9..78b569c66 100644
--- a/test/fixture/type_application.output.md.json
+++ b/test/fixture/type_application.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#address6",
+ "children": [
+ {
+ "type": "text",
+ "value": "Address6"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "Address6"
}
- ]
+ ],
+ "data": {
+ "id": "address6",
+ "htmlAttributes": {
+ "id": "address6"
+ },
+ "hProperties": {
+ "id": "address6"
+ }
+ }
},
{
"type": "paragraph",
diff --git a/test/fixture/var-function-param-return.output.md b/test/fixture/var-function-param-return.output.md
index bfbf02a26..5373d639c 100644
--- a/test/fixture/var-function-param-return.output.md
+++ b/test/fixture/var-function-param-return.output.md
@@ -1,5 +1,9 @@
+### Table of Contents
+
+- [f](#f)
+
## f
**Parameters**
diff --git a/test/fixture/var-function-param-return.output.md.json b/test/fixture/var-function-param-return.output.md.json
index cc30bcd50..1710cfe0a 100644
--- a/test/fixture/var-function-param-return.output.md.json
+++ b/test/fixture/var-function-param-return.output.md.json
@@ -5,6 +5,53 @@
"type": "html",
"value": ""
},
+ {
+ "depth": 3,
+ "type": "heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "Table of Contents"
+ }
+ ],
+ "data": {
+ "id": "table-of-contents",
+ "htmlAttributes": {
+ "id": "table-of-contents"
+ },
+ "hProperties": {
+ "id": "table-of-contents"
+ }
+ }
+ },
+ {
+ "type": "list",
+ "ordered": false,
+ "children": [
+ {
+ "type": "listItem",
+ "loose": false,
+ "children": [
+ {
+ "type": "paragraph",
+ "children": [
+ {
+ "type": "link",
+ "title": null,
+ "url": "#f",
+ "children": [
+ {
+ "type": "text",
+ "value": "f"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"depth": 2,
"type": "heading",
@@ -13,7 +60,16 @@
"type": "text",
"value": "f"
}
- ]
+ ],
+ "data": {
+ "id": "f",
+ "htmlAttributes": {
+ "id": "f"
+ },
+ "hProperties": {
+ "id": "f"
+ }
+ }
},
{
"type": "strong",
diff --git a/test/test.js b/test/test.js
index a31667f81..8a58a885d 100644
--- a/test/test.js
+++ b/test/test.js
@@ -147,6 +147,21 @@ test('outputs', function (ttt) {
});
});
+ if (file.match(/es6.input.js/)) {
+ tt.test('no markdown TOC', function (t) {
+ outputMarkdown(_.cloneDeep(result), { 'no-markdown-toc': true }, function (err, result) {
+ t.ifError(err);
+ var outputfile = file.replace('.input.js', '.output-toc.md');
+ if (UPDATE) {
+ fs.writeFileSync(outputfile, result, 'utf8');
+ }
+ var expect = fs.readFileSync(outputfile, 'utf8');
+ t.equal(result.toString(), expect, 'markdown output correct');
+ t.end();
+ });
+ });
+ }
+
tt.test('markdown AST', function (t) {
outputMarkdownAST(_.cloneDeep(result), {}, function (err, result) {
t.ifError(err);
From 5bfc660a98a2c6e652d7fa70519da0433b9e2793 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Wed, 28 Dec 2016 21:55:22 -0500
Subject: [PATCH 024/583] test(coverage): Improve test coverage of document
exported
---
bin/documentation.js | 3 +++
lib/commands/build.js | 6 ++----
lib/extractors/exported.js | 8 +++++++-
test/fixture/document-exported-bad/exports-z.js | 1 +
test/fixture/document-exported-bad/x.js | 1 +
test/test.js | 8 ++++++++
6 files changed, 22 insertions(+), 5 deletions(-)
create mode 100644 test/fixture/document-exported-bad/exports-z.js
create mode 100644 test/fixture/document-exported-bad/x.js
diff --git a/bin/documentation.js b/bin/documentation.js
index 886e2ef18..1b4931d41 100755
--- a/bin/documentation.js
+++ b/bin/documentation.js
@@ -12,6 +12,9 @@ var argv = yargs
.command(commands.build)
.command(commands.lint)
.command(commands.readme)
+ .fail(function (msg, error) {
+ throw error;
+ })
.version(function () {
return require('../package').version;
})
diff --git a/lib/commands/build.js b/lib/commands/build.js
index c7757a4b3..4623abbcd 100644
--- a/lib/commands/build.js
+++ b/lib/commands/build.js
@@ -49,6 +49,7 @@ module.exports.builder = extend({},
* just a thin wrapper around this one.
*/
module.exports.handler = function build(argv, callback) {
+ console.log(argv);
argv._handled = true;
argv = sharedOptions.expandInputs(argv);
if (argv.f === 'html' && argv.o === 'stdout') {
@@ -56,10 +57,7 @@ module.exports.handler = function build(argv, callback) {
}
var generator = documentation.build
- .bind(null, argv.input, argv, onDocumented);
-
- function onDocumented(err, comments) {
- if (err) {
+ .bind(null, argv.input, argv, onDocumented); function onDocumented(err, comments) { if (err) {
if (typeof callback === 'function') {
return callback(err);
}
diff --git a/lib/extractors/exported.js b/lib/extractors/exported.js
index 92d8a22a5..89bb9d7a0 100644
--- a/lib/extractors/exported.js
+++ b/lib/extractors/exported.js
@@ -103,6 +103,9 @@ function walkExported(ast, data, addComment) {
throw new Error('Unreachable');
}
+ if (bindingPath === undefined) {
+ throw new Error(`Unable to find the value ${exported} in ${specData.file}`);
+ }
traverseExportedSubtree(bindingPath, specData, addComments, exported);
});
return path.skip();
@@ -242,7 +245,10 @@ function findExportDeclaration(dataCache, name, exportKind, referrer, filename)
}
});
- return {ast: rv, data: data};
+ return {
+ ast: rv,
+ data: data
+ };
}
// Since we cannot use scope.getBinding for types this walks the current scope looking for a
diff --git a/test/fixture/document-exported-bad/exports-z.js b/test/fixture/document-exported-bad/exports-z.js
new file mode 100644
index 000000000..fd191d77f
--- /dev/null
+++ b/test/fixture/document-exported-bad/exports-z.js
@@ -0,0 +1 @@
+export var z = 1;
diff --git a/test/fixture/document-exported-bad/x.js b/test/fixture/document-exported-bad/x.js
new file mode 100644
index 000000000..80bf1c6fb
--- /dev/null
+++ b/test/fixture/document-exported-bad/x.js
@@ -0,0 +1 @@
+export {y as x} from './exports-z.js';
diff --git a/test/test.js b/test/test.js
index 8a58a885d..3a2d5f537 100644
--- a/test/test.js
+++ b/test/test.js
@@ -59,6 +59,14 @@ if (fs.existsSync(path.join(__dirname, '../.git'))) {
});
}
+test('document-exported error', function (t) {
+ var file = path.join(__dirname, 'fixture', 'document-exported-bad', 'x.js');
+ documentation.build([file], { documentExported: true }, function (err, result) {
+ t.match(err.message, /Unable to find the value x/g, 'Produces a descriptive error');
+ t.end();
+ });
+});
+
test('external modules option', function (t) {
documentation.build([
path.join(__dirname, 'fixture', 'external.input.js')
From dd9c03a19ed707fed7ffdb61c414aaf6de8ddaf4 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Wed, 28 Dec 2016 22:00:23 -0500
Subject: [PATCH 025/583] refactor(args): Improve the way we use yargs to
simplify the markdown-toc option
---
lib/commands/build.js | 6 +++---
lib/output/markdown_ast.js | 2 +-
test/test.js | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/commands/build.js b/lib/commands/build.js
index 4623abbcd..852c2a846 100644
--- a/lib/commands/build.js
+++ b/lib/commands/build.js
@@ -26,9 +26,9 @@ module.exports.builder = extend({},
default: 'json',
choices: ['json', 'md', 'remark', 'html']
},
- 'no-markdown-toc': {
+ 'markdown-toc': {
describe: 'include a table of contents in markdown output',
- default: 'stdout',
+ default: true,
type: 'boolean'
},
output: {
@@ -69,7 +69,7 @@ module.exports.handler = function build(argv, callback) {
version: argv['project-version'] || (argv.package || {}).version,
theme: argv.theme,
paths: argv.paths,
- 'no-markdown-toc': argv['no-markdown-toc'],
+ markdownToc: argv.markdownToc,
hljs: argv.hljs || {}
};
diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js
index 2b37c80a0..d55466749 100644
--- a/lib/output/markdown_ast.js
+++ b/lib/output/markdown_ast.js
@@ -210,7 +210,7 @@ function markdownAST(comments, options, callback) {
var root = rerouteLinks(linkerStack.link,
u('root', generatorComment
- .concat(options['no-markdown-toc'] ? [] : tableOfContentsHeading)
+ .concat(options.markdownToc ? tableOfContentsHeading : [])
.concat(comments.reduce(function (memo, comment) {
return memo.concat(generate(2, comment));
}, []))));
diff --git a/test/test.js b/test/test.js
index 3a2d5f537..9dec1d359 100644
--- a/test/test.js
+++ b/test/test.js
@@ -157,7 +157,7 @@ test('outputs', function (ttt) {
if (file.match(/es6.input.js/)) {
tt.test('no markdown TOC', function (t) {
- outputMarkdown(_.cloneDeep(result), { 'no-markdown-toc': true }, function (err, result) {
+ outputMarkdown(_.cloneDeep(result), { markdownToc: false }, function (err, result) {
t.ifError(err);
var outputfile = file.replace('.input.js', '.output-toc.md');
if (UPDATE) {
From 88c8f9a668a6715e4a65d763daeb9475bc494ff7 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Wed, 28 Dec 2016 22:19:40 -0500
Subject: [PATCH 026/583] fix(cli): Fix error reporting in the CLI
---
bin/documentation.js | 8 +-
lib/commands/build.js | 6 +-
.../auto_lang_hljs/multilanguage.output.md | 4 -
.../boolean-literal-type.output.md.json | 47 --
test/fixture/class.config.output.md | 7 -
test/fixture/class.output.md.json | 97 ---
...orted-export-default-object.output.md.json | 69 --
...ported-export-default-value.output.md.json | 47 --
test/fixture/document-exported.output.md.json | 703 ------------------
test/fixture/es6-class.output.md.json | 119 ---
test/fixture/es6-default2.output.md.json | 47 --
test/fixture/es6-import.output.md.json | 91 ---
test/fixture/es6.output.md.json | 471 ------------
test/fixture/event.output.md.json | 47 --
test/fixture/example-caption.output.md.json | 47 --
test/fixture/external.output.md.json | 47 --
test/fixture/factory.output.md.json | 91 ---
test/fixture/infer-private.output.md.json | 75 --
test/fixture/inheritance.output.md.json | 69 --
test/fixture/inline-link.output.md.json | 69 --
test/fixture/internal.output.md.json | 47 --
test/fixture/literal_types.output.md.json | 69 --
test/fixture/memberedclass.output.md.json | 97 ---
.../fixture/merge-infered-type.output.md.json | 47 --
test/fixture/multisignature.output.md.json | 69 --
test/fixture/nearby_params.output.md.json | 47 --
test/fixture/nest_params.output.md.json | 69 --
.../newline-in-description.output.md.json | 19 -
test/fixture/no-name.output.md.json | 19 -
.../optional-record-field-type.output.md.json | 47 --
test/fixture/params.output.md.json | 229 ------
test/fixture/react-jsx.output.md.json | 47 --
test/fixture/readme/README.output.md | 5 -
.../require-json-no-extension.output.md.json | 19 -
test/fixture/require-json.output.md.json | 19 -
test/fixture/simple-hashbang.output.md.json | 47 --
test/fixture/simple-private.output.md.json | 19 -
test/fixture/simple-singlestar.output.md.json | 19 -
test/fixture/simple-triplestar.output.md.json | 19 -
test/fixture/simple-two.output.md.json | 47 --
test/fixture/simple.output.github.md | 4 -
test/fixture/simple.output.md.json | 47 --
test/fixture/sort-order-alpha.output.md.json | 301 --------
.../fixture/string-literal-key.output.md.json | 69 --
test/fixture/sync/alias.output.md.json | 47 --
.../fixture/sync/empty-example.output.md.json | 47 --
test/fixture/sync/flow-types.output.md.json | 245 ------
.../sync/lots-of-options.output.md.json | 47 --
test/fixture/sync/meta.output.md.json | 47 --
test/fixture/sync/multiexample.output.md.json | 47 --
test/fixture/sync/rename.output.md.json | 47 --
test/fixture/sync/throws.output.md.json | 47 --
.../fixture/sync/trailing-only.output.md.json | 19 -
test/fixture/sync/trailing.output.md.json | 91 ---
test/fixture/sync/typedef.output.md.json | 47 --
test/fixture/system-import.output.md.json | 47 --
test/fixture/this-class.output.md.json | 147 ----
test/fixture/type_application.output.md.json | 47 --
.../var-function-param-return.output.md.json | 47 --
test/test.js | 4 +-
60 files changed, 13 insertions(+), 4592 deletions(-)
diff --git a/bin/documentation.js b/bin/documentation.js
index 1b4931d41..fc275553d 100755
--- a/bin/documentation.js
+++ b/bin/documentation.js
@@ -13,7 +13,13 @@ var argv = yargs
.command(commands.lint)
.command(commands.readme)
.fail(function (msg, error) {
- throw error;
+ if (error) {
+ throw error;
+ } else {
+ yargs.showHelp('error');
+ console.error(msg);
+ return yargs.exit(1);
+ }
})
.version(function () {
return require('../package').version;
diff --git a/lib/commands/build.js b/lib/commands/build.js
index 852c2a846..633973dc1 100644
--- a/lib/commands/build.js
+++ b/lib/commands/build.js
@@ -49,7 +49,6 @@ module.exports.builder = extend({},
* just a thin wrapper around this one.
*/
module.exports.handler = function build(argv, callback) {
- console.log(argv);
argv._handled = true;
argv = sharedOptions.expandInputs(argv);
if (argv.f === 'html' && argv.o === 'stdout') {
@@ -57,7 +56,10 @@ module.exports.handler = function build(argv, callback) {
}
var generator = documentation.build
- .bind(null, argv.input, argv, onDocumented); function onDocumented(err, comments) { if (err) {
+ .bind(null, argv.input, argv, onDocumented);
+
+ function onDocumented(err, comments) {
+ if (err) {
if (typeof callback === 'function') {
return callback(err);
}
diff --git a/test/fixture/auto_lang_hljs/multilanguage.output.md b/test/fixture/auto_lang_hljs/multilanguage.output.md
index c7c1fe56c..e648388cc 100644
--- a/test/fixture/auto_lang_hljs/multilanguage.output.md
+++ b/test/fixture/auto_lang_hljs/multilanguage.output.md
@@ -1,9 +1,5 @@
-### Table of Contents
-
-- [multilanguage.input](#multilanguageinput)
-
## multilanguage.input
**Extends Foo, Bar**
diff --git a/test/fixture/boolean-literal-type.output.md.json b/test/fixture/boolean-literal-type.output.md.json
index c59ae7bb8..3f5dff173 100644
--- a/test/fixture/boolean-literal-type.output.md.json
+++ b/test/fixture/boolean-literal-type.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#f",
- "children": [
- {
- "type": "text",
- "value": "f"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/class.config.output.md b/test/fixture/class.config.output.md
index ed2aaa9e1..5f0f252c7 100644
--- a/test/fixture/class.config.output.md
+++ b/test/fixture/class.config.output.md
@@ -1,12 +1,5 @@
-### Table of Contents
-
-- [MyClass](#myclass)
- - [getFoo](#getfoo)
- - [getUndefined](#getundefined)
-- [Hello](#hello)
-
## MyClass
This is my class, a demo thing.
diff --git a/test/fixture/class.output.md.json b/test/fixture/class.output.md.json
index 8efdb7a4f..962b34920 100644
--- a/test/fixture/class.output.md.json
+++ b/test/fixture/class.output.md.json
@@ -5,103 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#myclass",
- "children": [
- {
- "type": "text",
- "value": "MyClass"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#getfoo",
- "children": [
- {
- "type": "text",
- "value": "getFoo"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#getundefined",
- "children": [
- {
- "type": "text",
- "value": "getUndefined"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/document-exported-export-default-object.output.md.json b/test/fixture/document-exported-export-default-object.output.md.json
index 1bb59256b..6ca318d68 100644
--- a/test/fixture/document-exported-export-default-object.output.md.json
+++ b/test/fixture/document-exported-export-default-object.output.md.json
@@ -5,75 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#document-exported-export-default-objectinput",
- "children": [
- {
- "type": "text",
- "value": "document-exported-export-default-object.input"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#x",
- "children": [
- {
- "type": "text",
- "value": "x"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/document-exported-export-default-value.output.md.json b/test/fixture/document-exported-export-default-value.output.md.json
index fb2e8877e..d4a0c52d9 100644
--- a/test/fixture/document-exported-export-default-value.output.md.json
+++ b/test/fixture/document-exported-export-default-value.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#document-exported-export-default-valueinput",
- "children": [
- {
- "type": "text",
- "value": "document-exported-export-default-value.input"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/document-exported.output.md.json b/test/fixture/document-exported.output.md.json
index 7a602f739..6065877bc 100644
--- a/test/fixture/document-exported.output.md.json
+++ b/test/fixture/document-exported.output.md.json
@@ -5,709 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#z",
- "children": [
- {
- "type": "text",
- "value": "z"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#zmethod",
- "children": [
- {
- "type": "text",
- "value": "zMethod"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#x",
- "children": [
- {
- "type": "text",
- "value": "x"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#class",
- "children": [
- {
- "type": "text",
- "value": "Class"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#classmethod",
- "children": [
- {
- "type": "text",
- "value": "classMethod"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#classgetter",
- "children": [
- {
- "type": "text",
- "value": "classGetter"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#classsetter",
- "children": [
- {
- "type": "text",
- "value": "classSetter"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#staticmethod",
- "children": [
- {
- "type": "text",
- "value": "staticMethod"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#staticgetter",
- "children": [
- {
- "type": "text",
- "value": "staticGetter"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#staticsetter",
- "children": [
- {
- "type": "text",
- "value": "staticSetter"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#t5",
- "children": [
- {
- "type": "text",
- "value": "T5"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#y2default",
- "children": [
- {
- "type": "text",
- "value": "y2Default"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#y4",
- "children": [
- {
- "type": "text",
- "value": "y4"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#object",
- "children": [
- {
- "type": "text",
- "value": "object"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#prop",
- "children": [
- {
- "type": "text",
- "value": "prop"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#func",
- "children": [
- {
- "type": "text",
- "value": "func"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#method",
- "children": [
- {
- "type": "text",
- "value": "method"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#getter",
- "children": [
- {
- "type": "text",
- "value": "getter"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#setter",
- "children": [
- {
- "type": "text",
- "value": "setter"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#f1",
- "children": [
- {
- "type": "text",
- "value": "f1"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#f3",
- "children": [
- {
- "type": "text",
- "value": "f3"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#t",
- "children": [
- {
- "type": "text",
- "value": "T"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#t2",
- "children": [
- {
- "type": "text",
- "value": "T2"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#t4",
- "children": [
- {
- "type": "text",
- "value": "T4"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#f4",
- "children": [
- {
- "type": "text",
- "value": "f4"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#o1",
- "children": [
- {
- "type": "text",
- "value": "o1"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#om1",
- "children": [
- {
- "type": "text",
- "value": "om1"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#f5",
- "children": [
- {
- "type": "text",
- "value": "f5"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#o2",
- "children": [
- {
- "type": "text",
- "value": "o2"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#om2",
- "children": [
- {
- "type": "text",
- "value": "om2"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/es6-class.output.md.json b/test/fixture/es6-class.output.md.json
index 30e48a47d..3ea160e54 100644
--- a/test/fixture/es6-class.output.md.json
+++ b/test/fixture/es6-class.output.md.json
@@ -5,125 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo",
- "children": [
- {
- "type": "text",
- "value": "Foo"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#bar",
- "children": [
- {
- "type": "text",
- "value": "Bar"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#constructor",
- "children": [
- {
- "type": "text",
- "value": "constructor"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#bar-1",
- "children": [
- {
- "type": "text",
- "value": "bar"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/es6-default2.output.md.json b/test/fixture/es6-default2.output.md.json
index 5b20bb0bc..a4facdbc8 100644
--- a/test/fixture/es6-default2.output.md.json
+++ b/test/fixture/es6-default2.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#es6-default2input",
- "children": [
- {
- "type": "text",
- "value": "es6-default2.input"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/es6-import.output.md.json b/test/fixture/es6-import.output.md.json
index b4142afb6..9ae20c52b 100644
--- a/test/fixture/es6-import.output.md.json
+++ b/test/fixture/es6-import.output.md.json
@@ -5,97 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#multiplytwice",
- "children": [
- {
- "type": "text",
- "value": "multiplyTwice"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#es6-ext",
- "children": [
- {
- "type": "text",
- "value": "es6-ext"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#simpleinput",
- "children": [
- {
- "type": "text",
- "value": "simple.input"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json
index 3a7a26f49..e2e2b8155 100644
--- a/test/fixture/es6.output.md.json
+++ b/test/fixture/es6.output.md.json
@@ -5,477 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#destructure",
- "children": [
- {
- "type": "text",
- "value": "destructure"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#destructure-1",
- "children": [
- {
- "type": "text",
- "value": "destructure"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#multiply",
- "children": [
- {
- "type": "text",
- "value": "multiply"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#sink",
- "children": [
- {
- "type": "text",
- "value": "Sink"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#staticprop",
- "children": [
- {
- "type": "text",
- "value": "staticProp"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#empty",
- "children": [
- {
- "type": "text",
- "value": "empty"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#agetter",
- "children": [
- {
- "type": "text",
- "value": "aGetter"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#constructor",
- "children": [
- {
- "type": "text",
- "value": "constructor"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#hello",
- "children": [
- {
- "type": "text",
- "value": "hello"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#makeabasket",
- "children": [
- {
- "type": "text",
- "value": "makeABasket"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#makeasink",
- "children": [
- {
- "type": "text",
- "value": "makeASink"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#functionwithrest",
- "children": [
- {
- "type": "text",
- "value": "functionWithRest"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#functionwithrestandtype",
- "children": [
- {
- "type": "text",
- "value": "functionWithRestAndType"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#es6input",
- "children": [
- {
- "type": "text",
- "value": "es6.input"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#veryimportanttransform",
- "children": [
- {
- "type": "text",
- "value": "veryImportantTransform"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#iamprotected",
- "children": [
- {
- "type": "text",
- "value": "iAmProtected"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#iampublic",
- "children": [
- {
- "type": "text",
- "value": "iAmPublic"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#execute",
- "children": [
- {
- "type": "text",
- "value": "execute"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#isarrayequalwith",
- "children": [
- {
- "type": "text",
- "value": "isArrayEqualWith"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/event.output.md.json b/test/fixture/event.output.md.json
index c64707a0c..5e43d48dc 100644
--- a/test/fixture/event.output.md.json
+++ b/test/fixture/event.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#mapmousemove",
- "children": [
- {
- "type": "text",
- "value": "Map#mousemove"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/example-caption.output.md.json b/test/fixture/example-caption.output.md.json
index 2f174b755..50a27aad1 100644
--- a/test/fixture/example-caption.output.md.json
+++ b/test/fixture/example-caption.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/external.output.md.json b/test/fixture/external.output.md.json
index 908a79f52..e85a11a76 100644
--- a/test/fixture/external.output.md.json
+++ b/test/fixture/external.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/factory.output.md.json b/test/fixture/factory.output.md.json
index 30277976a..293fdb447 100644
--- a/test/fixture/factory.output.md.json
+++ b/test/fixture/factory.output.md.json
@@ -5,97 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#area",
- "children": [
- {
- "type": "text",
- "value": "area"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#area-1",
- "children": [
- {
- "type": "text",
- "value": "area"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#data",
- "children": [
- {
- "type": "text",
- "value": "data"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/infer-private.output.md.json b/test/fixture/infer-private.output.md.json
index 2ec83e5be..c28ac99f6 100644
--- a/test/fixture/infer-private.output.md.json
+++ b/test/fixture/infer-private.output.md.json
@@ -5,81 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#c",
- "children": [
- {
- "type": "text",
- "value": "C"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#m",
- "children": [
- {
- "type": "text",
- "value": "m"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/inheritance.output.md.json b/test/fixture/inheritance.output.md.json
index f3f66f27b..a13aa009d 100644
--- a/test/fixture/inheritance.output.md.json
+++ b/test/fixture/inheritance.output.md.json
@@ -5,75 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#specialarray",
- "children": [
- {
- "type": "text",
- "value": "SpecialArray"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo",
- "children": [
- {
- "type": "text",
- "value": "Foo"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/inline-link.output.md.json b/test/fixture/inline-link.output.md.json
index 5556d69d7..7a44b24ad 100644
--- a/test/fixture/inline-link.output.md.json
+++ b/test/fixture/inline-link.output.md.json
@@ -5,75 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#addone",
- "children": [
- {
- "type": "text",
- "value": "addOne"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#inline-linkinput",
- "children": [
- {
- "type": "text",
- "value": "inline-link.input"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/internal.output.md.json b/test/fixture/internal.output.md.json
index 908a79f52..e85a11a76 100644
--- a/test/fixture/internal.output.md.json
+++ b/test/fixture/internal.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/literal_types.output.md.json b/test/fixture/literal_types.output.md.json
index 5c37008f5..14583c30f 100644
--- a/test/fixture/literal_types.output.md.json
+++ b/test/fixture/literal_types.output.md.json
@@ -5,75 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#f",
- "children": [
- {
- "type": "text",
- "value": "f"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#g",
- "children": [
- {
- "type": "text",
- "value": "g"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/memberedclass.output.md.json b/test/fixture/memberedclass.output.md.json
index af39eb75c..4de61d930 100644
--- a/test/fixture/memberedclass.output.md.json
+++ b/test/fixture/memberedclass.output.md.json
@@ -5,103 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#myclass",
- "children": [
- {
- "type": "text",
- "value": "MyClass"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#getfoo",
- "children": [
- {
- "type": "text",
- "value": "getFoo"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#getundefined",
- "children": [
- {
- "type": "text",
- "value": "getUndefined"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/merge-infered-type.output.md.json b/test/fixture/merge-infered-type.output.md.json
index 8915db6f7..be9210ca1 100644
--- a/test/fixture/merge-infered-type.output.md.json
+++ b/test/fixture/merge-infered-type.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#addfive",
- "children": [
- {
- "type": "text",
- "value": "addFive"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/multisignature.output.md.json b/test/fixture/multisignature.output.md.json
index 09f8f0f14..a165f7aa8 100644
--- a/test/fixture/multisignature.output.md.json
+++ b/test/fixture/multisignature.output.md.json
@@ -5,75 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#getthetime",
- "children": [
- {
- "type": "text",
- "value": "getTheTime"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#getthetime-1",
- "children": [
- {
- "type": "text",
- "value": "getTheTime"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/nearby_params.output.md.json b/test/fixture/nearby_params.output.md.json
index e8c53bed5..6ae645e8a 100644
--- a/test/fixture/nearby_params.output.md.json
+++ b/test/fixture/nearby_params.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#sessionscreate",
- "children": [
- {
- "type": "text",
- "value": "sessions.create"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/nest_params.output.md.json b/test/fixture/nest_params.output.md.json
index 58ed827d6..908d2e152 100644
--- a/test/fixture/nest_params.output.md.json
+++ b/test/fixture/nest_params.output.md.json
@@ -5,75 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo-1",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/newline-in-description.output.md.json b/test/fixture/newline-in-description.output.md.json
index bd94fd323..a69c51af9 100644
--- a/test/fixture/newline-in-description.output.md.json
+++ b/test/fixture/newline-in-description.output.md.json
@@ -5,25 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/no-name.output.md.json b/test/fixture/no-name.output.md.json
index d706040de..d99370230 100644
--- a/test/fixture/no-name.output.md.json
+++ b/test/fixture/no-name.output.md.json
@@ -5,25 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/optional-record-field-type.output.md.json b/test/fixture/optional-record-field-type.output.md.json
index e51b7ad5c..a5526b9db 100644
--- a/test/fixture/optional-record-field-type.output.md.json
+++ b/test/fixture/optional-record-field-type.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#record",
- "children": [
- {
- "type": "text",
- "value": "Record"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/params.output.md.json b/test/fixture/params.output.md.json
index dd2461e77..3bee700c1 100644
--- a/test/fixture/params.output.md.json
+++ b/test/fixture/params.output.md.json
@@ -5,235 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#addthem",
- "children": [
- {
- "type": "text",
- "value": "addThem"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#fishesandfoxes",
- "children": [
- {
- "type": "text",
- "value": "fishesAndFoxes"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#withdefault",
- "children": [
- {
- "type": "text",
- "value": "withDefault"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo",
- "children": [
- {
- "type": "text",
- "value": "Foo"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#method",
- "children": [
- {
- "type": "text",
- "value": "method"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#address6",
- "children": [
- {
- "type": "text",
- "value": "Address6"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#geojsonsource",
- "children": [
- {
- "type": "text",
- "value": "GeoJSONSource"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#myfunc",
- "children": [
- {
- "type": "text",
- "value": "myfunc"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo-1",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/react-jsx.output.md.json b/test/fixture/react-jsx.output.md.json
index aa13aef9d..5e8d48714 100644
--- a/test/fixture/react-jsx.output.md.json
+++ b/test/fixture/react-jsx.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#apples",
- "children": [
- {
- "type": "text",
- "value": "apples"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/readme/README.output.md b/test/fixture/readme/README.output.md
index 88b395ed1..54991d56e 100644
--- a/test/fixture/readme/README.output.md
+++ b/test/fixture/readme/README.output.md
@@ -4,11 +4,6 @@
-### Table of Contents
-
-- [foo](#foo)
-- [bar](#bar)
-
## foo
A function with documentation.
diff --git a/test/fixture/require-json-no-extension.output.md.json b/test/fixture/require-json-no-extension.output.md.json
index 558078620..c4109240d 100644
--- a/test/fixture/require-json-no-extension.output.md.json
+++ b/test/fixture/require-json-no-extension.output.md.json
@@ -4,25 +4,6 @@
{
"type": "html",
"value": ""
- },
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/require-json.output.md.json b/test/fixture/require-json.output.md.json
index 558078620..c4109240d 100644
--- a/test/fixture/require-json.output.md.json
+++ b/test/fixture/require-json.output.md.json
@@ -4,25 +4,6 @@
{
"type": "html",
"value": ""
- },
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/simple-hashbang.output.md.json b/test/fixture/simple-hashbang.output.md.json
index 1a68a45e4..caabc796e 100644
--- a/test/fixture/simple-hashbang.output.md.json
+++ b/test/fixture/simple-hashbang.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#simple-hashbanginput",
- "children": [
- {
- "type": "text",
- "value": "simple-hashbang.input"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/simple-private.output.md.json b/test/fixture/simple-private.output.md.json
index 558078620..c4109240d 100644
--- a/test/fixture/simple-private.output.md.json
+++ b/test/fixture/simple-private.output.md.json
@@ -4,25 +4,6 @@
{
"type": "html",
"value": ""
- },
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/simple-singlestar.output.md.json b/test/fixture/simple-singlestar.output.md.json
index 558078620..c4109240d 100644
--- a/test/fixture/simple-singlestar.output.md.json
+++ b/test/fixture/simple-singlestar.output.md.json
@@ -4,25 +4,6 @@
{
"type": "html",
"value": ""
- },
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/simple-triplestar.output.md.json b/test/fixture/simple-triplestar.output.md.json
index 558078620..c4109240d 100644
--- a/test/fixture/simple-triplestar.output.md.json
+++ b/test/fixture/simple-triplestar.output.md.json
@@ -4,25 +4,6 @@
{
"type": "html",
"value": ""
- },
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
}
]
}
\ No newline at end of file
diff --git a/test/fixture/simple-two.output.md.json b/test/fixture/simple-two.output.md.json
index 998d6d4be..71f9b4873 100644
--- a/test/fixture/simple-two.output.md.json
+++ b/test/fixture/simple-two.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#returntwo",
- "children": [
- {
- "type": "text",
- "value": "returnTwo"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/simple.output.github.md b/test/fixture/simple.output.github.md
index 7dfae4d52..43aadcbc9 100644
--- a/test/fixture/simple.output.github.md
+++ b/test/fixture/simple.output.github.md
@@ -1,9 +1,5 @@
-### Table of Contents
-
-- [simple.input](#simpleinput)
-
## simple.input
[test/fixture/simple.input.js:5-8]([github] "Source code on GitHub")
diff --git a/test/fixture/simple.output.md.json b/test/fixture/simple.output.md.json
index fe341876a..3413addb6 100644
--- a/test/fixture/simple.output.md.json
+++ b/test/fixture/simple.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#simpleinput",
- "children": [
- {
- "type": "text",
- "value": "simple.input"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sort-order-alpha.output.md.json b/test/fixture/sort-order-alpha.output.md.json
index b7157fd48..17ca468bb 100644
--- a/test/fixture/sort-order-alpha.output.md.json
+++ b/test/fixture/sort-order-alpha.output.md.json
@@ -5,307 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#a",
- "children": [
- {
- "type": "text",
- "value": "a"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#b",
- "children": [
- {
- "type": "text",
- "value": "b"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#c",
- "children": [
- {
- "type": "text",
- "value": "C"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#a-1",
- "children": [
- {
- "type": "text",
- "value": "A"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#a-2",
- "children": [
- {
- "type": "text",
- "value": "a"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#b-1",
- "children": [
- {
- "type": "text",
- "value": "B"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#b-2",
- "children": [
- {
- "type": "text",
- "value": "b"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#d",
- "children": [
- {
- "type": "text",
- "value": "D"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#a-3",
- "children": [
- {
- "type": "text",
- "value": "A"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#a-4",
- "children": [
- {
- "type": "text",
- "value": "a"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#b-3",
- "children": [
- {
- "type": "text",
- "value": "B"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#b-4",
- "children": [
- {
- "type": "text",
- "value": "b"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/string-literal-key.output.md.json b/test/fixture/string-literal-key.output.md.json
index c202a7cb5..ad9763e10 100644
--- a/test/fixture/string-literal-key.output.md.json
+++ b/test/fixture/string-literal-key.output.md.json
@@ -5,75 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#mycontainerobject",
- "children": [
- {
- "type": "text",
- "value": "MyContainerObject"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foo",
- "children": [
- {
- "type": "text",
- "value": "foo"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/alias.output.md.json b/test/fixture/sync/alias.output.md.json
index c3a231df3..83aac1158 100644
--- a/test/fixture/sync/alias.output.md.json
+++ b/test/fixture/sync/alias.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#nixon",
- "children": [
- {
- "type": "text",
- "value": "nixon"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/empty-example.output.md.json b/test/fixture/sync/empty-example.output.md.json
index 648bab584..1e6973fe4 100644
--- a/test/fixture/sync/empty-example.output.md.json
+++ b/test/fixture/sync/empty-example.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#returntwo",
- "children": [
- {
- "type": "text",
- "value": "returnTwo"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/flow-types.output.md.json b/test/fixture/sync/flow-types.output.md.json
index 88f1517bd..380be908e 100644
--- a/test/fixture/sync/flow-types.output.md.json
+++ b/test/fixture/sync/flow-types.output.md.json
@@ -5,251 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#addthem",
- "children": [
- {
- "type": "text",
- "value": "addThem"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#point",
- "children": [
- {
- "type": "text",
- "value": "Point"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#two",
- "children": [
- {
- "type": "text",
- "value": "Two"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#t",
- "children": [
- {
- "type": "text",
- "value": "T"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#t-1",
- "children": [
- {
- "type": "text",
- "value": "T"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#veryimportanttransform",
- "children": [
- {
- "type": "text",
- "value": "veryImportantTransform"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#optionalfunc",
- "children": [
- {
- "type": "text",
- "value": "optionalFunc"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#objectparamfn",
- "children": [
- {
- "type": "text",
- "value": "objectParamFn"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#objectparamfn-1",
- "children": [
- {
- "type": "text",
- "value": "objectParamFn"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#someobjectapi",
- "children": [
- {
- "type": "text",
- "value": "SomeObjectAPI"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/lots-of-options.output.md.json b/test/fixture/sync/lots-of-options.output.md.json
index 9b821762f..b014acdda 100644
--- a/test/fixture/sync/lots-of-options.output.md.json
+++ b/test/fixture/sync/lots-of-options.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#gsd",
- "children": [
- {
- "type": "text",
- "value": "gsd"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/meta.output.md.json b/test/fixture/sync/meta.output.md.json
index ff65e9111..3302e7e02 100644
--- a/test/fixture/sync/meta.output.md.json
+++ b/test/fixture/sync/meta.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#dewey",
- "children": [
- {
- "type": "text",
- "value": "dewey"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/multiexample.output.md.json b/test/fixture/sync/multiexample.output.md.json
index a59b2610a..642b881ec 100644
--- a/test/fixture/sync/multiexample.output.md.json
+++ b/test/fixture/sync/multiexample.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#multiexampleinput",
- "children": [
- {
- "type": "text",
- "value": "multiexample.input"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/rename.output.md.json b/test/fixture/sync/rename.output.md.json
index 1c39e40c0..5fd911ea9 100644
--- a/test/fixture/sync/rename.output.md.json
+++ b/test/fixture/sync/rename.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#cheese",
- "children": [
- {
- "type": "text",
- "value": "cheese"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/throws.output.md.json b/test/fixture/sync/throws.output.md.json
index c272dd736..9cfcf897b 100644
--- a/test/fixture/sync/throws.output.md.json
+++ b/test/fixture/sync/throws.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#returntwo",
- "children": [
- {
- "type": "text",
- "value": "returnTwo"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/trailing-only.output.md.json b/test/fixture/sync/trailing-only.output.md.json
index d92da51a1..4e76f746d 100644
--- a/test/fixture/sync/trailing-only.output.md.json
+++ b/test/fixture/sync/trailing-only.output.md.json
@@ -5,25 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/trailing.output.md.json b/test/fixture/sync/trailing.output.md.json
index 749cbe98d..4e5a2e4f2 100644
--- a/test/fixture/sync/trailing.output.md.json
+++ b/test/fixture/sync/trailing.output.md.json
@@ -5,97 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foobar",
- "children": [
- {
- "type": "text",
- "value": "fooBar"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#foobaz",
- "children": [
- {
- "type": "text",
- "value": "fooBaz"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#something",
- "children": [
- {
- "type": "text",
- "value": "Something"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/sync/typedef.output.md.json b/test/fixture/sync/typedef.output.md.json
index b900c6215..f898cfac4 100644
--- a/test/fixture/sync/typedef.output.md.json
+++ b/test/fixture/sync/typedef.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#mytype",
- "children": [
- {
- "type": "text",
- "value": "MyType"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/system-import.output.md.json b/test/fixture/system-import.output.md.json
index fe341876a..3413addb6 100644
--- a/test/fixture/system-import.output.md.json
+++ b/test/fixture/system-import.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#simpleinput",
- "children": [
- {
- "type": "text",
- "value": "simple.input"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/this-class.output.md.json b/test/fixture/this-class.output.md.json
index d8f4d6bc9..63cc89d71 100644
--- a/test/fixture/this-class.output.md.json
+++ b/test/fixture/this-class.output.md.json
@@ -5,153 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#bookshelf",
- "children": [
- {
- "type": "text",
- "value": "bookshelf"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#book",
- "children": [
- {
- "type": "text",
- "value": "Book"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#title",
- "children": [
- {
- "type": "text",
- "value": "title"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#bookshelf-1",
- "children": [
- {
- "type": "text",
- "value": "BookShelf"
- }
- ]
- }
- ]
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#title-1",
- "children": [
- {
- "type": "text",
- "value": "title"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/type_application.output.md.json b/test/fixture/type_application.output.md.json
index 78b569c66..8b378fa26 100644
--- a/test/fixture/type_application.output.md.json
+++ b/test/fixture/type_application.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#address6",
- "children": [
- {
- "type": "text",
- "value": "Address6"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/fixture/var-function-param-return.output.md.json b/test/fixture/var-function-param-return.output.md.json
index 1710cfe0a..205b981b9 100644
--- a/test/fixture/var-function-param-return.output.md.json
+++ b/test/fixture/var-function-param-return.output.md.json
@@ -5,53 +5,6 @@
"type": "html",
"value": ""
},
- {
- "depth": 3,
- "type": "heading",
- "children": [
- {
- "type": "text",
- "value": "Table of Contents"
- }
- ],
- "data": {
- "id": "table-of-contents",
- "htmlAttributes": {
- "id": "table-of-contents"
- },
- "hProperties": {
- "id": "table-of-contents"
- }
- }
- },
- {
- "type": "list",
- "ordered": false,
- "children": [
- {
- "type": "listItem",
- "loose": false,
- "children": [
- {
- "type": "paragraph",
- "children": [
- {
- "type": "link",
- "title": null,
- "url": "#f",
- "children": [
- {
- "type": "text",
- "value": "f"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
{
"depth": 2,
"type": "heading",
diff --git a/test/test.js b/test/test.js
index 9dec1d359..db67a9141 100644
--- a/test/test.js
+++ b/test/test.js
@@ -143,7 +143,7 @@ test('outputs', function (ttt) {
tt.ifError(err);
tt.test('markdown', function (t) {
- outputMarkdown(_.cloneDeep(result), {}, function (err, result) {
+ outputMarkdown(_.cloneDeep(result), { markdownToc: true }, function (err, result) {
t.ifError(err);
var outputfile = file.replace('.input.js', '.output.md');
if (UPDATE) {
@@ -212,7 +212,7 @@ test('outputs - sync', function (ttt) {
var result = documentation.buildSync([file], readOptionsFromFile(file));
tt.test('markdown', function (t) {
- outputMarkdown(result, {}, function (err, result) {
+ outputMarkdown(result, { markdownToc: true }, function (err, result) {
t.ifError(err);
var outputfile = file.replace('.input.js', '.output.md');
if (UPDATE) {
From 2cf84297f9e084a5be449cd78ce1450ea696a216 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Thu, 29 Dec 2016 16:32:57 -0500
Subject: [PATCH 027/583] docs(markdown): Document approaches to Markdown
theming (#647)
Fixes https://github.com/documentationjs/documentation/issues/550
---
docs/THEMING.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/docs/THEMING.md b/docs/THEMING.md
index 82bbd47a3..932b48e88 100644
--- a/docs/THEMING.md
+++ b/docs/THEMING.md
@@ -22,3 +22,11 @@ or an array of [vinyl](https://github.com/gulpjs/vinyl) `File` objects.
The theme is free to implement HTML generation however it chooses. See
[the default theme](https://github.com/documentationjs/documentation-theme-default/)
for some ideas.
+
+### Theming Markdown
+
+The default Markdown generator for documentation.js isn't customizable - instead
+of a plain-text theme, it's generated by creating an AST and then rendering
+it with [remark](http://remark.js.org/). If you need something extra in Markdown,
+you can either rally for that thing to be included in the default theme,
+or you can hack around it by using an HTML theme that outputs Markdown.
From ec03e0b4071c25a59d554401cb5ed94bd49eb751 Mon Sep 17 00:00:00 2001
From: Tom MacWright
Date: Thu, 29 Dec 2016 16:52:30 -0500
Subject: [PATCH 028/583] v4.0.0-beta.18
---
CHANGELOG.md | 20 ++++++++++++++++++++
package.json | 2 +-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 06ce8df49..f33cf6130 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,23 @@
+
+# [4.0.0-beta.18](https://github.com/documentationjs/documentation/compare/v4.0.0-beta.17...v4.0.0-beta.18) (2016-12-29)
+
+
+### Bug Fixes
+
+* **cli:** Fix error reporting in the CLI ([88c8f9a](https://github.com/documentationjs/documentation/commit/88c8f9a))
+* **markdown:** Start headings in Markdown at h2 (#644) ([2ae5d8f](https://github.com/documentationjs/documentation/commit/2ae5d8f))
+
+### Features
+
+* **bin:** Support globs on windows and use smarter recursion (#629) ([cb8fdfa](https://github.com/documentationjs/documentation/commit/cb8fdfa)), closes [#607](https://github.com/documentationjs/documentation/issues/607)
+* **markdown:** Add table of contents support for Markdown mode (#645) ([4c66fb1](https://github.com/documentationjs/documentation/commit/4c66fb1))
+
+### Performance Improvements
+
+* **dependencies:** Move standard-changelog to devDependencies (#636) ([7a66b3f](https://github.com/documentationjs/documentation/commit/7a66b3f))
+
+
+
# [4.0.0-beta.17](https://github.com/documentationjs/documentation/compare/v4.0.0-beta16...v4.0.0-beta.17) (2016-12-23)
diff --git a/package.json b/package.json
index fe8c2d412..7cbbc77d3 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "documentation",
"description": "a documentation generator",
- "version": "4.0.0-beta.17",
+ "version": "4.0.0-beta.18",
"author": "Tom MacWright",
"bin": {
"documentation": "./bin/documentation.js"
From ffc5c0f676f7fede185d99b81f668fc241d436c9 Mon Sep 17 00:00:00 2001
From: Reinier Battenberg
Date: Thu, 12 Jan 2017 05:41:59 +0100
Subject: [PATCH 029/583] Fix anchor for not toc targets (#653)
Clicking on toc items generated from the documentation.yaml file didnt work. The target id was not properly slugged. Always slug your target. Very important.
---
default_theme/note._ | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/default_theme/note._ b/default_theme/note._
index f98b2a444..0a83e5ba7 100644
--- a/default_theme/note._
+++ b/default_theme/note._
@@ -1,6 +1,6 @@