From a0955acabd4f671685cc3fca4ac83daad2b3c89e Mon Sep 17 00:00:00 2001 From: Mika Attila Date: Tue, 10 Mar 2015 08:46:54 +0100 Subject: [PATCH] Add example to the documentation --- src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 83fee1c8..2263440b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,17 @@ +//! Rustic bindings to [libnotify](https://developer.gnome.org/libnotify/) +//! +//! ```rust +//! extern crate libnotify; +//! +//! fn main() { +//! let notify = libnotify::Context::new("hello").unwrap(); +//! let n = notify.new_notification("This is the summary.", +//! Some("This is the optional body text."), +//! None).unwrap(); +//! n.show().unwrap(); +//! } +//! ``` + extern crate "libnotify-sys" as sys; extern crate "glib-2_0-sys" as glib;