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

Exclude the "Name" column when the returned value does not have a name #70

Closed
PaulRBerg opened this issue Dec 8, 2021 · 2 comments
Closed
Labels
documentation Improvements or additions to documentation enhancement Improvement for an existing feature or system

Comments

@PaulRBerg
Copy link
Contributor

The generate-docs scripts generates a pretty Markdown report that we use in our official docs. The problem is that this report needs some polishing before is easy for use.

One issue is related to the "Name" column in table under the "Returned Values" section. When the returned value does not have a name, but the NatSpec comments make a reference to it, in the table we find the first word after the @return keyword, which often is "The".

To solve this, we should add an #if statement, and check whether the returned value has a name or not.

@PaulRBerg PaulRBerg added documentation Improvements or additions to documentation enhancement Improvement for an existing feature or system labels Dec 8, 2021
@scorpion9979
Copy link
Contributor

@PaulRBerg I believe this is no longer an issue.

Example:

### getPrice

```solidity
function getPrice(
    string symbol
) external returns (uint256)
```

Gets the official price for a symbol in the default format used by Chainlink, which
has 8 decimals.

Requirements:

- The feed must be set.
- The price returned by the oracle cannot be zero.

#### Parameters

| Name     | Type   | Description                        |
| :------- | :----- | :--------------------------------- |
| `symbol` | string | The symbol to fetch the price for. |

#### Return Values

| Name  | Type    | Description                                    |
| :---- | :------ | :--------------------------------------------- |
| `[0]` | uint256 | The price denominated in USD, with 8 decimals. |

@PaulRBerg
Copy link
Contributor Author

Yeah, they indeed solved this in the v0.6.0 release of solidity-docgen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement Improvement for an existing feature or system
Projects
None yet
Development

No branches or pull requests

2 participants