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

WIP: Create API reference #233

Closed
wants to merge 5 commits into from
Closed

WIP: Create API reference #233

wants to merge 5 commits into from

Conversation

TedDriggs
Copy link
Collaborator

This reference lists all supported attributes alphabetically.
It should in future link to examples and higher-level documentation.

Part of #232

@TedDriggs TedDriggs marked this pull request as draft March 1, 2022 15:34
This reference lists all supported attributes alphabetically.
It should in future link to examples and higher-level documentation.

Part of #232
@TedDriggs
Copy link
Collaborator Author

@andy128k can you take a look at this? I'm going to keep working away at getting all the options captured, and would appreciate a second set of eyes looking for errors and omissions.

@andy128k
Copy link
Contributor

andy128k commented Mar 3, 2022

I think it would be hard to maintain such document unless it is managed/covered by cargo doc.

@TedDriggs
Copy link
Collaborator Author

I wish there was a way to use cargo doc over our options structs to auto-generate this, but the options structs aren't public; derive_builder_core deliberately only exposes builder_for_struct(DeriveInput) -> TokenStream so that adding new options doesn't force us to rev the crate version.

Even serde doesn't seem to have a good way of generating this documentation; it's kept separately (example)

The current approach with a flat list of features in README.md isn't working - see #224 and #225 as recent examples where that's failed.

I'm hoping that the rate of API changes for derive_builder will be slow going forward; the crate seems pretty mature, and I'm increasingly conservative in what changes we should accept. I therefore think it'll be possible to manually enforce that any macro API change PR must have an update to this file.

@indietyp
Copy link

indietyp commented Apr 6, 2022

There are also things like: https://docs.rs/binread/latest/binread/attribute/index.html, which create an additional documentation-only module.

@TedDriggs TedDriggs closed this Jan 20, 2024
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

Successfully merging this pull request may close these issues.

None yet

3 participants