icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Docs cleanup: use `icu::` consistently

Open robertbastian opened this issue 1 year ago • 9 comments

I feel like we should introduce a common style for all our documentation. The icu crate, which will probably be any client's entry point to ICU4X uses icu:: in its examples, as do some other crates. However, we also have some crates don't go through the icu crate, so at some point our documentation changes from icu:: to icu_, which is inconsistent.

I suspect the default for users will be to include the whole icu crate, and the split into separate crates is more for our sake (and maybe for rare scenarios where users really care about compile times).

Should we standardize all our documentation and examples to icu::?

robertbastian avatar Jul 18 '22 14:07 robertbastian

Previously discussed in https://github.com/unicode-org/icu4x/issues/424 and fixed in https://github.com/unicode-org/icu4x/pull/616

sffc avatar Jul 18 '22 14:07 sffc

Ah, before my time. I don't think this is consistently used, so let's keep this open to track cleanup?

robertbastian avatar Jul 18 '22 15:07 robertbastian

Yep. Changing labels because I think there's not much to discuss. In packages that are re-exported by icu, we should use icu:: docs.

sffc avatar Jul 18 '22 15:07 sffc

What about datagen? Which crate(s) should it use to name data structs?

robertbastian avatar Jul 18 '22 15:07 robertbastian

Internally in our code, we should always use icu_. The icu:: is only for docs in the relevant crates.

sffc avatar Jul 18 '22 16:07 sffc

*databake, not datagen. What prefix should we use in the generated files? Clients will have to import different crates depending on that.

robertbastian avatar Jul 18 '22 17:07 robertbastian

hmm. Seems like maybe it could be a configuration option for whether to generate icu:: or icu_ bindings. We need to be able to generate the icu_ bindings since we know we have clients who care about the modularization, so if we add support for icu:: in databake, it should be additive.

sffc avatar Jul 18 '22 17:07 sffc

Yes we need an option for both, but I believe icu:: should be the default

robertbastian avatar Jul 18 '22 18:07 robertbastian

Using icu:: as the default sounds fine to me. It should make things easier for clients.

sffc avatar Jul 18 '22 18:07 sffc