Skip to content

Commit

Permalink
Added some docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
billallen256 committed Nov 1, 2024
1 parent d05ca6b commit 5b09da9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bluefile"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
license = "Apache-2.0"
readme = "README.md"
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,27 @@ Add the following to your project's `Cargo.toml`:
bluefile = "*"
```

Examples can be found in the `tests` directory.

```rust
use std::fs::File;
use bluefile::read_header;

let file = File::open("/path/to/bluefile").unwrap();
let header = read_header(&file).unwrap();
println!("{}", header.type_code);
println!("{}", header.data_type);
...
```

Additional examples can be found in the `tests` directory and in the `bluejay` utility.

### bluejay

Bluejay is a command line utility for getting bluefile header info in JSON format.

```
bluejay /path/to/bluefile
```

## Running Tests

Expand Down
13 changes: 13 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
//! Experimental Rust library for handling X-Midas Bluefiles.
//!
//! ```
//! use std::fs::File;
//! use bluefile::read_header;
//!
//! let file = File::open("/path/to/bluefile").unwrap();
//! let header = read_header(&file).unwrap();
//! println!("{}", header.type_code);
//! println!("{}", header.data_type);
//! ...
//! ```
use std::fmt;
use std::fs::File;
use std::io::Read;
Expand Down

0 comments on commit 5b09da9

Please sign in to comment.