adding some handlebar examples to README#290
adding some handlebar examples to README#290snreynolds wants to merge 1 commit intoOpenZeppelin:masterfrom
Conversation
frangio
left a comment
There was a problem hiding this comment.
Thank you @snreynolds! This is going to be really useful for people. I think the current examples are already a great start, so I would be happy to merge only these examples, but if you want to add more by all means go ahead.
I think the formatting needs a little work and I've left some concrete comments below.
| ``` | ||
|
|
||
|
|
||
| ## Example Handlebars Formatting |
There was a problem hiding this comment.
| ## Example Handlebars Formatting | |
| ## Example Handlebars Templates | |
| You can customize the output of solidity-docgen through Handlebars templates, using the `-t` argument in the command line with the path to the directory where the `contract.hbs` template file is located. For example, `solidity-docgen -t templates`. |
|
|
||
| Each of the following examples will go through various methods exposed by the solidity-docgen library, how to use them in handlebars, and what the resulting markdown output would look like. | ||
|
|
||
| 1. Getting the natspec @dev and @notice tags |
There was a problem hiding this comment.
This is getting rendered as a numbered list and I think we want them to look more like headings, so I would go with:
| 1. Getting the natspec @dev and @notice tags | |
| ### 1. Getting the natspec @dev and @notice tags |
And we should increase the nesting of the two subsections in each of these.
| ``` {{{natspec.userdoc}}} | ||
| {{{natspec.devdoc}}} | ||
| ``` |
There was a problem hiding this comment.
GitHub doesn't let me leave a suggestion for this, but the first line of each of these code blocks is not being displayed in the Markdown rendering. The first line needs to be on its own line, like so:
```handlebars
{{{natspec.userdoc}}}
{{{natspec.devdoc}}}
```
If we add handlebars at the top it will probably display with some syntax highlighting.
| This is the comment next to the @notice tag. | ||
| This is the comment next to the @dev tag. |
There was a problem hiding this comment.
I think we should display the output in a code block as well, so like:
This is the comment next to the @notice tag.
This is the comment next to the @dev tag.
| #### function {{name}} | ||
| Parameters: | ||
| {{natspec.params}} | ||
| - {{param}} |
There was a problem hiding this comment.
It would be great to also include the description.
| - {{param}} | |
| - {{param}}: {{description}} |
Creating draft PR as I have a couple more examples to add and would be good to get your feedback too