documentationjs / documentationjs/documentation

option to group by type

Open
#992 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.8k
Forks
481
PR merge metrics
No merged PRs in 30d

Description

Most of my project works with classes with static and instance members. I do, however, have functions that are used to create `@typedef` types. It would be great if I could group them under the type name without them being tagged "static" or "instance".

Input:
```javascript
/**
* Option provided to the constructor
* @typedef ClientOption
*/
const ClientOption = undefined;

/**
* withTokenAuth allows for using the API access token.
*
* @param {string} email - The account email address.
* @param {string} token - The account API token.
* @return {ClientOption} - The opaque representation of this option
*/
function withTokenAuth(email, token) {
return function() {};
}

/**
* withUserServiceKey allows for using the newer User Service Key API access tokens.
*
* @param {string} email - The account email address.
* @param {string} key - The scoped API access key.
* @return {ClientOption} - The opaque representation of this option
*/
function withUserServiceKey(email, token) {
return function() {};
}
```

Output:
```markdown

### Table of Contents

- [ClientOption](#clientoption)
- [withTokenAuth](#withtokenauth)
- [withUserServiceKey](#withuserservicekey)

## ClientOption

Option provided to the constructor

## withTokenAuth

withTokenAuth allows for using the API access token.

**Parameters**

- `email` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The account email address.
- `token` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The account API token.

Returns **[ClientOption](#clientoption)** The opaque representation of this option

## withUserServiceKey

withUserServiceKey allows for using the newer User Service Key API access tokens.

**Parameters**

- `email` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The account email address.
- `token`
- `key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The scoped API access key.

Returns **[ClientOption](#clientoption)** The opaque representation of this option
```

![image](https://user-images.githubusercontent.com/273509/34856461-1047c972-f6fa-11e7-910d-c10852700b76.png)

While only two are shown for example, my project has a bunch of these type creators. It would be great to group them under the type they create.

* What version of documentation.js are you using?:
v5.3.5

* How are you running documentation.js (on the CLI, Node.js API, Grunt, other?):
`documentation build index.js --format html --output documentation`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.