Skip to content

Commit

Permalink
Merge pull request #1142 from waywardmonkeys/enable-all-features-and-…
Browse files Browse the repository at this point in the history
…doc_auto_cfg-on-docs-rs

Generate docs for most features on docs.rs
  • Loading branch information
dfrg authored Sep 11, 2024
2 parents 5780ca0 + cd89d23 commit 7b4d9ba
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions font-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ edition.workspace = true
license.workspace = true
repository.workspace = true

[package.metadata.docs.rs]
# To build locally:
# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
all-features = true

[features]
std = []
bytemuck = ["dep:bytemuck"]
Expand Down
1 change: 1 addition & 0 deletions font-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//!
//! [data types]: https://docs.microsoft.com/en-us/typography/opentype/spec/otff#data-types

#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![deny(rustdoc::broken_intra_doc_links)]
#![warn(clippy::doc_markdown)]
#![cfg_attr(not(feature = "std"), no_std)]
Expand Down
5 changes: 5 additions & 0 deletions read-fonts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ edition.workspace = true
license.workspace = true
repository.workspace = true

[package.metadata.docs.rs]
# To build locally:
# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --features libm,serde,std
features = ["libm", "serde", "std"]

[features]
std = ["font-types/std"]
codegen_test = []
Expand Down
1 change: 1 addition & 0 deletions read-fonts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
//! [NameString]: tables::name::NameString
//! [table-directory]: https://learn.microsoft.com/en-us/typography/opentype/spec/otff#table-directory

#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![deny(rustdoc::broken_intra_doc_links)]
#![cfg_attr(not(feature = "std"), no_std)]
Expand Down
5 changes: 5 additions & 0 deletions skrifa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ edition.workspace = true
license.workspace = true
repository.workspace = true

[package.metadata.docs.rs]
# To build locally:
# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
all-features = true

[features]
default = ["traversal"]
std = ["read-fonts/std"]
Expand Down
1 change: 1 addition & 0 deletions skrifa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//! See the [readme](https://github.com/googlefonts/fontations/blob/main/skrifa/README.md)
//! for additional details.

#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![cfg_attr(not(any(test, feature = "std")), no_std)]

Expand Down
5 changes: 5 additions & 0 deletions write-fonts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ edition.workspace = true
license.workspace = true
repository.workspace = true

[package.metadata.docs.rs]
# To build locally:
# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
all-features = true

[features]
default = []
read = []
Expand Down
2 changes: 2 additions & 0 deletions write-fonts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
//! [`FromTableRef`]: from_obj::FromTableRef
//! [`ToOwnedTable`]: from_obj::ToOwnedTable

#![cfg_attr(docsrs, feature(doc_auto_cfg))]

mod collections;
pub mod error;
mod font_builder;
Expand Down

0 comments on commit 7b4d9ba

Please sign in to comment.