Skip to content

Commit

Permalink
Document all feature, and show feature requirements
Browse files Browse the repository at this point in the history
This is similar to what we do in geojson and elsewhere. Though I just
learned about doc_auto_cfg which makes this way easier by automatically
annotating any required items, rather than needing to try to sprinkle a
bunch of calls all over like:

    #[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
    mod my_geo_types_module;
  • Loading branch information
michaelkirk committed May 4, 2022
1 parent 9a34d9a commit 9981892
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ default = ["geo-types"]
[[bench]]
name = "parse"
harness = false

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// The unstable `doc_auto_cfg` feature annotates documentation with any required cfg/features
// needed for optional items. We set the `docsrs` config when building for docs.rs. To use it
// in a local docs build, run: `cargo +nightly rustdoc --all-features -- --cfg docsrs`
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

//! The `wkt` crate provides conversions to and from the [WKT (Well Known Text)](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry)
//! geometry format.
//!
Expand Down

0 comments on commit 9981892

Please sign in to comment.