Skip to content

Commit 2ae5d8f

Browse files
authored
fix(markdown): Start headings in Markdown at h2 (#644)
Fixes #641
1 parent 813dfbb commit 2ae5d8f

File tree

103 files changed

+319
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+319
-314
lines changed

docs/NODE_API.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
22

3-
# build
3+
## build
44

55
Generate JavaScript documentation as a list of parsed JSDoc
66
comments, given a root file as a path.
@@ -54,7 +54,7 @@ documentation.build(['index.js'], {
5454

5555
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback
5656

57-
# buildSync
57+
## buildSync
5858

5959
Generate JavaScript documentation given a list of inputs. This internal
6060
method does not support require-following and it returns its results
@@ -100,7 +100,7 @@ var results = documentation.buildSync(['index.js']);
100100

101101
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** list of results
102102

103-
# lint
103+
## lint
104104

105105
Lint files for non-standard or incorrect documentation
106106
information, returning a potentially-empty string
@@ -145,14 +145,14 @@ documentation.lint('file.js', {}, function (err, lintOutput) {
145145

146146
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback
147147

148-
# formats
148+
## formats
149149

150150
Documentation's formats are modular methods that take comments
151151
and options as input and call a callback with writable objects,
152152
like stringified JSON, markdown strings, or Vinyl objects for HTML
153153
output.
154154

155-
# formats.html
155+
## formats.html
156156

157157
Formats documentation as HTML.
158158

@@ -179,7 +179,7 @@ documentation.build(['index.js'], {}, function (err, res) {
179179

180180
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** Calls callback.
181181

182-
# formats.markdown
182+
## formats.markdown
183183

184184
Formats documentation as
185185
[Markdown](http://daringfireball.net/projects/markdown/).
@@ -206,7 +206,7 @@ documentation.build(['index.js'], {}, function (err, res) {
206206

207207
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback
208208

209-
# formats.json
209+
## formats.json
210210

211211
Formats documentation as a JSON string.
212212

lib/output/markdown_ast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function commentsToAST(comments, options, callback) {
204204

205205
return callback(null, rerouteLinks(linkerStack.link,
206206
u('root', generatorComment.concat(comments.reduce(function (memo, comment) {
207-
return memo.concat(generate(1, comment));
207+
return memo.concat(generate(2, comment));
208208
}, [])))));
209209
}
210210

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
},
8686
"scripts": {
8787
"lint": "eslint bin lib index.js test",
88-
"doc": "documentation build index.js -f md --access=public > docs/NODE_API.md",
88+
"doc": "./bin/documentation.js build index.js -f md --access=public > docs/NODE_API.md",
8989
"changelog": "standard-changelog -i CHANGELOG.md -w",
9090
"self-lint": "node ./bin/documentation.js lint",
9191
"test": "npm run lint && npm run self-lint && tap -t 120 --coverage --nyc-arg=--cache test/*.js test/lib test/streams"

test/fixture/auto_lang_hljs/multilanguage.output.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
22

3-
# multilanguage.input
3+
## multilanguage.input
44

55
**Extends Foo, Bar**
66

test/fixture/boolean-literal-type.output.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
22

3-
# f
3+
## f
44

55
**Parameters**
66

test/fixture/boolean-literal-type.output.md.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"value": "<!-- Generated by documentation.js. Update this documentation by updating the source code. -->"
77
},
88
{
9-
"depth": 1,
9+
"depth": 2,
1010
"type": "heading",
1111
"children": [
1212
{

test/fixture/class.config.output.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
22

3-
# MyClass
3+
## MyClass
44

55
This is my class, a demo thing.
66

77
**Properties**
88

99
- `howMany` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains
1010

11-
## getFoo
11+
### getFoo
1212

1313
Get the number 42
1414

@@ -18,12 +18,12 @@ Get the number 42
1818

1919
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two
2020

21-
## getUndefined
21+
### getUndefined
2222

2323
Get undefined
2424

2525
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything.
2626

27-
# Hello
27+
## Hello
2828

2929
World

test/fixture/class.output.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
22

3-
# MyClass
3+
## MyClass
44

55
This is my class, a demo thing.
66

77
**Properties**
88

99
- `howMany` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains
1010

11-
## getFoo
11+
### getFoo
1212

1313
Get the number 42
1414

@@ -18,7 +18,7 @@ Get the number 42
1818

1919
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two
2020

21-
## getUndefined
21+
### getUndefined
2222

2323
Get undefined
2424

test/fixture/class.output.md.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"value": "<!-- Generated by documentation.js. Update this documentation by updating the source code. -->"
77
},
88
{
9-
"depth": 1,
9+
"depth": 2,
1010
"type": "heading",
1111
"children": [
1212
{
@@ -139,7 +139,7 @@
139139
]
140140
},
141141
{
142-
"depth": 2,
142+
"depth": 3,
143143
"type": "heading",
144144
"children": [
145145
{
@@ -336,7 +336,7 @@
336336
]
337337
},
338338
{
339-
"depth": 2,
339+
"depth": 3,
340340
"type": "heading",
341341
"children": [
342342
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
22

3-
# document-exported-export-default-object.input
3+
## document-exported-export-default-object.input
44

5-
# x
5+
## x

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy