paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

rustdoc does not show storage items in pallets #12206

Open gilescope opened 2 years ago

gilescope commented 2 years ago

Is there an existing issue?

Experiencing problems? Have you tried our Stack Exchange first?

Description of bug

There's no docs around storage items in pallets. This seems to be as they're not public enough. Could we add --document-private-items when we automatically generate our rust docs. This helps js devs reading up on pallets who might not be so comfortable reading the rust source. Also it's then in the search index.

Steps to reproduce

At the moment nothing shows when searching for OwnershipAcceptance at https://paritytech.github.io/substrate/master/.

gilescope commented 2 years ago

Could we emit an attribute in the storage macro to force rustdoc to document it even though it's private?

gilescope commented 2 years ago

Not yet it seems: https://github.com/rust-lang/rust/issues/66528

kianenigma commented 2 years ago

There's no docs around storage items in pallets. This seems to be as they're not public enough.

Depends on the storage item? some are public, some are not. Here's one that is public and its docs does show up:

https://paritytech.github.io/substrate/master/pallet_nomination_pools/pallet/type.PoolMembers.html

kianenigma commented 2 years ago

OwnershipAcceptance is pub(super), ergo it won't appear here.