Skip to content

Commit

Permalink
Include readme in package
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Oct 13, 2024
1 parent 3060aa4 commit cb8e2d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exclude = ["Justfile", "_typos.toml", "notes.md", "scripts/", ".github/"]
repository = "https://github.com/bash/mundy"
keywords = ["accessibility", "contrast", "UI", "color", "accent"]
categories = ["os", "gui"]
readme = "readme.md"

[dependencies]
cfg-if = "1.0.0"
Expand Down
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ The following preferences are supported:

## Example
```rust,no_run
use mundy::{Preferences, Interest};
use futures_util::StreamExt as _;
// Interest tells mundy which preferences it should monitor for you.
// use `Interest::All` if you're interested in all preferences.
let mut stream = Preferences::stream(Interest::AccentColor);
Expand All @@ -23,7 +26,7 @@ async {
while let Some(preferences) = stream.next().await {
eprintln!("accent color: {:?}", preferences.accent_color);
}
}
};
```

## [Docs](https://docs.rs/mundy)
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ mod stream_utils;
#[cfg_attr(docsrs, doc(cfg(doc)))]
pub mod feature_flags {}

#[cfg(doctest)]
#[doc = include_str!("../readme.md")]
pub mod readme_doctest {}

/// A collection of preferences retrieved by calling either
/// [`Preferences::stream`] or [`Preferences::subscribe`].
///
Expand Down

0 comments on commit cb8e2d0

Please sign in to comment.