Skip to content

Documenting tree-like object #1075

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

Closed
revolter opened this issue May 19, 2018 · 1 comment
Closed

Documenting tree-like object #1075

revolter opened this issue May 19, 2018 · 1 comment

Comments

@revolter
Copy link

revolter commented May 19, 2018

Having this test.js file:

/**
 * test
 * @type	{Object}
 */
test = {
	/**
	 * first
	 * @type	{Object}
	 */
	first: {
		/**
		 * second
		 * @type	{number}
		 */
		second: 2,
		/**
		 * third
		 * @type	{number}
		 */
		third: 3
	},
	/**
	 * fourth
	 * @type	{Object}
	 */
	fourth: {
		/**
		 * fifth
		 * @type	{number}
		 */
		fifth: 5
	}
}

documentation generates this Markdown:

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

-   [test](#test)
-   [first](#first)
-   [second](#second)
-   [third](#third)
-   [fourth](#fourth)
-   [fifth](#fifth)

### test

test

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### first

first

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### second

second

Type: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)

### third

third

Type: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)

### fourth

fourth

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### fifth

fifth

Type: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)

Is is possible for it to generate the TOC like:

-   [test](#test)
    -   [first](#first)
        -   [second](#second)
        -   [third](#third)
    -   [fourth](#fourth)
        -   [fifth](#fifth)

?

  • What version of documentation.js are you using?: 6.3.3
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): CLI
@tmcw
Copy link
Member

tmcw commented May 25, 2018

If you modify the initial statement to

const test = {

instead of test = {, then you can get some nesting:

-   [test][1]
    -   [first][2]
    -   [fourth][3]
-   [second][4]
-   [third][5]
-   [fifth][6]

But proper multi-level hierarchies are still a TODO, as in #735 - if you can help on that one, please do!

@tmcw tmcw closed this as completed May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants