mjhouse / ag-lcd

A rust port of the C++ LiquidCrystal library for arduino systems
GNU General Public License v3.0
17 stars 8 forks source link

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

Open JohnTheCoolingFan opened 1 year ago

JohnTheCoolingFan commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

OH! Yeah, good catch.

mjhouse commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Yeah, I'm cool with that.