-
Notifications
You must be signed in to change notification settings - Fork 446
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
Make contract docs visible to rustdoc #616
Conversation
Actually this is only part of the solution. We also (finally) need dedicated |
@Robbepop Do you mean code which includes the doc-specific code under a feature flag? Because that's what I already do in this PR, e.g. here:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The direction of this PR to solve the underlying issue is to implicitly expose the API of the smart contract to the outside thus enforcing pub
ink! module.
Unfortunately this forces smart contract authors to have this constraint of a pub
module.
What I'd like to see instead is to let the users decide what items and definitions they want to expose as with a normal Rust library or application and instead produce very clean and simple contract code with proper documentation everywhere when #[cfg(doc)]
is enabled.
This requires yet another complete codegen for this case next to ink-as-dependency
and std
in the context of metadata and testing.
Closed in favor of #632 as a follow-up. |
Closes #336.
I need to make some of our example
mod
public, otherwise there will never be any documentation for thepub
's in that module. We should also think about if we want to change thecargo contract new
template and the workshops.In terms of how it currently looks I uploaded the output of
cargo doc --no-deps
for two examples:I expect that we will need to discuss further details of what we want to hide/show in these docs, I created this PR also with the intention of starting this discussion and not with the idea of providing a perfect solution from the start. For example: Do we always want to hide
__ink
in the contract docs? Even if it's the event base?