diff options
author | Hendrik Sollich <hendrik@hoodie.de> | 2019-11-24 14:41:09 +0100 |
---|---|---|
committer | Hendrik Sollich <hendrik@hoodie.de> | 2019-11-24 14:41:09 +0100 |
commit | f38066b7d21bc13e0ff590f5c8f3dedad4f2c3f8 (patch) | |
tree | 635fd2b391258a058dbe50187f89d6f36283425a | |
parent | cae5c8b6857341e7ff7363d0a9de861489f6a2d2 (diff) |
chore: update README and bump to 0.7.0
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | README.md | 43 | ||||
-rw-r--r-- | examples/readme.rs | 34 |
3 files changed, 65 insertions, 14 deletions
@@ -1,7 +1,7 @@ [package] authors = ["Hendrik Sollich <hendrik@hoodie.de>"] name = "icalendar" -version = "0.6.0" +version = "0.7.0" license = "MIT/Apache-2.0" edition = "2018" @@ -1,3 +1,5 @@ +<div align="center"> + # iCalendar in Rust [![Travis](https://img.shields.io/travis/hoodie/icalendar-rs.svg)](https://travis-ci.org/hoodie/icalendar-rs/) @@ -5,10 +7,12 @@ [![Crates.io](https://img.shields.io/crates/d/icalendar.svg)](https://crates.io/crates/icalendar) [![version](https://img.shields.io/crates/v/icalendar.svg)](https://crates.io/crates/icalendar/) [![documentation](https://docs.rs/icalendar/badge.svg)](https://docs.rs/icalendar/) +![maintenance](https://img.shields.io/maintenance/yes/2021) +[![contributors](https://img.shields.io/github/contributors/hoodie/notify-rust)](https://github.com/hoodie/notify-rust/graphs/contributors) +</div> -A very WIP library to generate rfc5545 calendars. -This is still just an early idea, there is not much implemented yet. -I haven't even read the full [spec](http://tools.ietf.org/html/rfc5545) yet. +A very simple library to generate [`rfc5545`](http://tools.ietf.org/html/rfc5545) calendars. +Please double check the [spec](http://tools.ietf.org/html/rfc5545). You want to help make this more mature? Please talk to me, Pull Requests and suggestions are very welcome. @@ -18,17 +22,17 @@ You want to help make this more mature? Please talk to me, Pull Requests and sug let event = Event::new() .summary("test event") .description("here I have something really important to do") - .starts(UTC::now()) + .starts(Utc::now()) .class(Class::Confidential) - .ends(UTC::now() + Duration::days(1)) + .ends(Utc::now() + Duration::days(1)) .append_property(Property::new("TEST", "FOOBAR") - .add_parameter("IMPORTANCE", "very") - .add_parameter("DUE", "tomorrow") - .done()) + .add_parameter("IMPORTANCE", "very") + .add_parameter("DUE", "tomorrow") + .done()) .done(); let bday = Event::new() - .all_day(UTC.ymd(2016, 3, 15)) + .all_day(Utc.ymd(2020, 3, 15)) .summary("My Birthday") .description( r#"Hey, I'm gonna have a party @@ -41,9 +45,22 @@ let todo = Todo::new().summary("Buy some milk").done(); let mut calendar = Calendar::new(); -calendar.add(event); -calendar.add(todo); -calendar.add(bday); +calendar.push(event); +calendar.push(todo); +calendar.push(bday); ``` -# License +## License + +icalendar-rs is licensed under either of + +* Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) +* MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) + +at your option. + +## Contribution + +Any help in form of descriptive and friendly [issues](https://github.com/hoodie/icalendar-rs/issues) or comprehensive pull requests are welcome! + +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in icalendar-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/examples/readme.rs b/examples/readme.rs new file mode 100644 index 0000000..b92ad05 --- /dev/null +++ b/examples/readme.rs @@ -0,0 +1,34 @@ +use chrono::*; +use icalendar::*; + +fn main() { + let event = Event::new() + .summary("test event") + .description("here I have something really important to do") + .starts(Utc::now()) + .class(Class::Confidential) + .ends(Utc::now() + Duration::days(1)) + .append_property(Property::new("TEST", "FOOBAR") + .add_parameter("IMPORTANCE", "very") + .add_parameter("DUE", "tomorrow") + .done()) + .done(); + + let bday = Event::new() + .all_day(Utc.ymd(2016, 3, 15)) + .summary("My Birthday") + .description( + r#"Hey, I'm gonna have a party + BYOB: Bring your own beer. + Hendrik"# + ) + .done(); + + let todo = Todo::new().summary("Buy some milk").done(); + + + let mut calendar = Calendar::new(); + calendar.push(event); + calendar.push(todo); + calendar.push(bday); +}
\ No newline at end of file |