Skip to content

Commit d10b807

Browse files
committed
Create README.md and make lib.rs tfn into doc test
1 parent e3e4caa commit d10b807

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# `beat_saber_map`
2+
3+
[![Crates.io Version](https://img.shields.io/crates/v/beat_saber_map)](https://crates.io/crates/beat_saber_map)
4+
[![docs.rs](https://img.shields.io/docsrs/beat_saber_map)](https://docs.rs/beat_saber_map)
5+
[![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)
6+
7+
Read and write Beat Saber maps with Rust.
8+
9+
```rs
10+
use beat_saber_map::BeatSaberMap;
11+
12+
let map = BeatSaberMap::from_dir("sample").unwrap();
13+
14+
assert_eq!(map.info.song.title, "Magic");
15+
```
16+
17+
Documentation can be found on [docs.rs](https://docs.rs/beat_saber_map).
18+
19+
## Roadmap
20+
21+
- [ ] Create structures for map files
22+
- [x] [`Info`](https://docs.rs/beat_saber_map/latest/beat_saber_map/info/struct.Info.html)
23+
- [ ] `Audio`
24+
- [ ] `Beatmap`
25+
- [ ] `Lightshow`
26+
- [ ] Create utility methods for map file structures and [`BeatSaberMap`](https://docs.rs/beat_saber_map/latest/beat_saber_map/struct.BeatSaberMap.html)
27+
- [x] [`BeatSaberMap::from_dir()`](https://docs.rs/beat_saber_map/latest/beat_saber_map/struct.BeatSaberMap.html#method.from_dir)
28+
- [ ] More...

src/lib.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
//! Read and write Beat Saber maps with Rust.
22
//!
3+
//! ```
4+
//! use beat_saber_map::BeatSaberMap;
5+
//!
6+
//! let map = BeatSaberMap::from_dir("sample").unwrap();
7+
//!
8+
//! assert_eq!(map.info.song.title, "Magic");
9+
//! ```
10+
//!
311
//! Refer to the [BSMG Wiki](https://bsmg.wiki/mapping/map-format.html) for language-agnostic documentation.
412
513
#![warn(missing_docs)]
@@ -43,13 +51,3 @@ impl BeatSaberMap {
4351
})
4452
}
4553
}
46-
47-
#[cfg(test)]
48-
mod tests {
49-
use super::*;
50-
51-
#[test]
52-
fn from_dir_doesnt_fail() {
53-
BeatSaberMap::from_dir("sample").unwrap();
54-
}
55-
}

0 commit comments

Comments
 (0)