refer

Crates.iorefer
lib.rsrefer
version0.1.3
sourcesrc
created_at2023-05-01 10:46:12.239716
updated_at2023-05-11 06:41:35.331056
descriptionParse and write Refer bibliography files.
homepagehttps://github.com/Euphrasiologist/refer/tree/main/crates/refer
repositoryhttps://github.com/Euphrasiologist/refer/tree/main/crates/refer
max_upload_size
id853322
size43,579
Max Brown (Euphrasiologist)

documentation

README

refer

This crate provides the basics for parsing and writing refer files.

It intends to follow the specification, but may be narrower in scope eventually.

Usage

Add this to your Cargo.toml file:

[dependencies]
refer = "0.1.3"

Example

Read a refer file from stdin, and print to stdout.

use refer::Reader;
use std::{io, error};

fn main() -> Result<(), Box<dyn error::Error>> {

    // construct a new reader
    let mut reader = Reader::new(io::stdin());

    // iterate over the records (borrowing them)
    for result in reader.records() {
        // records() returns a result
        let record = result?;
        // print the record line to stdout
        println!("{:?}", record);
    }

    Ok(())
}

There's also a refer::Writer struct for writing refer files. See the documentation for further information on this.

Thanks

Thanks to BurntSushi/Andrew Gallant for his work on the csv crate, on which the API/codebase for this current work is designed.

Commit count: 0

cargo fmt