documentationjs / documentationjs/documentation

option to group by type

Aperta
#992 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
5.8k
Fork
481
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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`

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con l’invocazione CLI documentata, `documentation build index.js --format html --output documentation`, e usa l’esempio JavaScript fornito per tracciare come le dichiarazioni `@typedef` e le funzioni creatrici compaiono nel Markdown generato. Il lavoro è completato quando le funzioni che restituiscono `ClientOption` sono raggruppate sotto quel tipo senza essere etichettate come static o instance, mentre i relativi parametri e link di ritorno rimangono documentati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
documentation
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.