icu4x
icu4x copied to clipboard
Initial constructor documentation overhaul
This PR is based on the excellent feedback on https://github.com/unicode-org/icu4x/issues/2348#issuecomment-1249563656. I made the following improvements:
- A brand new documentation page about constructors, which includes a decision chart similar to
std::collections - Links to that documentation page from all constructors
- Some editorializing in both the new documentation page and the main
icu_providerpage about why data providers are important and what explicit data providers achieve (I incorporated some text from Zibi's post) - Examples on each source data provider demonstrating how it works with its corresponding constructor (BlobDataProvider, StaticDataProvider, FsDataProvider, and AnyPayloadProvider)
I started by updating icu_decimal::FixedDecimalFormatter. If these changes look good, I'll do them to all the rest of the constructors.
What I did not do in this PR is address concerns involving BakedDataProvider. That deserves its own PR, including a tutorial on how to leverage BakedDataProvider in your build.rs file.
Docs previews:
- icu::decimal::FixedDecimalFormatter [[ Sample for what formatter docs can look like ]]
- icu_decimal::FixedDecimalFormatter
- Observation: the links to
icu_provider::constructorswork fromicu_decimalbut not fromicu::decimal?
- Observation: the links to
- icu_provider [[ Added additional paragraph at the top ]]
- icu_provider::constructors [[ ALL NEW DOCS PAGE ]]