-
-
Notifications
You must be signed in to change notification settings - Fork 326
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
update patch documentation #439
Conversation
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.
Looks good to me. Left some comments.
Makefile
Outdated
@@ -12,7 +12,7 @@ fmt: | |||
cargo +nightly fmt | |||
|
|||
doc: | |||
cargo +nightly doc --lib | |||
cargo +nightly doc --lib --features=derive,ws,oauth,jsonpatch |
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.
cargo +nightly doc --lib --features=derive,ws,oauth,jsonpatch | |
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --lib --features=derive,ws,oauth,jsonpatch |
To see feature tags, if I remember correctly. Appending -- --cfg docsrs
might work as well.
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.
That would be great, but for some reason, neither of those work as expected. At least not locally. I need to explicitly pass the features to get them to build with cargo +nightly doc --lib
, and -- --cfg
also doesn't work.
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 think the -- --cfg
flag is for cargo rustdoc
and that only works on a single manifest, whereas cargo doc
works on a workspace.
cargo rustdoc
never seems to get the link between kube
and kube_derive::CustomResource
(which is re-exported under a feature).
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.
Ok cargo +nightly doc --lib --workspace
picks up on all crates in the workspace correctly, but it still won't grab the default feature list from kube/Cargo.toml
's package.metadata.docs.rs
.
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.
Ah, I was running the command in kube/
.
From the root, the following worked for me:
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --lib --workspace --features=derive,ws,oauth,jsonpatch --open
Documented all crates and got feature tags in kube
. --open
opens the documentation in the browser.
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.
Ah, --open
is nice!
Was hoping that we could avoid duplicating the docsrs feature list, but whatever, it's only for local dev :-)
kube::api::Patch
now documents how to create a patch in the two normal ways + notes merge strat differenceskube-derive
now documents how to customize merge strats + schemas in general