Skip to content

Commit

Permalink
Create README.md and make lib.rs tfn into doc test
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinegb committed Aug 4, 2024
1 parent e3e4caa commit d10b807
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# `beat_saber_map`

[![Crates.io Version](https://img.shields.io/crates/v/beat_saber_map)](https://crates.io/crates/beat_saber_map)
[![docs.rs](https://img.shields.io/docsrs/beat_saber_map)](https://docs.rs/beat_saber_map)
[![Rust](https://github.com/valentinegb/beat-saber-map-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/valentinegb/beat-saber-map-rs/actions/workflows/rust.yml)

Read and write Beat Saber maps with Rust.

```rs
use beat_saber_map::BeatSaberMap;

let map = BeatSaberMap::from_dir("sample").unwrap();

assert_eq!(map.info.song.title, "Magic");
```

Documentation can be found on [docs.rs](https://docs.rs/beat_saber_map).

## Roadmap

- [ ] Create structures for map files
- [x] [`Info`](https://docs.rs/beat_saber_map/latest/beat_saber_map/info/struct.Info.html)
- [ ] `Audio`
- [ ] `Beatmap`
- [ ] `Lightshow`
- [ ] Create utility methods for map file structures and [`BeatSaberMap`](https://docs.rs/beat_saber_map/latest/beat_saber_map/struct.BeatSaberMap.html)
- [x] [`BeatSaberMap::from_dir()`](https://docs.rs/beat_saber_map/latest/beat_saber_map/struct.BeatSaberMap.html#method.from_dir)
- [ ] More...
18 changes: 8 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
//! Read and write Beat Saber maps with Rust.
//!
//! ```
//! use beat_saber_map::BeatSaberMap;
//!
//! let map = BeatSaberMap::from_dir("sample").unwrap();
//!
//! assert_eq!(map.info.song.title, "Magic");
//! ```
//!
//! Refer to the [BSMG Wiki](https://bsmg.wiki/mapping/map-format.html) for language-agnostic documentation.
#![warn(missing_docs)]
Expand Down Expand Up @@ -43,13 +51,3 @@ impl BeatSaberMap {
})
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn from_dir_doesnt_fail() {
BeatSaberMap::from_dir("sample").unwrap();
}
}

0 comments on commit d10b807

Please sign in to comment.