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

Add support for custom tags #40

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/contracts/Bar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,28 @@ interface IBar {
/// @notice Emitted when transfer
/// @dev Transfer some stuff
/// @param foo Amount of stuff
/// @custom:danger This event exposes private info
event Transfer(uint256 foo);

/// @notice Thrown when doh
/// @dev Bad doh error
/// @param yay A bool
/// @custom:info Additional info
error Doh(bool yay);
}

/// @title Bar contract
/// @author Primitive
/// @notice Manages the bar
/// @dev Blablou
/// @custom:version v2.0.1
contract Bar is IBar {
/// @inheritdoc IBar
function set(T memory t) external { }

/// @notice Cool function bro
/// @custom:requirement Check first requirement
/// @custom:requirement Check second requirement
function boop(uint256 bar) external { }

/// @notice Alt cool function bro
Expand Down
7 changes: 5 additions & 2 deletions examples/docs/Bar.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
}
},
"outputs": {},
"notice": "Cool function bro"
"notice": "Cool function bro",
"custom:requirement": "Check first requirementCheck second requirement"
},
"boop(uint256,uint256)": {
"stateMutability": "nonpayable",
Expand Down Expand Up @@ -74,13 +75,15 @@
}
},
"notice": "Thrown when doh",
"details": "Bad doh error"
"details": "Bad doh error",
"custom:info": "Additional info"
}
},
"path": "",
"title": "Bar contract",
"notice": "Manages the bar",
"details": "Blablou",
"author": "Primitive",
"custom:version": "v2.0.1",
"name": "Bar"
}
16 changes: 15 additions & 1 deletion examples/docs/Bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Manages the bar

*Blablou*

**Version:** *v2.0.1*

## Methods

### baap
Expand All @@ -20,6 +22,8 @@ Baaps the yaps





#### Parameters

| Name | Type | Description |
Expand All @@ -35,6 +39,8 @@ function boop(uint256 bar) external nonpayable

Cool function bro

**Requirement:** *Check first requirementCheck second requirement*



#### Parameters
Expand All @@ -53,6 +59,8 @@ Alt cool function bro





#### Parameters

| Name | Type | Description |
Expand All @@ -70,6 +78,8 @@ function set(IBar.T t) external nonpayable





#### Parameters

| Name | Type | Description |
Expand All @@ -90,6 +100,8 @@ Emitted when transfer





#### Parameters

| Name | Type | Description |
Expand All @@ -107,9 +119,11 @@ error Doh(bool yay)
```

Thrown when doh

*Bad doh error*


**Info:** *Additional info*

#### Parameters

| Name | Type | Description |
Expand Down
6 changes: 5 additions & 1 deletion examples/docs/Foo.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@





## Methods

### nonces
Expand All @@ -17,9 +19,11 @@ function nonces(address) external view returns (uint256)
```

Returns the nonce of an address

*Nonces much*




#### Parameters

| Name | Type | Description |
Expand Down
6 changes: 4 additions & 2 deletions examples/docs/IBar.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
}
},
"notice": "Emitted when transfer",
"details": "Transfer some stuff"
"details": "Transfer some stuff",
"custom:danger": "This event exposes private info"
}
},
"errors": {
Expand All @@ -45,7 +46,8 @@
}
},
"notice": "Thrown when doh",
"details": "Bad doh error"
"details": "Bad doh error",
"custom:info": "Additional info"
}
},
"path": "",
Expand Down
14 changes: 12 additions & 2 deletions examples/docs/IBar.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@





## Methods

### boop
Expand All @@ -20,6 +22,8 @@ function boop(uint256 bar) external nonpayable





#### Parameters

| Name | Type | Description |
Expand All @@ -36,6 +40,8 @@ function set(IBar.T t) external nonpayable





#### Parameters

| Name | Type | Description |
Expand All @@ -53,9 +59,11 @@ event Transfer(uint256 foo)
```

Emitted when transfer

*Transfer some stuff*

**Danger:** *This event exposes private info*


#### Parameters

| Name | Type | Description |
Expand All @@ -73,9 +81,11 @@ error Doh(bool yay)
```

Thrown when doh

*Bad doh error*


**Info:** *Additional info*

#### Parameters

| Name | Type | Description |
Expand Down
22 changes: 18 additions & 4 deletions examples/docs/IExampleContract.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Put a simple description of the contract here.

*And then a more complicated and tech oriented description of the contract there.*



## Methods

### anotherThing
Expand All @@ -17,9 +19,11 @@ function anotherThing(uint256 num) external pure returns (uint256)
```

Does another thing when the function is called.

*More info about doing another thing when the function is called.*




#### Parameters

| Name | Type | Description |
Expand All @@ -43,6 +47,8 @@ Poorly documented function starting with weird spaces.





#### Returns

| Name | Type | Description |
Expand All @@ -56,9 +62,11 @@ function doSomething(address a, uint256 b) external nonpayable returns (uint256
```

Does something when this function is called.

*More info about the doSomething, and this even works when the explanation is on two lines.*




#### Parameters

| Name | Type | Description |
Expand Down Expand Up @@ -86,6 +94,8 @@ A bad documented payable function.





## Events

### DoSomething
Expand All @@ -95,9 +105,11 @@ event DoSomething(address indexed a, uint256 b)
```

Emitted when the function doSomething is called.

*More info about the event can be added here.*




#### Parameters

| Name | Type | Description |
Expand All @@ -116,9 +128,11 @@ error RandomError(address expected, address actual)
```

Thrown when an error happens.

*More info about the error.*




#### Parameters

| Name | Type | Description |
Expand Down
6 changes: 5 additions & 1 deletion examples/docs/IFoo.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@





## Methods

### nonces
Expand All @@ -17,9 +19,11 @@ function nonces(address _0) external view returns (uint256)
```

Returns the nonce of an address

*Nonces much*




#### Parameters

| Name | Type | Description |
Expand Down
6 changes: 5 additions & 1 deletion examples/docs/subfolder/AnotherContract.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@





## Methods

### tip
Expand All @@ -17,9 +19,11 @@ function tip(uint256 much, address mop) external nonpayable
```

A strange function

*Someone wrote this weird function...*




#### Parameters

| Name | Type | Description |
Expand Down
Loading