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

feature request: include doc comments in embed #8

Open
liamaharon opened this issue Sep 17, 2023 · 4 comments
Open

feature request: include doc comments in embed #8

liamaharon opened this issue Sep 17, 2023 · 4 comments
Assignees

Comments

@liamaharon
Copy link

It would be helpful if the doc comment for exported items could be optionally included with the code.

@sam0x17
Copy link
Owner

sam0x17 commented Sep 20, 2023

Yes I was actually thinking about this when I saw your previous issue. I'll see if I can work it in soon

@sam0x17 sam0x17 self-assigned this Sep 20, 2023
@kianenigma
Copy link

Ideally, I would expand this to any attribute. #[doc = ".."] is then merely one specialized case for this.

So, we need a way to say:

  1. bring in all attributes (default behavior)
  2. don't bring in any attributes,
  3. bring in only these attributes
  4. bring in all attributes except these.

@sam0x17
Copy link
Owner

sam0x17 commented Oct 13, 2023

if we want to get that granular, might make sense to simply have an additional attribute #[docify::capture_attrs_start] and #[docify::capture_attrs_end] which will capture any attributes appearing between those two and also include them in the export. You could do multiple capture regions in the same item. that is the simplest API I can think of that can do all of the above

could also have a convenience #[docify::capture_attrs] that just gets all of them.

For all of the above, docify-related attributes would be ignored

@kianenigma
Copy link

Simplest use case is that atm

#[docify::export]
/// A mapping from `T::AccountId` to `Balance`.
#[pallet::storage]
pub type Balances<T: Config> = StorageMap<Key = T::AccountId, Value = Balance>;

is not capable of picking up the docs, and it would be good if it does. No strong opinion about the syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants