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

limit docs.rs to 5 API tags #679

Merged
merged 7 commits into from
Mar 7, 2022
Merged

limit docs.rs to 5 API tags #679

merged 7 commits into from
Mar 7, 2022

Conversation

cataggar
Copy link
Member

@cataggar cataggar commented Mar 4, 2022

For #634, this limits the published API tags to 5, the default and 4 more.

const MAX_DOCS_RS_FEATURES: usize = 4;

/// Get a list of features to document at docs.rs in addition the default
pub fn docs_rs_features(tags: &[&Tag], default_feature: &str) -> Vec<String> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if there's no default, which I know is true for some services. Or, IIRC from your recent PR about this, is the default, by default, considered the first unless basic info declares an actual default?

Copy link
Contributor

@ctaggart ctaggart Mar 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may not be a default tag. The default feature takes that into account, see fn get_default_feature.

@@ -21,7 +21,7 @@ azure_identity = { path = "../../../sdk/identity", version = "0.1" }
tokio = { version = "1.0", features = ["macros"] }

[package.metadata.docs.rs]
all-features = true
features = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean nothing gets documented? I'd expect this to be a subset of features.default <= 5 features. This might be a symptom of no default with which I was concerned above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default feature gets documented.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be tested with:

cargo doc -p azure_svc_schemaregistry --no-deps --open --features "no-default-version"

image

@ctaggart
Copy link
Contributor

ctaggart commented Mar 5, 2022

I've tested by passing the list of features to cargo doc. All these work:

cargo doc -p azure_svc_schemaregistry --no-deps --open --features "no-default-version"

cargo doc -p azure_mgmt_app --no-deps --open --features "no-default-version"

cargo doc -p azure_mgmt_vmware --no-deps --open --features "no-default-version package-2021-06-01 package-2021-01-01-preview package-2020-07-17-preview package-2020-03-20"

@cataggar cataggar requested a review from heaths March 7, 2022 16:04
@cataggar cataggar merged commit 5be8146 into Azure:main Mar 7, 2022
@cataggar cataggar deleted the docs_rs branch March 7, 2022 22:33
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.

3 participants