Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(markdown): Start headings in Markdown at h2 #644

Merged
merged 1 commit into from
Dec 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/NODE_API.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

# build
## build

Generate JavaScript documentation as a list of parsed JSDoc
comments, given a root file as a path.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand All @@ -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/).
Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion lib/output/markdown_ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}, [])))));
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/auto_lang_hljs/multilanguage.output.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

# multilanguage.input
## multilanguage.input

**Extends Foo, Bar**

Expand Down
2 changes: 1 addition & 1 deletion test/fixture/boolean-literal-type.output.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

# f
## f

**Parameters**

Expand Down
2 changes: 1 addition & 1 deletion test/fixture/boolean-literal-type.output.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"value": "<!-- Generated by documentation.js. Update this documentation by updating the source code. -->"
},
{
"depth": 1,
"depth": 2,
"type": "heading",
"children": [
{
Expand Down
8 changes: 4 additions & 4 deletions test/fixture/class.config.output.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

# MyClass
## MyClass

This is my class, a demo thing.

**Properties**

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

## getFoo
### getFoo

Get the number 42

Expand All @@ -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
6 changes: 3 additions & 3 deletions test/fixture/class.output.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

# MyClass
## MyClass

This is my class, a demo thing.

**Properties**

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

## getFoo
### getFoo

Get the number 42

Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions test/fixture/class.output.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"value": "<!-- Generated by documentation.js. Update this documentation by updating the source code. -->"
},
{
"depth": 1,
"depth": 2,
"type": "heading",
"children": [
{
Expand Down Expand Up @@ -139,7 +139,7 @@
]
},
{
"depth": 2,
"depth": 3,
"type": "heading",
"children": [
{
Expand Down Expand Up @@ -336,7 +336,7 @@
]
},
{
"depth": 2,
"depth": 3,
"type": "heading",
"children": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

# document-exported-export-default-object.input
## document-exported-export-default-object.input

# x
## x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"value": "<!-- Generated by documentation.js. Update this documentation by updating the source code. -->"
},
{
"depth": 1,
"depth": 2,
"type": "heading",
"children": [
{
Expand All @@ -16,7 +16,7 @@
]
},
{
"depth": 1,
"depth": 2,
"type": "heading",
"children": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

# document-exported-export-default-value.input
## document-exported-export-default-value.input
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"value": "<!-- Generated by documentation.js. Update this documentation by updating the source code. -->"
},
{
"depth": 1,
"depth": 2,
"type": "heading",
"children": [
{
Expand Down
60 changes: 30 additions & 30 deletions test/fixture/document-exported.output.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

# 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

Expand All @@ -48,56 +48,56 @@ 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

**Parameters**

- `y` **Y**

# o2
## o2

# om2
## om2
Loading