-
Notifications
You must be signed in to change notification settings - Fork 118
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
Rewrite #350
Comments
This regex doesn't clear correctly lines with multiple spaces at the beginning. Like this:
may be worth replacing it like that: |
@vladyan18 The reason I didn't do that is that indentation can be significant. For example if the contents of the comment contain a Solidity example:
The indentation inside the function would be removed by the regex you suggested. An alternative would be to find the shortest common whitespace prefix across all lines. In my example it would be a single space, in your example it would be two spaces. But I also think the current behavior is quite reasonable. 🙂 Do you think it's worth changing this? |
@frangio Indeed, your example is correct. Another option would be to use something like So it's probably best to really leave it as it is. |
@frangio Also, I had a problem when I used This check forbids it. |
Thanks. I have a fix for that I'll publish later. |
@vladyan18 Just published the full suite of templates in a new beta. If you're testing this, I'd love to know what you think. |
Hi @frangio! Great work with this refactor. I upgraded to the To the newer format of v0.6. Should I provide one Handlebars template for each type of item? if yes, how can I do this? Do I have to work with the pages setting in Hardhat? |
Hi @PaulRBerg, glad you've tried it. It's taking me longer than I wanted to finish this new version and work on the documentation including a migration guide, but it's pretty stable by now. To customize the templates you need to set the templates parameter in the Hardhat config to name a directory of templates to override the default ones (can be just a subset and the rest use the default). As a starting point you can just copy the ones you need to customize from themes/markdown to your templates directory. Yes, each type of item has its own template, this is because items are not necessarily inside a contract now (e.g. free functions). I took a look at your repo and migrated it to the new version to see what that was like. Some of the template field names are kind of different, I'm wondering if I should add a compatibility layer to ease the migration. Please take a look at frangio/hifi@abea0bc and let me know if you have any feedback about the config and the output. |
Whoah, thanks so much for taking the time to migrate our repo for us. This is super helpful - it would have taken me ages to achieve the same result. Feedback:
And finally:
Yes, a compatibility layer would be nice. I actually forked the old template from Uniswap, so it's likely that many solidity-docgen users are relying on the previous fields. |
solidity-docgen is being rewritten to be simpler and easier to maintain and contribute to. These goals haven't been realized yet mainly because there is pending documentation and the code lacks some explanatory comments, but the point of this rewrite is that there should be a lot less to explain!
The work is mostly done and can be found in the
rewrite
branch.This is a breaking release, your existing templates will not work without some changes. The CLI is no longer available (but may be brought back later), a Hardhat plugin is available instead, as well as standalone use as a library.
There are some pending tasks:
A beta can be installed from npm as
solidity-docgen@next
, but this is experimental and can fail. If you try it out, report any issues.The text was updated successfully, but these errors were encountered: