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

Enable "this is available only on feature X only" for docs? #38

Open
JohnTheCoolingFan opened this issue May 8, 2023 · 7 comments
Open

Comments

@JohnTheCoolingFan
Copy link
Contributor

Some crates, for example tokio and mlua have "this is available only with feature X enabled" badge on some types/functions/macros. Since disabled by default i2c module was added, it does not show in docs. Of course, there is a mention of such functionality so it won't disappear from docs completely, but I think adding API docs would be helpful for those who want to use it.

More info on how it's done: https://stackoverflow.com/questions/61417452/how-to-get-a-feature-requirement-tag-in-the-documentation-generated-by-cargo-do

@vcrn
Copy link
Contributor

vcrn commented May 8, 2023

I was unfamiliar with this, but it sounds like a great idea! I feel like the I2C functionality should be very visible.

Semi-related to this and very simple too add: do we want to add I2C as some kind of key word in the /Cargo.toml? Or does it seem out-of-place, as if the crate's deals with some lower generic level of I2C, like the crate port-expander? I can start a separate issue for this, but it seems like a very small thing that doesn't obviously warrant starting a new issue.

@mjhouse
Copy link
Owner

mjhouse commented May 8, 2023

I was unfamiliar with this, but it sounds like a great idea! I feel like the I2C functionality should be very visible.

Semi-related to this and very simple too add: do we want to add I2C as some kind of key word in the /Cargo.toml? Or does it seem out-of-place, as if the crate's deals with some lower generic level of I2C, like the crate port-expander? I can start a separate issue for this, but it seems like a very small thing that doesn't obviously warrant starting a new issue.

I'm not sure I follow, actually. What do you mean by a key word?

@vcrn
Copy link
Contributor

vcrn commented May 8, 2023

I was unfamiliar with this, but it sounds like a great idea! I feel like the I2C functionality should be very visible.
Semi-related to this and very simple too add: do we want to add I2C as some kind of key word in the /Cargo.toml? Or does it seem out-of-place, as if the crate's deals with some lower generic level of I2C, like the crate port-expander? I can start a separate issue for this, but it seems like a very small thing that doesn't obviously warrant starting a new issue.

I'm not sure I follow, actually. What do you mean by a key word?

Referring to keywords under the [package] section, which at the moment is

keywords = [ "arduino", "avr-hal", "lcd", "HD44780", "LiquidCrystal" ]

Maybe we could add i2c there? I've at least in the past searched for "arduino lcd i2c" on crates.io.

@mjhouse
Copy link
Owner

mjhouse commented May 9, 2023

OH! Yeah, good catch.

@mjhouse
Copy link
Owner

mjhouse commented May 9, 2023

I changed them. I'm not sure it deserves it's own publish on crates.io, but it will be in the next one anyway.

@vcrn
Copy link
Contributor

vcrn commented May 9, 2023

Great! Yeah, I feel like we can publish a patch-bump (to 0.2.1) when we've done more updates of docs, like what has been suggested in this issue.

@mjhouse
Copy link
Owner

mjhouse commented May 9, 2023

Yeah, I'm cool with that.

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