-
Notifications
You must be signed in to change notification settings - Fork 13
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
Recommend having document-features
as an optional dependency
#8
Conversation
Just a thought, I might be missing something: If we recommend having document-features optional by default, doesn't that mean that the developer workflow of running If that's the case, then the docs should perhaps explain that Also, with that change, isn't the compatibility section obsolete now? |
Sorry for the delayed answer. I agree with @tronical that the problem is that if we suggest to make it optional by default, then But if the problem is just that the docs seems to induce people in error as they copy-paste the dependency line from the doc, maybe we can just fix that one point instead. |
That's the rub: should the docs nudge users towards having I prefer the first (hence this PR). I agree though that we should also document that one would need |
So since a83f3c4 the docs now always suggests having This PR suggest flipping this to always suggests having What say you, maintainers? |
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.
I don't think document-feature should necessarily be optional. It's a fairly lightweight dependency.
Also, the user will have to remember to enable the feature when then run cargo doc
themselves. And what about users of user's library, they should also be told to enable the feature when running the docs.
document-features
as an optional dependency
Belated agreement: having |
Closes #7
There are two ways to successfully use
document-features
. One is to to have it as a mandatory dependency:document-features = "0.2"
+#![doc = document_features::document_features!()]
However, this adds a dependency that is only needed when building docs, which is unnecessary. The other way is to have it optional:
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
This is more verbose, but means the
document-features
doesn't become a build dependency, which is great.Unfortunately, the old docs had a mix with
document-features = { version = "0.2", optional = true }
+#![doc = document_features::document_features!()]
which fails when you docargo check
.In this PR I suggest we always use the more verbose (but in my opinion better) way: the optional dependency.