documentationjs / documentationjs/documentation

@returns object only support text, it does not provide a default return value formatted with code

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

Description

I have been trying to use `@returns` with an object and write the documentation.

I always get the same output, for instance:

```
* @returns {Object} result - The result state.
* @returns {boolean} result.success - True if no errors.
* @returns {boolean} result.generatedPdfFilePathList - List of generated PDF filepath.
* @returns {Object} result.generatedLatexFilePathList - List of generated LaTeX filepath or undefined if nothing.
* @returns {string} result.errors - List of errors or undefined if no errors.
```
It will not use `` for result, after `{object}` everything is considered as text.

I have also tried:

```
* @return {object} [result={
* success, // True if no errors.
* generatedPdfFilePathList, // List of generated PDF filepath.
* generatedLatexFilePathList, // List of generated LaTeX filepath or undefined if nothing.
* errors, // List of errors or undefined if no errors.
* }] - The result object.
```

Same result.

This force us to write text while we wan't to describe the returned object:

* @return {object} including success, generatedPdfFilePathList, generatedLatexFilePathList and errors

Is there a way to write documentation for this properly?

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.