forked from primitivefinance/primitive-dodoc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix return tag in auto-gen doc,
@return
removed
- Loading branch information
Showing
4 changed files
with
132 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// SPDX-License-Identifier: SEE LICENSE IN LICENSE | ||
pragma solidity ^0.8.6; | ||
|
||
contract SomeOtherLibrary { | ||
/// @dev This function uses `keccak256(..)` to hash text. | ||
/// @notice Hash returned. | ||
/// @param someText Any text that you want to hash. | ||
/// @return The hash that was sent as a parameter. | ||
function someFunction(string memory someText) internal pure returns(bytes32) { | ||
return keccak256(bytes(someText)); | ||
} | ||
/// @dev This function uses `sha256(..)` to hash text. | ||
/// @notice Hash returned. | ||
/// @param someText Any text that you want to hash. | ||
/// @return hash The hash that was sent as a parameter. | ||
function someOtherFunction(string memory someText) internal pure returns(bytes32 hash) { | ||
return sha256(bytes(someText)); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
examples/docs/contracts/SomeOtherLibrary/SomeOtherLibrary.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"methods": {}, | ||
"events": {}, | ||
"errors": {}, | ||
"internalMethods": { | ||
"someFunction(string)": { | ||
"code": "function someFunction(string someText) internal pure returns (bytes32)", | ||
"inputs": { | ||
"someText": { | ||
"type": "string", | ||
"description": "Any text that you want to hash." | ||
} | ||
}, | ||
"outputs": { | ||
"_0": { | ||
"type": "bytes32", | ||
"description": "The hash that was sent as a parameter." | ||
} | ||
}, | ||
"details": "This function uses `keccak256(..)` to hash text.", | ||
"notice": "Hash returned." | ||
}, | ||
"someOtherFunction(string)": { | ||
"code": "function someOtherFunction(string someText) internal pure returns (bytes32 hash)", | ||
"inputs": { | ||
"someText": { | ||
"type": "string", | ||
"description": "Any text that you want to hash." | ||
} | ||
}, | ||
"outputs": { | ||
"hash": { | ||
"type": "bytes32", | ||
"description": "The hash that was sent as a parameter." | ||
} | ||
}, | ||
"details": "This function uses `sha256(..)` to hash text.", | ||
"notice": "Hash returned." | ||
} | ||
}, | ||
"path": "SomeOtherLibrary", | ||
"name": "SomeOtherLibrary" | ||
} |
66 changes: 66 additions & 0 deletions
66
examples/docs/contracts/SomeOtherLibrary/SomeOtherLibrary.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# SomeOtherLibrary | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
## Internal Methods | ||
|
||
### someFunction | ||
|
||
```solidity | ||
function someFunction(string someText) internal pure returns (bytes32) | ||
``` | ||
|
||
Hash returned. | ||
*This function uses `keccak256(..)` to hash text.* | ||
|
||
|
||
|
||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
|---|---|---| | ||
| someText | string | Any text that you want to hash. | | ||
|
||
#### Returns | ||
|
||
| Name | Type | Description | | ||
|---|---|---| | ||
| _0 | bytes32 | The hash that was sent as a parameter. | | ||
|
||
### someOtherFunction | ||
|
||
```solidity | ||
function someOtherFunction(string someText) internal pure returns (bytes32 hash) | ||
``` | ||
|
||
Hash returned. | ||
*This function uses `sha256(..)` to hash text.* | ||
|
||
|
||
|
||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
|---|---|---| | ||
| someText | string | Any text that you want to hash. | | ||
|
||
#### Returns | ||
|
||
| Name | Type | Description | | ||
|---|---|---| | ||
| hash | bytes32 | The hash that was sent as a parameter. | | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters