Skip to content

Commit

Permalink
docs: explain feature flags in crate-level documentation (#164)
Browse files Browse the repository at this point in the history
* docs: explain feature flags

* chore: fix rustdoc warnings

* docs: add note about WASM support to `atlas` feature documentation
  • Loading branch information
geieredgar committed Feb 10, 2023
1 parent d6d3c9c commit a832da0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/ldtk_int_cell.rs
Expand Up @@ -89,7 +89,7 @@ use std::{collections::HashMap, marker::PhantomData};
/// ```
///
/// ### `#[from_int_grid_cell]`
/// Indicates that a component or bundle that implements [From<IntGridCell>] should be created
/// Indicates that a component or bundle that implements [`From<IntGridCell>`] should be created
/// using that conversion.
/// This allows for more modular and custom component construction, and for different structs that
/// contain the same component to have different constructions of that component, without having to
Expand Down
2 changes: 1 addition & 1 deletion src/ldtk/mod.rs
Expand Up @@ -21,7 +21,7 @@
//! have been changed from vectors to [IVec2] and [Vec2].
//! 11. Some "color" fields on [LdtkJson], [EntityDefinition], [IntGridValueDefinition], and
//! [Level] have been changed from [String]s to [Color].
//! 12. [TilesetDefinition::rel_path]'s type changed from [String] to [Option<String>].
//! 12. [TilesetDefinition::rel_path]'s type changed from [String] to [`Option<String>`].
//! 13. All urls in docs have been changed to hyperlinks with `<>`
//! 14. `Reflect` has been derived for [Type].

Expand Down
16 changes: 16 additions & 0 deletions src/lib.rs
Expand Up @@ -96,6 +96,22 @@
//! world.
//! You can make them spawn according to their world location in LDtk by setting
//! [LevelSpawnBehavior::UseWorldTranslation].
//!
//! ### Feature flags
//!
//! This crate uses the following set of [feature flags]:
//! - `derive`: Enables the derive macros for [LdtkEntity] and [LdtkIntCell].
//! - `render`: Enables rendering via [bevy_ecs_tilemap]'s `render` feature. Disable it if you want
//! to run in headless mode.
//! - `atlas`: Enables the `atlas` feature of [bevy_ecs_tilemap]. This is required for WASM support
//! and also for tile spacing to work on Tile and AutoTile layers.
//!
//! The `derive` and `render` features are enabled by default.
//!
//! [feature flags]: https://doc.rust-lang.org/cargo/reference/features.html#the-features-section
//! [LdtkEntity]: app::LdtkEntity
//! [LdtkIntCell]: app::LdtkEntity
//! [bevy_ecs_tilemap]: https://docs.rs/bevy_ecs_tilemap

use bevy::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Expand Up @@ -15,7 +15,7 @@ use bevy_ecs_tilemap::{

use std::{collections::HashMap, hash::Hash};

/// The `int_grid_csv` field of a [LayerInstance] is a 1-dimensional [Vec<i32>].
/// The `int_grid_csv` field of a [LayerInstance] is a 1-dimensional [`Vec<i32>`].
/// This function can map the indices of this [Vec] to a corresponding [GridCoords].
///
/// Will return [None] if the resulting [GridCoords] is out of the bounds implied by the width and
Expand Down

0 comments on commit a832da0

Please sign in to comment.